You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.8 KiB
71 lines
1.8 KiB
6 years ago
|
import React, { PureComponent } from 'react'
|
||
|
import PropTypes from 'prop-types'
|
||
|
import { Switch, Route } from 'react-router-dom'
|
||
|
import RevealSeedPhrase from './reveal-seed-phrase'
|
||
|
import ConfirmSeedPhrase from './confirm-seed-phrase'
|
||
|
import {
|
||
|
INITIALIZE_SEED_PHRASE_ROUTE,
|
||
|
INITIALIZE_CONFIRM_SEED_PHRASE_ROUTE,
|
||
|
DEFAULT_ROUTE,
|
||
6 years ago
|
} from '../../../helpers/constants/routes'
|
||
6 years ago
|
|
||
|
export default class SeedPhrase extends PureComponent {
|
||
|
static propTypes = {
|
||
|
address: PropTypes.string,
|
||
|
history: PropTypes.object,
|
||
|
seedPhrase: PropTypes.string,
|
||
|
}
|
||
|
|
||
|
componentDidMount () {
|
||
|
const { seedPhrase, history } = this.props
|
||
|
|
||
|
if (!seedPhrase) {
|
||
|
history.push(DEFAULT_ROUTE)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
render () {
|
||
6 years ago
|
const { seedPhrase } = this.props
|
||
6 years ago
|
|
||
|
return (
|
||
|
<div className="first-time-flow__wrapper">
|
||
6 years ago
|
<div className="app-header__logo-container">
|
||
|
<img
|
||
|
className="app-header__metafox-logo app-header__metafox-logo--horizontal"
|
||
|
src="/images/logo/metamask-logo-horizontal.svg"
|
||
|
height={30}
|
||
|
/>
|
||
|
<img
|
||
|
className="app-header__metafox-logo app-header__metafox-logo--icon"
|
||
|
src="/images/logo/metamask-fox.svg"
|
||
|
height={42}
|
||
|
width={42}
|
||
|
/>
|
||
|
</div>
|
||
6 years ago
|
<Switch>
|
||
|
<Route
|
||
|
exact
|
||
|
path={INITIALIZE_CONFIRM_SEED_PHRASE_ROUTE}
|
||
|
render={props => (
|
||
|
<ConfirmSeedPhrase
|
||
|
{ ...props }
|
||
|
seedPhrase={seedPhrase}
|
||
|
/>
|
||
|
)}
|
||
|
/>
|
||
|
<Route
|
||
|
exact
|
||
|
path={INITIALIZE_SEED_PHRASE_ROUTE}
|
||
|
render={props => (
|
||
|
<RevealSeedPhrase
|
||
|
{ ...props }
|
||
|
seedPhrase={seedPhrase}
|
||
|
/>
|
||
|
)}
|
||
|
/>
|
||
|
</Switch>
|
||
|
</div>
|
||
|
)
|
||
|
}
|
||
|
}
|