main
Last change
on this file since e903234 was e903234, checked in by anastasovv <simon@…>, 2 years ago |
Added an admin panel, and the admin can now answer complaints
|
-
Property mode
set to
100644
|
File size:
678 bytes
|
Rev | Line | |
---|
[e903234] | 1 | import { createSlice } from '@reduxjs/toolkit';
|
---|
| 2 |
|
---|
| 3 | const initialState = {
|
---|
| 4 | admin: {
|
---|
| 5 | session_id: '',
|
---|
| 6 | inputControls: {
|
---|
| 7 | username: '',
|
---|
| 8 | password: '',
|
---|
| 9 | },
|
---|
| 10 | displays: {
|
---|
| 11 | setFocus: true,
|
---|
| 12 | complaintsScreen: false,
|
---|
| 13 | liveGamesScreen: false,
|
---|
| 14 | loadingScreen: false,
|
---|
| 15 | },
|
---|
| 16 | inlineAlertText: '',
|
---|
| 17 | },
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | export const adminSlice = createSlice({
|
---|
| 21 | name: 'admin',
|
---|
| 22 | initialState,
|
---|
| 23 | reducers: {
|
---|
| 24 | setAdmin: (state, action) => {
|
---|
| 25 | state.admin = action.payload;
|
---|
| 26 | },
|
---|
| 27 | }
|
---|
| 28 | })
|
---|
| 29 |
|
---|
| 30 | export const { setAdmin } = adminSlice.actions
|
---|
| 31 |
|
---|
| 32 | export default adminSlice.reducer |
---|
Note:
See
TracBrowser
for help on using the repository browser.