mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-08 01:23:33 +00:00
feat(currency-slice): create slice for currency
This commit is contained in:
parent
9d76b3bf59
commit
e5ae76879e
19
src/redux/Currency/slice.ts
Normal file
19
src/redux/Currency/slice.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { createSlice } from '@reduxjs/toolkit'
|
||||||
|
|
||||||
|
import { CURRENCIES } from '../../constants'
|
||||||
|
|
||||||
|
export type CurrencyType = keyof typeof CURRENCIES
|
||||||
|
|
||||||
|
const pairDeviceSlice = createSlice({
|
||||||
|
name: 'pairDevice',
|
||||||
|
initialState: Object.keys(CURRENCIES)[0],
|
||||||
|
reducers: {
|
||||||
|
setCurrency: (_, action) => {
|
||||||
|
return action.payload
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export const {} = pairDeviceSlice.actions
|
||||||
|
|
||||||
|
export default pairDeviceSlice.reducer
|
@ -14,6 +14,7 @@ import validatorSetupReducer from './ValidatorOnboarding/ValidatorSetup/slice'
|
|||||||
import pairDeviceReducer from './PairDevice/slice'
|
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'
|
||||||
|
|
||||||
const store = configureStore({
|
const store = configureStore({
|
||||||
reducer: {
|
reducer: {
|
||||||
@ -31,6 +32,7 @@ const store = configureStore({
|
|||||||
pairDevice: pairDeviceReducer,
|
pairDevice: pairDeviceReducer,
|
||||||
manageValidatorTab: manageValidatorTabReducer,
|
manageValidatorTab: manageValidatorTabReducer,
|
||||||
logsTerminal: logsTerminalReducer,
|
logsTerminal: logsTerminalReducer,
|
||||||
|
currency: currencyReducer,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user