source: redux/reducers/styleSlice.js

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

Ability for admin to watch live games and for user to see games history

  • Property mode set to 100644
File size: 4.1 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 // games history
87 displayGamesHistoryScreen: false,
88 gamesHistory: {
89 blackjack: {
90 rooms: [],
91 },
92 roulette: {
93 games: [],
94 },
95 poker: {
96 tables: [],
97 },
98 },
99 },
100 // blackjack
101 blackjack: {
102 displays: {
103 sideBetsChooseCreditsModal: false,
104 sideBetsModal: false,
105 initialBet: true,
106 sideBet: false,
107 hitStand: false,
108 },
109 inputControls: {
110 initialBet: {
111 chosenCredits: 0,
112 maxCredits: 0,
113 },
114 sideBet: {
115 chosenCredits: 0,
116 maxCredits: 0,
117 }
118 },
119 sideBetName: '',
120 texts: {
121 sideBetsChooseCreditsText: '',
122 sideBetsPaysText: '',
123 }
124 },
125 // roulette
126 roulette: {
127 displays: {
128 betModal: false,
129 },
130 inputControls: {
131 bet: {
132 chosenCredits: 0,
133 },
134 },
135 whichBets: [],
136 coinPlaced: {
137 x: -1,
138 y: -1,
139 }
140 },
141 // poker
142 poker: {
143 displays: {
144 raiseModal: false,
145 },
146 inputControls: {
147 raise: {
148 chosenCredits: 0,
149 },
150 tableName: '',
151 },
152 callAmount: 0,
153 texts: {
154 text1: '',
155 text2: '',
156 text3: ''
157 }
158 },
159}
160
161export const styleSlice = createSlice({
162 name: 'style',
163 initialState,
164 reducers: {
165 setStyle: (state, action) => {
166 state.style = action.payload;
167 },
168 setBlackjack: (state, action) => {
169 state.blackjack = action.payload;
170 },
171 setRoulette: (state, action) => {
172 state.roulette = action.payload;
173 },
174 setPoker: (state, action) => {
175 state.poker = action.payload;
176 }
177 }
178})
179
180export const { setStyle, setBlackjack, setRoulette, setPoker } = styleSlice.actions
181
182export default styleSlice.reducer
Note: See TracBrowser for help on using the repository browser.