Create redux for leftSidebar
This commit is contained in:
parent
5f7a2d6885
commit
0de4832993
|
@ -0,0 +1,35 @@
|
|||
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
|
||||
|
||||
interface SidebarButton {
|
||||
id: string;
|
||||
isDotOn: boolean;
|
||||
isSelected: boolean;
|
||||
isDisabled?: boolean;
|
||||
}
|
||||
|
||||
interface LeftSidebarState {
|
||||
buttons: SidebarButton[];
|
||||
}
|
||||
|
||||
const initialState: LeftSidebarState = {
|
||||
buttons: [
|
||||
{ id: 'dashboard', isDotOn: false, isSelected: true },
|
||||
{ id: 'speed', isDotOn: false, isSelected: false },
|
||||
{ id: 'chart', isDotOn: false, isSelected: false, isDisabled: true },
|
||||
{ id: 'heart', isDotOn: false, isSelected: false },
|
||||
{ id: 'codeBlock', isDotOn: false, isSelected: false },
|
||||
{ id: 'communities', isDotOn: false, isSelected: false },
|
||||
{ id: 'activityCenter', isDotOn: true, isSelected: false },
|
||||
{ id: 'settings', isDotOn: false, isSelected: false },
|
||||
],
|
||||
};
|
||||
|
||||
const leftSidebarSlice = createSlice({
|
||||
name: 'leftSidebar',
|
||||
initialState,
|
||||
reducers: {
|
||||
},
|
||||
});
|
||||
|
||||
export const { toggleButtonSelection, toggleDot } = leftSidebarSlice.actions;
|
||||
|
|
@ -4,6 +4,7 @@ import pinnedMessageReducer from './PinnedMessage/slice'
|
|||
import execClientReducer from './ValidatorOnboarding/ValidatorSetup/slice'
|
||||
import themeReducer from './theme/slice'
|
||||
import keyGenerationReducer from './ValidatorOnboarding/KeyGeneration/slice'
|
||||
import leftSidebarReducer from './Sidebars/slice'
|
||||
|
||||
const store = configureStore({
|
||||
reducer: {
|
||||
|
@ -12,6 +13,7 @@ const store = configureStore({
|
|||
execClient: execClientReducer,
|
||||
theme: themeReducer,
|
||||
keyGeneration: keyGenerationReducer,
|
||||
leftSidebar: leftSidebarReducer,
|
||||
},
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue