source: redux/reducers/styleSlice.js@ 95ce58b

main
Last change on this file since 95ce58b was b13f93b, checked in by anastasovv <simon@…>, 2 years ago

Made poker tables system and round 1

  • Property mode set to 100644
File size: 3.2 KB
Line 
1import { createSlice } from '@reduxjs/toolkit';
2
3const initialState = {
4 style: {
5 // login
6 displayLoadingScreen: false,
7 displayRegisterScreen: false,
8 registerScreenInfo: {
9 setFocus: true,
10 username: '',
11 displayName: '',
12 password: '',
13 },
14 displayLoginScreen: false,
15 loginScreenInfo: {
16 setFocus: true,
17 username: '',
18 password: '',
19 },
20 // custom
21 inlineAlertText: '',
22 alert: {
23 show: false,
24 title: '',
25 subtitle: '',
26 button: {
27 text: '',
28 action: '',
29 }
30 },
31 notification: {
32 show: false,
33 text: '',
34 status: '',
35 },
36 // stats
37 displayStatsScreen: false,
38 statsScreenInfo: {
39 money: {
40 bet: 0,
41 earned: 0,
42 },
43 blackjack: {
44 games: 0,
45 wins: 0,
46 },
47 roulette: {
48 games: 0,
49 wins: 0,
50 },
51 poker: {
52 games: 0,
53 wins: 0,
54 },
55 },
56 // manage credits
57 displayManageCreditsScreen: false,
58 },
59 // blackjack
60 blackjack: {
61 displays: {
62 sideBetsChooseCreditsModal: false,
63 sideBetsModal: false,
64 initialBet: true,
65 sideBet: false,
66 hitStand: false,
67 },
68 inputControls: {
69 initialBet: {
70 chosenCredits: 0,
71 maxCredits: 0,
72 },
73 sideBet: {
74 chosenCredits: 0,
75 maxCredits: 0,
76 }
77 },
78 texts: {
79 sideBetsChooseCreditsText: '',
80 sideBetsPaysText: '',
81 }
82 },
83 // roulette
84 roulette: {
85 COUNTDOWN_FROM: 30,
86 displays: {
87 betModal: false,
88 },
89 inputControls: {
90 bet: {
91 chosenCredits: 0,
92 },
93 },
94 whichBets: [],
95 coinPlaced: {
96 x: 0,
97 y: 0,
98 },
99 showCoin: false,
100 },
101 // poker
102 poker: {
103 displays: {
104 raiseModal: false,
105 },
106 inputControls: {
107 raise: {
108 chosenCredits: 0,
109 },
110 tableName: '',
111 },
112 callAmount: 0,
113 texts: {
114 text1: '',
115 text2: '',
116 text3: ''
117 }
118 }
119}
120
121export const styleSlice = createSlice({
122 name: 'style',
123 initialState,
124 reducers: {
125 setStyle: (state, action) => {
126 state.style = action.payload;
127 },
128 setBlackjack: (state, action) => {
129 state.blackjack = action.payload;
130 },
131 setRoulette: (state, action) => {
132 state.roulette = action.payload;
133 },
134 setPoker: (state, action) => {
135 state.poker = action.payload;
136 }
137 }
138})
139
140export const { setStyle, setBlackjack, setRoulette, setPoker } = styleSlice.actions
141
142export default styleSlice.reducer
Note: See TracBrowser for help on using the repository browser.