Browse Source

Merge pull request #750 from meriadec/onboarding-layout

Fix Onboarding layout on small screens
master
Gaëtan Renaudeau 7 years ago
committed by GitHub
parent
commit
48e74ed4ca
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/components/Onboarding/steps/Init.js
  2. 29
      src/components/Onboarding/steps/NoDevice.js
  3. 41
      src/components/Onboarding/steps/SelectPIN/index.js
  4. 35
      src/components/Onboarding/steps/WriteSeed/index.js

5
src/components/Onboarding/steps/Init.js

@ -7,6 +7,7 @@ import { colors } from 'styles/theme'
import styled from 'styled-components'
import { flowType } from 'reducers/onboarding'
import Box from 'components/base/Box'
import GrowScroll from 'components/base/GrowScroll'
import TrackPage from 'analytics/TrackPage'
import IconPlus from 'icons/Plus'
import IconRecover from 'icons/Recover'
@ -64,7 +65,7 @@ class Init extends PureComponent<StepProps, *> {
]
return (
<Box sticky justifyContent="center">
<GrowScroll full justifyContent="center" py={7}>
<TrackPage category="Onboarding" name="Init" />
<Box align="center">
<LiveLogo
@ -78,7 +79,7 @@ class Init extends PureComponent<StepProps, *> {
{optionCards.map(card => <OptionFlowCard key={card.key} card={card} />)}
</Box>
</Box>
</Box>
</GrowScroll>
)
}
}

29
src/components/Onboarding/steps/NoDevice.js

@ -5,6 +5,7 @@ import { shell } from 'electron'
import { i } from 'helpers/staticPath'
import Box from 'components/base/Box'
import GrowScroll from 'components/base/GrowScroll'
import TrackPage from 'analytics/TrackPage'
import IconCart from 'icons/Cart'
import IconTruck from 'icons/Truck'
@ -47,20 +48,22 @@ class NoDevice extends PureComponent<StepProps, *> {
]
return (
<Box sticky pt={130}>
<TrackPage category="Onboarding" name="No Device" />
<Box grow alignItems="center">
<LiveLogo
style={{ width: 64, height: 64 }}
icon={<img src={i('ledgerlive-logo.svg')} alt="" width={40} height={40} />}
/>
<Box m={5} style={{ maxWidth: 480 }}>
<Title>{t('onboarding:noDevice.title')}</Title>
<Box sticky>
<GrowScroll pb={7} pt={130}>
<TrackPage category="Onboarding" name="No Device" />
<Box grow alignItems="center">
<LiveLogo
style={{ width: 64, height: 64 }}
icon={<img src={i('ledgerlive-logo.svg')} alt="" width={40} height={40} />}
/>
<Box m={5} style={{ maxWidth: 480 }}>
<Title>{t('onboarding:noDevice.title')}</Title>
</Box>
<Box pt={4} flow={4}>
{optionCards.map(card => <OptionFlowCard key={card.key} card={card} />)}
</Box>
</Box>
<Box pt={4} flow={4}>
{optionCards.map(card => <OptionFlowCard key={card.key} card={card} />)}
</Box>
</Box>
</GrowScroll>
<OnboardingFooterWrapper>
<Button padded outlineGrey onClick={() => prevStep()} mr="auto">
{t('app:common.back')}

41
src/components/Onboarding/steps/SelectPIN/index.js

@ -5,6 +5,7 @@ import React from 'react'
import Box from 'components/base/Box'
import TrackPage from 'analytics/TrackPage'
import GrowScroll from 'components/base/GrowScroll'
import { Title, FixedTopContainer } from '../../helperComponents'
import OnboardingFooter from '../../OnboardingFooter'
import SelectPINnano from './SelectPINnano'
@ -19,27 +20,29 @@ export default (props: StepProps) => {
return (
<FixedTopContainer>
<TrackPage
category="Onboarding"
name="Choose PIN"
flowType={onboarding.flowType}
deviceType={onboarding.isLedgerNano ? 'Nano S' : 'Blue'}
/>
{onboarding.flowType === 'restoreDevice' ? (
<Box grow alignItems="center">
<Title>{t('onboarding:selectPIN.restore.title')}</Title>
<Box align="center" mt={7}>
{onboarding.isLedgerNano ? <SelectPINrestoreNano /> : <SelectPINrestoreBlue />}
<GrowScroll pb={7}>
<TrackPage
category="Onboarding"
name="Choose PIN"
flowType={onboarding.flowType}
deviceType={onboarding.isLedgerNano ? 'Nano S' : 'Blue'}
/>
{onboarding.flowType === 'restoreDevice' ? (
<Box grow alignItems="center">
<Title>{t('onboarding:selectPIN.restore.title')}</Title>
<Box align="center" mt={7}>
{onboarding.isLedgerNano ? <SelectPINrestoreNano /> : <SelectPINrestoreBlue />}
</Box>
</Box>
</Box>
) : (
<Box grow alignItems="center">
<Title>{t('onboarding:selectPIN.initialize.title')}</Title>
<Box align="center" mt={7}>
{onboarding.isLedgerNano ? <SelectPINnano /> : <SelectPINblue />}
) : (
<Box grow alignItems="center">
<Title>{t('onboarding:selectPIN.initialize.title')}</Title>
<Box align="center" mt={7}>
{onboarding.isLedgerNano ? <SelectPINnano /> : <SelectPINblue />}
</Box>
</Box>
</Box>
)}
)}
</GrowScroll>
<OnboardingFooter horizontal flow={2} t={t} nextStep={nextStep} prevStep={prevStep} />
</FixedTopContainer>
)

35
src/components/Onboarding/steps/WriteSeed/index.js

@ -5,8 +5,9 @@ import React from 'react'
import Box from 'components/base/Box'
import TrackPage from 'analytics/TrackPage'
import OnboardingFooter from '../../OnboardingFooter'
import GrowScroll from 'components/base/GrowScroll'
import OnboardingFooter from '../../OnboardingFooter'
import WriteSeedNano from './WriteSeedNano'
import WriteSeedBlue from './WriteSeedBlue'
import WriteSeedRestore from './WriteSeedRestore'
@ -18,21 +19,23 @@ export default (props: StepProps) => {
return (
<FixedTopContainer>
<TrackPage
category="Onboarding"
name="Recovery Phase"
flowType={onboarding.flowType}
deviceType={onboarding.isLedgerNano ? 'Nano S' : 'Blue'}
/>
<Box grow alignItems="center">
{onboarding.flowType === 'restoreDevice' ? (
<WriteSeedRestore onboarding={onboarding} />
) : onboarding.isLedgerNano ? (
<WriteSeedNano />
) : (
<WriteSeedBlue />
)}
</Box>
<GrowScroll pb={7}>
<TrackPage
category="Onboarding"
name="Recovery Phase"
flowType={onboarding.flowType}
deviceType={onboarding.isLedgerNano ? 'Nano S' : 'Blue'}
/>
<Box grow alignItems="center">
{onboarding.flowType === 'restoreDevice' ? (
<WriteSeedRestore onboarding={onboarding} />
) : onboarding.isLedgerNano ? (
<WriteSeedNano />
) : (
<WriteSeedBlue />
)}
</Box>
</GrowScroll>
<OnboardingFooter
horizontal
align="center"

Loading…
Cancel
Save