[87614a5] | 1 | import { createSlice } from '@reduxjs/toolkit';
|
---|
| 2 |
|
---|
| 3 | const initialState = {
|
---|
| 4 | style: {
|
---|
| 5 | // login
|
---|
| 6 | displayLoadingScreen: false,
|
---|
| 7 | displayRegisterScreen: false,
|
---|
| 8 | registerScreenInfo: {
|
---|
[64dc53b] | 9 | setFocus: true,
|
---|
[87614a5] | 10 | username: '',
|
---|
| 11 | displayName: '',
|
---|
| 12 | password: '',
|
---|
| 13 | },
|
---|
| 14 | displayLoginScreen: false,
|
---|
| 15 | loginScreenInfo: {
|
---|
[64dc53b] | 16 | setFocus: true,
|
---|
[87614a5] | 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,
|
---|
[433e0c5] | 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: ''
|
---|
[faff334] | 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 | },
|
---|
[87614a5] | 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 | },
|
---|
[55701f0] | 119 | sideBetName: '',
|
---|
[87614a5] | 120 | texts: {
|
---|
| 121 | sideBetsChooseCreditsText: '',
|
---|
| 122 | sideBetsPaysText: '',
|
---|
| 123 | }
|
---|
[9bd09b0] | 124 | },
|
---|
| 125 | // roulette
|
---|
| 126 | roulette: {
|
---|
| 127 | displays: {
|
---|
| 128 | betModal: false,
|
---|
| 129 | },
|
---|
| 130 | inputControls: {
|
---|
| 131 | bet: {
|
---|
| 132 | chosenCredits: 0,
|
---|
| 133 | },
|
---|
| 134 | },
|
---|
| 135 | whichBets: [],
|
---|
| 136 | coinPlaced: {
|
---|
[d0ef259] | 137 | x: -1,
|
---|
| 138 | y: -1,
|
---|
| 139 | }
|
---|
[ace7865] | 140 | },
|
---|
| 141 | // poker
|
---|
| 142 | poker: {
|
---|
| 143 | displays: {
|
---|
| 144 | raiseModal: false,
|
---|
| 145 | },
|
---|
| 146 | inputControls: {
|
---|
| 147 | raise: {
|
---|
| 148 | chosenCredits: 0,
|
---|
[b13f93b] | 149 | },
|
---|
| 150 | tableName: '',
|
---|
[ace7865] | 151 | },
|
---|
| 152 | callAmount: 0,
|
---|
| 153 | texts: {
|
---|
[b13f93b] | 154 | text1: '',
|
---|
| 155 | text2: '',
|
---|
| 156 | text3: ''
|
---|
[9bd09b0] | 157 | }
|
---|
[faff334] | 158 | },
|
---|
[87614a5] | 159 | }
|
---|
| 160 |
|
---|
| 161 | export 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;
|
---|
[9bd09b0] | 170 | },
|
---|
| 171 | setRoulette: (state, action) => {
|
---|
| 172 | state.roulette = action.payload;
|
---|
[b13f93b] | 173 | },
|
---|
| 174 | setPoker: (state, action) => {
|
---|
| 175 | state.poker = action.payload;
|
---|
[87614a5] | 176 | }
|
---|
| 177 | }
|
---|
| 178 | })
|
---|
| 179 |
|
---|
[b13f93b] | 180 | export const { setStyle, setBlackjack, setRoulette, setPoker } = styleSlice.actions
|
---|
[87614a5] | 181 |
|
---|
| 182 | export default styleSlice.reducer |
---|