[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: ''
|
---|
| 85 | }
|
---|
[87614a5] | 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 | },
|
---|
[55701f0] | 106 | sideBetName: '',
|
---|
[87614a5] | 107 | texts: {
|
---|
| 108 | sideBetsChooseCreditsText: '',
|
---|
| 109 | sideBetsPaysText: '',
|
---|
| 110 | }
|
---|
[9bd09b0] | 111 | },
|
---|
| 112 | // roulette
|
---|
| 113 | roulette: {
|
---|
| 114 | displays: {
|
---|
| 115 | betModal: false,
|
---|
| 116 | },
|
---|
| 117 | inputControls: {
|
---|
| 118 | bet: {
|
---|
| 119 | chosenCredits: 0,
|
---|
| 120 | },
|
---|
| 121 | },
|
---|
| 122 | whichBets: [],
|
---|
| 123 | coinPlaced: {
|
---|
[d0ef259] | 124 | x: -1,
|
---|
| 125 | y: -1,
|
---|
| 126 | }
|
---|
[ace7865] | 127 | },
|
---|
| 128 | // poker
|
---|
| 129 | poker: {
|
---|
| 130 | displays: {
|
---|
| 131 | raiseModal: false,
|
---|
| 132 | },
|
---|
| 133 | inputControls: {
|
---|
| 134 | raise: {
|
---|
| 135 | chosenCredits: 0,
|
---|
[b13f93b] | 136 | },
|
---|
| 137 | tableName: '',
|
---|
[ace7865] | 138 | },
|
---|
| 139 | callAmount: 0,
|
---|
| 140 | texts: {
|
---|
[b13f93b] | 141 | text1: '',
|
---|
| 142 | text2: '',
|
---|
| 143 | text3: ''
|
---|
[9bd09b0] | 144 | }
|
---|
[87614a5] | 145 | }
|
---|
| 146 | }
|
---|
| 147 |
|
---|
| 148 | export 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;
|
---|
[9bd09b0] | 157 | },
|
---|
| 158 | setRoulette: (state, action) => {
|
---|
| 159 | state.roulette = action.payload;
|
---|
[b13f93b] | 160 | },
|
---|
| 161 | setPoker: (state, action) => {
|
---|
| 162 | state.poker = action.payload;
|
---|
[87614a5] | 163 | }
|
---|
| 164 | }
|
---|
| 165 | })
|
---|
| 166 |
|
---|
[b13f93b] | 167 | export const { setStyle, setBlackjack, setRoulette, setPoker } = styleSlice.actions
|
---|
[87614a5] | 168 |
|
---|
| 169 | export default styleSlice.reducer |
---|