mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-12 11:28:00 +00:00
feat(navigation): create redux for navigation flow
This commit is contained in:
parent
b24a38301f
commit
cbb68d36cf
@ -40,7 +40,7 @@ const PairDevice = () => {
|
|||||||
setIsConnectingViaIp(state => !state)
|
setIsConnectingViaIp(state => !state)
|
||||||
}
|
}
|
||||||
|
|
||||||
const continueHandler = (e: Event) => {
|
const continueHandler = () => {
|
||||||
navigate('/device-health-check')
|
navigate('/device-health-check')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
23
src/redux/NavigationFlow/slice.ts
Normal file
23
src/redux/NavigationFlow/slice.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { createSlice } from '@reduxjs/toolkit'
|
||||||
|
|
||||||
|
type NavigationFlowStateType = {
|
||||||
|
navigationFlow:string
|
||||||
|
}
|
||||||
|
|
||||||
|
const initialState: NavigationFlowStateType = {
|
||||||
|
navigationFlow: '',
|
||||||
|
}
|
||||||
|
|
||||||
|
const NavigationFlow = createSlice({
|
||||||
|
name: 'navigationFlow',
|
||||||
|
initialState,
|
||||||
|
reducers: {
|
||||||
|
setNavigationFlow: (state, action) => {
|
||||||
|
state.navigationFlow = action.payload
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export const { setNavigationFlow } = NavigationFlow.actions
|
||||||
|
|
||||||
|
export default NavigationFlow.reducer
|
@ -15,6 +15,7 @@ import pairDeviceReducer from './PairDevice/slice'
|
|||||||
import manageValidatorTabReducer from './ManageValidatorTab/slice'
|
import manageValidatorTabReducer from './ManageValidatorTab/slice'
|
||||||
import logsTerminalReducer from './LogsTerminal/slice'
|
import logsTerminalReducer from './LogsTerminal/slice'
|
||||||
import currencyReducer from './Currency/slice'
|
import currencyReducer from './Currency/slice'
|
||||||
|
import navigationFlowReducer from './NavigationFlow/slice'
|
||||||
|
|
||||||
const store = configureStore({
|
const store = configureStore({
|
||||||
reducer: {
|
reducer: {
|
||||||
@ -33,6 +34,7 @@ const store = configureStore({
|
|||||||
manageValidatorTab: manageValidatorTabReducer,
|
manageValidatorTab: manageValidatorTabReducer,
|
||||||
logsTerminal: logsTerminalReducer,
|
logsTerminal: logsTerminalReducer,
|
||||||
currency: currencyReducer,
|
currency: currencyReducer,
|
||||||
|
navigationFLow: navigationFlowReducer,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user