source: components/blackjack/DisplayBet.jsx@ 1df3fde

main
Last change on this file since 1df3fde was 9bd09b0, checked in by anastasovv <simon@…>, 2 years ago

Roulette place a bet functionality

  • Property mode set to 100644
File size: 799 bytes
Line 
1import React from 'react'
2
3import { useSelector } from 'react-redux';
4
5const DisplayBet = () => {
6 const playerState = useSelector(state => state.player);
7 const styleState = useSelector(state => state.style);
8
9 let display = parseInt(playerState.blackjackGame.status.substr(1, 1)) >= 2 ? 'block' : 'none';
10 let displaySideBet = ( parseInt(playerState.blackjackGame.status.substr(1, 1)) >= 3 && parseInt(styleState.blackjack.inputControls.sideBet.chosenCredits) > 0 ) ? 'block' : 'none';
11
12 return (
13 <div className="blackjackDisplayBet" style={{display: display}}>
14 <span>${styleState.blackjack.inputControls.initialBet.chosenCredits}{displaySideBet === 'block' ? ` + $${styleState.blackjack.inputControls.sideBet.chosenCredits}` : ''}</span>
15 </div>
16 )
17}
18
19export default DisplayBet
Note: See TracBrowser for help on using the repository browser.