Create redux for validator onboarding
Create logic in redux for validator setup
This commit is contained in:
parent
d631096678
commit
9e0057bc61
|
@ -4,31 +4,6 @@ import { Text } from '@status-im/components'
|
||||||
import ExecClientCard from './ExecClientCard'
|
import ExecClientCard from './ExecClientCard'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
|
|
||||||
const execClientCardsContent = [
|
|
||||||
{
|
|
||||||
name: 'Nethermind',
|
|
||||||
icon: '/icons/nethermind-circle.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Besu',
|
|
||||||
icon: '/icons/hyperledger-besu-circle.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Geth',
|
|
||||||
icon: '/icons/gethereum-mascot-circle.png',
|
|
||||||
isSelected: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Erigon',
|
|
||||||
icon: '/icons/erigon-circle.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Nimbus',
|
|
||||||
icon: '/icons/NimbusDisabled.svg',
|
|
||||||
isComingSoon: true,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const ValidatorSetup = () => {
|
const ValidatorSetup = () => {
|
||||||
return (
|
return (
|
||||||
<YStack style={{ width: '100%', padding: '16px 32px' }}>
|
<YStack style={{ width: '100%', padding: '16px 32px' }}>
|
||||||
|
@ -58,15 +33,28 @@ const ValidatorSetup = () => {
|
||||||
Select Execution client
|
Select Execution client
|
||||||
</TextTam>
|
</TextTam>
|
||||||
<XStack justifyContent={'space-between'}>
|
<XStack justifyContent={'space-between'}>
|
||||||
{execClientCardsContent.length &&
|
|
||||||
execClientCardsContent.map(e => (
|
|
||||||
<ExecClientCard
|
<ExecClientCard
|
||||||
name={e.name}
|
name={'Nethermind'}
|
||||||
icon={e.icon}
|
icon={'/icons/nethermind-circle.png'}
|
||||||
isSelected={e.isSelected || false}
|
isSelected={false}
|
||||||
isComingSoon={e.isComingSoon}
|
/>
|
||||||
|
<ExecClientCard
|
||||||
|
name={'Besu'}
|
||||||
|
icon={'/icons/hyperledger-besu-circle.png'}
|
||||||
|
isSelected={false}
|
||||||
|
/>
|
||||||
|
<ExecClientCard
|
||||||
|
name={'Geth'}
|
||||||
|
icon={'/icons/gethereum-mascot-circle.png'}
|
||||||
|
isSelected={true}
|
||||||
|
/>
|
||||||
|
<ExecClientCard name={'Erigon'} icon={'/icons/erigon-circle.png'} isSelected={false} />
|
||||||
|
<ExecClientCard
|
||||||
|
name={'Nimbus'}
|
||||||
|
icon={'/icons/NimbusDisabled.svg'}
|
||||||
|
isSelected={false}
|
||||||
|
isComingSoon={true}
|
||||||
/>
|
/>
|
||||||
))}
|
|
||||||
</XStack>
|
</XStack>
|
||||||
<Stack marginTop={'10%'}>
|
<Stack marginTop={'10%'}>
|
||||||
<Text size={15} weight={'semibold'} color="#2A4CF4">
|
<Text size={15} weight={'semibold'} color="#2A4CF4">
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
|
||||||
|
|
||||||
|
interface ExecClientState {
|
||||||
|
selectedClient: string
|
||||||
|
}
|
||||||
|
const initialState: ExecClientState = {
|
||||||
|
selectedClient: '',
|
||||||
|
}
|
||||||
|
const execClientSlice = createSlice({
|
||||||
|
name: 'execClient',
|
||||||
|
initialState,
|
||||||
|
reducers: {
|
||||||
|
selectClient: (state: ExecClientState, action: PayloadAction<string>) => {
|
||||||
|
state.selectedClient = action.payload
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export const { selectClient } = execClientSlice.actions
|
||||||
|
|
||||||
|
export default execClientSlice.reducer
|
|
@ -1,11 +1,13 @@
|
||||||
import { configureStore } from '@reduxjs/toolkit'
|
import { configureStore } from '@reduxjs/toolkit'
|
||||||
import deviceHealthReducer from './deviceHealthCheck/slice'
|
import deviceHealthReducer from './deviceHealthCheck/slice'
|
||||||
import pinnedMessageReducer from './PinnedMessage/slice'
|
import pinnedMessageReducer from './PinnedMessage/slice'
|
||||||
|
import execClientReducer from './ValidatorOnboarding/ValidatorSetup/slice'
|
||||||
|
|
||||||
const store = configureStore({
|
const store = configureStore({
|
||||||
reducer: {
|
reducer: {
|
||||||
deviceHealth: deviceHealthReducer,
|
deviceHealth: deviceHealthReducer,
|
||||||
pinnedMessage: pinnedMessageReducer,
|
pinnedMessage: pinnedMessageReducer,
|
||||||
|
execClient: execClientReducer,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue