source: components/blackjack/DisplayBet.jsx@ b4369c8

main
Last change on this file since b4369c8 was 87614a5, checked in by anastasovv <simon@…>, 2 years ago

Blackjack prototype

  • Property mode set to 100644
File size: 781 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.game.status.substr(1, 1)) >= 2 ? 'block' : 'none';
10 let displaySideBet = ( parseInt(playerState.game.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.