fix: clean code and errors

This commit is contained in:
RadoslavDimchev 2023-09-05 09:14:32 +03:00
parent 76931c81df
commit 6229830e70
9 changed files with 20 additions and 40 deletions

View File

@ -10,7 +10,7 @@ const meta = {
layout: 'centered',
},
tags: ['autodocs'],
decorators: [withRouter()],
decorators: [withRouter],
} satisfies Meta<typeof LinkWithArrow>
export default meta

View File

@ -10,7 +10,7 @@ const meta = {
layout: 'centered',
},
tags: ['autodocs'],
decorators: [withRouter()],
decorators: [withRouter],
} satisfies Meta<typeof Activation>
export default meta

View File

@ -10,7 +10,7 @@ const meta = {
layout: 'centered',
},
tags: ['autodocs'],
decorators: [withRouter()],
decorators: [withRouter],
} satisfies Meta<typeof ActivationCard>
export default meta

View File

@ -10,7 +10,7 @@ const meta = {
layout: 'centered',
},
tags: ['autodocs'],
decorators: [withRouter()],
decorators: [withRouter],
} satisfies Meta<typeof ActivationSyncCard>
export default meta

View File

@ -2,16 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'
import { withRouter } from 'storybook-addon-react-router-v6'
import ValidatorOnboarding from './ValidatorOnboarding'
import { Provider as ReduxProvider } from 'react-redux'
import store from '../../redux/store'
const withRedux = (StoryComponent: any) => {
return (
<ReduxProvider store={store} >
<StoryComponent />
</ReduxProvider>
);
}
const meta = {
title: 'Pages/ValidatorOnboarding',
component: ValidatorOnboarding,
@ -19,7 +10,7 @@ const meta = {
layout: 'centered',
},
tags: ['autodocs'],
decorators: [withRouter(), withRedux],
decorators: [withRouter],
} satisfies Meta<typeof ValidatorOnboarding>
export default meta

View File

@ -1,19 +1,20 @@
import { Stack, YStack } from 'tamagui'
import { useNavigate } from 'react-router-dom'
import { useState } from 'react'
import { Button } from '@status-im/components'
import FormStepper from './FormStepper/FormStepper'
import Titles from '../../components/General/Titles'
import { useState } from 'react'
import Overview from './Overview/Overview'
import KeyGeneration from './KeyGeneration/KeyGeneration'
import Activation from './Activation/Activation'
import './layoutGradient.css'
import ValidatorBoxWrapper from './ValidatorBoxWrapper/ValidatorBoxWrapper'
import { Button } from '@status-im/components'
import { useNavigate } from 'react-router-dom'
import ClientSetup from './ClientSetup/ClientSetup'
import ConsensusSelection from './ValidatorSetup/ConsensusSelection'
import Advisories from './Advisories/Advisories'
import ValidatorSetup from './ValidatorSetup/ValidatorSetup'
import ValidatorSetupInstall from './ValidatorSetup/ValidatorInstall'
import './layoutGradient.css'
const ValidatorOnboarding = () => {
const [activeStep, setActiveStep] = useState(0)
@ -66,7 +67,7 @@ const ValidatorOnboarding = () => {
{activeStep === 3 && subStepValidatorSetup === 0 && <ValidatorSetup />}
{activeStep === 3 && subStepValidatorSetup === 1 && <ValidatorSetupInstall />}
{activeStep === 3 && subStepValidatorSetup === 2 && <ConsensusSelection />}
{activeStep === 4 && <KeyGeneration isConfirmPhraseStage={isConfirmPhraseStage} />}
{activeStep === 5 && <Activation />}
</ValidatorBoxWrapper>

View File

@ -8,6 +8,14 @@ import ConsensusClientCard from './ConsensusClientCard'
import LinkWithArrow from '../../../components/General/LinkWithArrow'
import { RootState } from '../../../redux/store'
const clientIcons = {
Nethermind: '/icons/nethermind-circle.png',
Besu: '/icons/hyperledger-besu-circle.png',
Geth: '/icons/gethereum-mascot-circle.png',
Erigon: '/icons/erigon-circle.png',
Nimbus: '/icons/NimbusDisabled.svg',
}
const ConsensusSelection = () => {
const selectedClient = useSelector((state: RootState) => state.execClient.selectedClient) as
| 'Nethermind'
@ -16,14 +24,6 @@ const ConsensusSelection = () => {
| 'Erigon'
| 'Nimbus'
const clientIcons = {
Nethermind: '/icons/nethermind-circle.png',
Besu: '/icons/hyperledger-besu-circle.png',
Geth: '/icons/gethereum-mascot-circle.png',
Erigon: '/icons/erigon-circle.png',
Nimbus: '/icons/NimbusDisabled.svg',
}
const clients = [
{
name: selectedClient,

View File

@ -15,7 +15,6 @@ const PairedDeviceCard = () => {
>
<XStack space={'$3'} alignItems={'center'}>
<Avatar backgroundColor="pink" size={32} type="user" name="RP" />
<YStack>
<Text size={13} color="#647084">
Paired Device

View File

@ -1,17 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react'
import { Provider as ReduxProvider } from 'react-redux'
import { withRouter } from 'storybook-addon-react-router-v6'
import React from 'react'
import ValidatorSetup from './ValidatorSetup'
import store from '../../../redux/store'
const withRedux = (StoryComponent: any) => {
return (
<ReduxProvider store={store} >
<StoryComponent />
</ReduxProvider>
);
}
const meta = {
title: 'ValidatorOnboarding/ValidatorSetup',
@ -20,7 +9,7 @@ const meta = {
layout: 'centered',
},
tags: ['autodocs'],
decorators: [withRouter(), withRedux],
decorators: [withRouter],
} satisfies Meta<typeof ValidatorSetup>
export default meta