Browse Source
Merge pull request #507 from NastiaS/polish
remove unnecessary compexity from footer definition in onboarding
master
Gaëtan Renaudeau
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
13 additions and
15 deletions
-
src/components/Onboarding/OnboardingFooter.js
-
src/components/Onboarding/steps/SelectDevice.js
|
|
@ -22,8 +22,6 @@ type Props = { |
|
|
|
t: T, |
|
|
|
nextStep: () => void, |
|
|
|
prevStep: () => void, |
|
|
|
jumpStep?: string => void, |
|
|
|
jumpTo?: string, |
|
|
|
isContinueDisabled?: boolean, |
|
|
|
} |
|
|
|
|
|
|
@ -32,21 +30,14 @@ const OnboardingFooter = ({ |
|
|
|
nextStep, |
|
|
|
prevStep, |
|
|
|
isContinueDisabled, |
|
|
|
jumpStep, |
|
|
|
jumpTo, |
|
|
|
|
|
|
|
...props |
|
|
|
}: Props) => ( |
|
|
|
<Wrapper {...props}> |
|
|
|
<Button padded outlineGrey onClick={() => prevStep()}> |
|
|
|
{t('common:back')} |
|
|
|
</Button> |
|
|
|
<Button |
|
|
|
padded |
|
|
|
disabled={isContinueDisabled} |
|
|
|
primary |
|
|
|
onClick={() => (jumpTo && jumpStep ? jumpStep(jumpTo) : nextStep())} |
|
|
|
ml="auto" |
|
|
|
> |
|
|
|
<Button padded disabled={isContinueDisabled} primary onClick={() => nextStep()} ml="auto"> |
|
|
|
{t('common:continue')} |
|
|
|
</Button> |
|
|
|
</Wrapper> |
|
|
|
|
|
@ -22,8 +22,17 @@ class SelectDevice extends PureComponent<StepProps, {}> { |
|
|
|
handleIsLedgerNano = (isLedgerNano: boolean) => { |
|
|
|
this.props.isLedgerNano(isLedgerNano) |
|
|
|
} |
|
|
|
|
|
|
|
handleContinue = () => { |
|
|
|
const { nextStep, jumpStep, onboarding } = this.props |
|
|
|
if (onboarding.flowType === 'initializedDevice') { |
|
|
|
jumpStep('genuineCheck') |
|
|
|
} else { |
|
|
|
nextStep() |
|
|
|
} |
|
|
|
} |
|
|
|
render() { |
|
|
|
const { t, onboarding, nextStep, prevStep, jumpStep } = this.props |
|
|
|
const { t, onboarding, prevStep } = this.props |
|
|
|
return ( |
|
|
|
<Box sticky> |
|
|
|
<Box grow alignItems="center" justifyContent="center"> |
|
|
@ -59,11 +68,9 @@ class SelectDevice extends PureComponent<StepProps, {}> { |
|
|
|
horizontal |
|
|
|
flow={2} |
|
|
|
t={t} |
|
|
|
nextStep={nextStep} |
|
|
|
nextStep={this.handleContinue} |
|
|
|
prevStep={prevStep} |
|
|
|
jumpStep={jumpStep} |
|
|
|
isContinueDisabled={onboarding.isLedgerNano === null} |
|
|
|
jumpTo={onboarding.flowType === 'initializedDevice' ? 'genuineCheck' : undefined} |
|
|
|
/> |
|
|
|
</Box> |
|
|
|
) |
|
|
|