feat: add redux and wallet connected state

This commit is contained in:
RadoslavDimchev 2023-09-22 09:21:51 +03:00
parent 52bcbc0dce
commit eff6fc4a75
2 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,23 @@
import { createSlice } from '@reduxjs/toolkit'
type DepositState = {
isWalletConnected: boolean
}
const initialState: DepositState = {
isWalletConnected: false,
}
const depositSlice = createSlice({
name: 'deposit',
initialState,
reducers: {
setIsWalletConnected: (state, action) => {
state.isWalletConnected = action.payload
},
},
})
export const { setIsWalletConnected } = depositSlice.actions
export default depositSlice.reducer

View File

@ -1,9 +1,11 @@
import { configureStore } from '@reduxjs/toolkit'
import themeReducer from './theme/slice'
import deviceHealthReducer from './deviceHealthCheck/slice'
import pinnedMessageReducer from './PinnedMessage/slice'
import execClientReducer from './ValidatorOnboarding/ValidatorSetup/slice'
import themeReducer from './theme/slice'
import keyGenerationReducer from './ValidatorOnboarding/KeyGeneration/slice'
import depositReducer from './ValidatorOnboarding/Deposit/slice'
const store = configureStore({
reducer: {
@ -12,6 +14,7 @@ const store = configureStore({
execClient: execClientReducer,
theme: themeReducer,
keyGeneration: keyGenerationReducer,
deposit: depositReducer,
},
})