diff --git a/mascara/src/app/first-time/create-password-screen.js b/mascara/src/app/first-time/create-password-screen.js index a1816b88c..2f4b81e7c 100644 --- a/mascara/src/app/first-time/create-password-screen.js +++ b/mascara/src/app/first-time/create-password-screen.js @@ -8,6 +8,7 @@ class CreatePasswordScreen extends Component { static propTypes = { isLoading: PropTypes.bool.isRequired, createAccount: PropTypes.func.isRequired, + goToImportWithSeedPhrase: PropTypes.func.isRequired, goToImportAccount: PropTypes.func.isRequired, next: PropTypes.func.isRequired } @@ -44,7 +45,7 @@ class CreatePasswordScreen extends Component { } render() { - const { isLoading, goToImportAccount } = this.props + const { isLoading, goToImportAccount, goToImportWithSeedPhrase } = this.props return isLoading ? @@ -72,6 +73,16 @@ class CreatePasswordScreen extends Component { > Create + { + e.preventDefault() + goToImportWithSeedPhrase() + }} + > + Import with seed phrase + { /* } { + const { password, seedPhrase } = this.state + const { createNewVaultAndRestore, next } = this.props + + createNewVaultAndRestore(password, seedPhrase) + .then(next) + } + + isValid () { + const { seedPhrase, password, confirmPassword } = this.state + + if (seedPhrase.split(' ').length !== 12) { + return false + } + + if (password.length < 8) { + return false + } + + if (password !== confirmPassword) { + return false + } + + return true + } + + render () { + return this.props.isLoading + ? + : ( +
+ { + e.preventDefault() + this.props.back() + }} + href="#" + > + {`< Back`} + +
+ Import an Account with Seed Phrase +
+
+ Enter your secret twelve word phrase here to restore your vault. +
+