source: components/blackjack/DisplayBet.jsx@ e007fcd

main
Last change on this file since e007fcd was 55701f0, checked in by anastasovv <simon@…>, 2 years ago

Added 1 second update_state calls in blackjack

  • Property mode set to 100644
File size: 786 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 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
18export default DisplayBet
Note: See TracBrowser for help on using the repository browser.