main
Last change
on this file since 433e0c5 was 87614a5, checked in by anastasovv <simon@…>, 2 years ago |
Blackjack prototype
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | import React from 'react'
|
---|
2 |
|
---|
3 | import { useSelector, useDispatch } from 'react-redux'
|
---|
4 | import { setStyle } from '../redux/reducers/styleSlice';
|
---|
5 |
|
---|
6 | import { AiOutlineClose } from 'react-icons/ai';
|
---|
7 |
|
---|
8 | const Stats = () => {
|
---|
9 | const styleState = useSelector(state => state.style);
|
---|
10 |
|
---|
11 | const dispatch = useDispatch();
|
---|
12 |
|
---|
13 | function close() {
|
---|
14 | dispatch(setStyle({
|
---|
15 | ...styleState.style,
|
---|
16 | displayStatsScreen: false,
|
---|
17 | }))
|
---|
18 | }
|
---|
19 |
|
---|
20 | return (
|
---|
21 | <div className="fullscreen fs-centered statsScreen" style={{display: styleState.style.displayStatsScreen ? 'block' : 'none'}}>
|
---|
22 | <AiOutlineClose onClick={() => close()} style={{position: 'absolute', top: '20px', right: '20px'}}/>
|
---|
23 | <div>
|
---|
24 | <h1>Stats:</h1>
|
---|
25 | <p>Total money won: <span>${styleState.style.statsScreenInfo.money.earned}</span></p>
|
---|
26 | <p>Total blackjack games won: <span>{styleState.style.statsScreenInfo.blackjack.wins}</span></p>
|
---|
27 | <p>Total roulette games won: <span>{styleState.style.statsScreenInfo.roulette.wins}</span></p>
|
---|
28 | <p>Total poker games won: <span>{styleState.style.statsScreenInfo.poker.wins}</span></p>
|
---|
29 | </div>
|
---|
30 | </div>
|
---|
31 | )
|
---|
32 | }
|
---|
33 |
|
---|
34 | export default Stats |
---|
Note:
See
TracBrowser
for help on using the repository browser.