|
|
|
@ -1,17 +1,6 @@ |
|
|
|
|
import React, { Component } from 'react'; |
|
|
|
|
import PropTypes from 'prop-types'; |
|
|
|
|
import { |
|
|
|
|
ActivityIndicator, |
|
|
|
|
ScrollView, |
|
|
|
|
Switch, |
|
|
|
|
Alert, |
|
|
|
|
Text, |
|
|
|
|
View, |
|
|
|
|
TextInput, |
|
|
|
|
StyleSheet, |
|
|
|
|
Platform, |
|
|
|
|
Image |
|
|
|
|
} from 'react-native'; |
|
|
|
|
import { ActivityIndicator, ScrollView, Alert, Text, View, TextInput, StyleSheet, Platform, Image } from 'react-native'; |
|
|
|
|
import Button from 'react-native-button'; |
|
|
|
|
import * as Keychain from 'react-native-keychain'; // eslint-disable-line import/no-namespace
|
|
|
|
|
|
|
|
|
@ -204,58 +193,66 @@ export default class ImportFromSeed extends Component { |
|
|
|
|
return ( |
|
|
|
|
<Screen> |
|
|
|
|
<ScrollView style={styles.wrapper}> |
|
|
|
|
<View style={styles.logoWrapper}> |
|
|
|
|
<Image source={require('../../images/fox.png')} style={styles.image} resizeMethod={'auto'} /> |
|
|
|
|
</View> |
|
|
|
|
<Text style={styles.title}>Import from seed</Text> |
|
|
|
|
<TextInput |
|
|
|
|
value={this.state.seedWords} |
|
|
|
|
numberOfLines={3} |
|
|
|
|
multiline |
|
|
|
|
style={styles.seedPhrase} |
|
|
|
|
placeholder={'Enter your seed phrase here'} |
|
|
|
|
onChangeText={this.onSeedWordsChange} |
|
|
|
|
/> |
|
|
|
|
<View style={styles.field}> |
|
|
|
|
<Text style={styles.label}>New Password (min 8 chars)</Text> |
|
|
|
|
<TextInput |
|
|
|
|
style={styles.input} |
|
|
|
|
value={this.state.password} |
|
|
|
|
onChangeText={this.onPasswordChange} |
|
|
|
|
secureTextEntry |
|
|
|
|
placeholder={''} |
|
|
|
|
underlineColorAndroid={colors.borderColor} |
|
|
|
|
/> |
|
|
|
|
</View> |
|
|
|
|
<View style={styles.field}> |
|
|
|
|
<Text style={styles.label}>Confirm Password</Text> |
|
|
|
|
<View testID={'import-from-seed-screen'}> |
|
|
|
|
<View style={styles.logoWrapper}> |
|
|
|
|
<Image |
|
|
|
|
source={require('../../images/fox.png')} |
|
|
|
|
style={styles.image} |
|
|
|
|
resizeMethod={'auto'} |
|
|
|
|
/> |
|
|
|
|
</View> |
|
|
|
|
<Text style={styles.title}>Import from seed</Text> |
|
|
|
|
<TextInput |
|
|
|
|
style={styles.input} |
|
|
|
|
value={this.state.confirmPassword} |
|
|
|
|
onChangeText={this.onPasswordConfirmChange} |
|
|
|
|
secureTextEntry |
|
|
|
|
placeholder={''} |
|
|
|
|
underlineColorAndroid={colors.borderColor} |
|
|
|
|
value={this.state.seedWords} |
|
|
|
|
numberOfLines={3} |
|
|
|
|
multiline |
|
|
|
|
style={styles.seedPhrase} |
|
|
|
|
placeholder={'Enter your seed phrase here'} |
|
|
|
|
onChangeText={this.onSeedWordsChange} |
|
|
|
|
testID={'input-seed-phrase'} |
|
|
|
|
/> |
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
{this.state.biometryType && ( |
|
|
|
|
<View style={styles.field}> |
|
|
|
|
<Text style={styles.label}>Enable {this.state.biometryType}</Text> |
|
|
|
|
<Switch onValueChange={this.onBiometryChoiceChange} value={this.state.biometryChoice} /> |
|
|
|
|
<Text style={styles.label}>New Password (min 8 chars)</Text> |
|
|
|
|
<TextInput |
|
|
|
|
style={styles.input} |
|
|
|
|
value={this.state.password} |
|
|
|
|
onChangeText={this.onPasswordChange} |
|
|
|
|
secureTextEntry |
|
|
|
|
placeholder={''} |
|
|
|
|
underlineColorAndroid={colors.borderColor} |
|
|
|
|
testID={'input-password'} |
|
|
|
|
/> |
|
|
|
|
</View> |
|
|
|
|
<View style={styles.field}> |
|
|
|
|
<Text style={styles.label}>Confirm Password</Text> |
|
|
|
|
<TextInput |
|
|
|
|
style={styles.input} |
|
|
|
|
value={this.state.confirmPassword} |
|
|
|
|
onChangeText={this.onPasswordConfirmChange} |
|
|
|
|
secureTextEntry |
|
|
|
|
placeholder={''} |
|
|
|
|
underlineColorAndroid={colors.borderColor} |
|
|
|
|
testID={'input-password-confirm'} |
|
|
|
|
/> |
|
|
|
|
</View> |
|
|
|
|
)} |
|
|
|
|
{this.props.error && <Text style={styles.errorMsg}>{this.props.error}</Text>} |
|
|
|
|
<View style={styles.ctaWrapper}> |
|
|
|
|
<Button style={styles.ctaText} containerStyle={styles.cta} onPress={this.onPressImport}> |
|
|
|
|
{this.props.loading ? <ActivityIndicator size="small" color="white" /> : 'IMPORT'} |
|
|
|
|
</Button> |
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
<View style={styles.footer}> |
|
|
|
|
<Button style={styles.seed} onPress={this.onCancel}> |
|
|
|
|
Cancel |
|
|
|
|
</Button> |
|
|
|
|
{this.props.error && <Text style={styles.errorMsg}>{this.props.error}</Text>} |
|
|
|
|
<View style={styles.ctaWrapper}> |
|
|
|
|
<Button |
|
|
|
|
style={styles.ctaText} |
|
|
|
|
containerStyle={styles.cta} |
|
|
|
|
onPress={this.onPressImport} |
|
|
|
|
testID={'submit'} |
|
|
|
|
> |
|
|
|
|
{this.props.loading ? <ActivityIndicator size="small" color="white" /> : 'IMPORT'} |
|
|
|
|
</Button> |
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
<View style={styles.footer}> |
|
|
|
|
<Button style={styles.seed} onPress={this.onCancel}> |
|
|
|
|
Cancel |
|
|
|
|
</Button> |
|
|
|
|
</View> |
|
|
|
|
</View> |
|
|
|
|
</ScrollView> |
|
|
|
|
</Screen> |
|
|
|
|