source: redux/reducers/styleSlice.js@ 55701f0

main
Last change on this file since 55701f0 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: 3.8 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 displayDepositModal: false,
59 depositModalInputs: {
60 name: '',
61 card: '',
62 expire: '',
63 ccv: '',
64 amount: '',
65 },
66 displayWithdrawModal: false,
67 withdrawModalInputs: {
68 citibank: '',
69 iban: '',
70 bic: '',
71 beneficiary: '',
72 address: '',
73 amount: '',
74 },
75 // complain
76 displayComplainScreen: false,
77 complainScreenInfo: {
78 setFocus: true,
79 description: '',
80 },
81 // lost connection
82 lostConnectionInfo: {
83 show: false,
84 message: ''
85 }
86 },
87 // blackjack
88 blackjack: {
89 displays: {
90 sideBetsChooseCreditsModal: false,
91 sideBetsModal: false,
92 initialBet: true,
93 sideBet: false,
94 hitStand: false,
95 },
96 inputControls: {
97 initialBet: {
98 chosenCredits: 0,
99 maxCredits: 0,
100 },
101 sideBet: {
102 chosenCredits: 0,
103 maxCredits: 0,
104 }
105 },
106 sideBetName: '',
107 texts: {
108 sideBetsChooseCreditsText: '',
109 sideBetsPaysText: '',
110 }
111 },
112 // roulette
113 roulette: {
114 displays: {
115 betModal: false,
116 },
117 inputControls: {
118 bet: {
119 chosenCredits: 0,
120 },
121 },
122 whichBets: [],
123 coinPlaced: {
124 x: -1,
125 y: -1,
126 }
127 },
128 // poker
129 poker: {
130 displays: {
131 raiseModal: false,
132 },
133 inputControls: {
134 raise: {
135 chosenCredits: 0,
136 },
137 tableName: '',
138 },
139 callAmount: 0,
140 texts: {
141 text1: '',
142 text2: '',
143 text3: ''
144 }
145 }
146}
147
148export const styleSlice = createSlice({
149 name: 'style',
150 initialState,
151 reducers: {
152 setStyle: (state, action) => {
153 state.style = action.payload;
154 },
155 setBlackjack: (state, action) => {
156 state.blackjack = action.payload;
157 },
158 setRoulette: (state, action) => {
159 state.roulette = action.payload;
160 },
161 setPoker: (state, action) => {
162 state.poker = action.payload;
163 }
164 }
165})
166
167export const { setStyle, setBlackjack, setRoulette, setPoker } = styleSlice.actions
168
169export default styleSlice.reducer
Note: See TracBrowser for help on using the repository browser.