source:
components/blackjack/DisplayBet.jsx
Last change on this file was 55701f0, checked in by , 2 years ago | |
---|---|
|
|
File size: 786 bytes |
Line | |
---|---|
1 | import React from 'react' |
2 | |
3 | import { useSelector } from 'react-redux'; |
4 | |
5 | const DisplayBet = () => { |
6 | const playerState = useSelector(state => state.player); |
7 | const styleState = useSelector(state => state.style); |
8 | let display = parseInt(playerState.blackjackGame.status.substr(1, 1)) >= 2 ? 'block' : 'none'; |
9 | let displaySideBet = ( parseInt(playerState.blackjackGame.status.substr(1, 1)) >= 3 && parseInt(playerState.blackjackGame.sideBet) > 0 && !playerState.blackjackGame.sideBetOutcomeMessageShown ) ? 'block' : 'none'; |
10 | |
11 | return ( |
12 | <div className="blackjackDisplayBet" style={{display: display}}> |
13 | <span>${playerState.blackjackGame.initialBet}{displaySideBet === 'block' ? ` + $${playerState.blackjackGame.sideBet}` : ''}</span> |
14 | </div> |
15 | ) |
16 | } |
17 | |
18 | export default DisplayBet |
Note:
See TracBrowser
for help on using the repository browser.