Changeset d0ef259 for components/roulette/BetModal.jsx
- Timestamp:
- 07/12/22 00:13:20 (2 years ago)
- Branches:
- main
- Children:
- e9f11ac
- Parents:
- 95ce58b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
components/roulette/BetModal.jsx
r95ce58b rd0ef259 30 30 31 31 function placeBet() { 32 axios.get(`/api/roulette?action=place_bet&session_id=${localStorage.CAESSINO_SESSION_ID}&betAmount=${styleState.roulette.inputControls.bet.chosenCredits}&whichBets=${styleState.roulette.whichBets.toString()}`).then(res => { 33 if (res.data?.success) { 34 dispatch(setPlayer({ 35 ...playerState.player, 36 credits: res.data?.credits, 37 })); 32 axios.get(`/api/roulette?action=place_bet&session_id=${localStorage.CAESSINO_SESSION_ID}&betAmount=${styleState.roulette.inputControls.bet.chosenCredits}&whichBets=${styleState.roulette.whichBets.toString()}&coinPlacedX=${styleState.roulette.coinPlaced.x}&coinPlacedY=${styleState.roulette.coinPlaced.y}`); 38 33 39 dispatch(setRouletteGame(res.data?.game)); 40 41 closeModal(false); 42 } 43 }); 34 closeModal(); 44 35 } 45 36 46 function closeModal(removeCoin = true) { 47 if (removeCoin) { 48 dispatch(setRoulette({ 49 ...styleState.roulette, 50 displays: { 51 ...styleState.roulette.displays, 52 betModal: false, 53 }, 54 showCoin: false, 55 })) 56 } 57 else { 58 dispatch(setRoulette({ 59 ...styleState.roulette, 60 displays: { 61 ...styleState.roulette.displays, 62 betModal: false, 63 }, 64 showCoin: true, 65 })); 66 } 37 function closeModal() { 38 dispatch(setRoulette({ 39 ...styleState.roulette, 40 displays: { 41 ...styleState.roulette.displays, 42 betModal: false, 43 }, 44 })); 67 45 } 68 46 69 47 return ( 70 <div className="rouletteBetModal" style={{display: styleState.roulette.displays.betModal && playerState.rouletteGame. timeToStart > 10? 'flex' : 'none'}}>48 <div className="rouletteBetModal" style={{display: styleState.roulette.displays.betModal && playerState.rouletteGame.game.timeToStart > 10 && playerState.rouletteGame.game.timeToStart <= playerState.rouletteGame.game.COUNTDOWN_FROM ? 'flex' : 'none'}}> 71 49 <p>You have chosen to bet on: <span>{styleState.roulette.whichBets.map((bet, i) => `${bet} `)}</span><br/>Please select the amount you will bet</p> 72 50 <div>
Note:
See TracChangeset
for help on using the changeset viewer.