Commit 9c6b1d8a authored by YJ's avatar YJ
Browse files

fix: wrap it up for android

parent 96e8af5f
......@@ -153,7 +153,7 @@ const Screens = createStackNavigator(
},
Welcome: {
screen: createStackNavigator(
{
{
AccountList: {
screen: AccountList,
navigationOptions: {
......
......@@ -54,7 +54,9 @@ class AccountPinView extends React.PureComponent {
const { accounts, navigation } = this.props;
const accountCreation = navigation.getParam('isNew');
const { pin } = this.state;
const account = accountCreation ? accounts.getNew() : accounts.getSelected();
const account = accountCreation
? accounts.getNew()
: accounts.getSelected();
if (
this.state.pin.length >= 6 &&
this.state.pin === this.state.confirmation
......@@ -63,15 +65,15 @@ class AccountPinView extends React.PureComponent {
await accounts.submitNew(pin);
const resetAction = StackActions.reset({
index: 0,
actions: [
NavigationActions.navigate({ routeName: 'AccountList' }),
]
key: undefined, // FIXME workaround for now, use SwitchNavigator later: https://github.com/react-navigation/react-navigation/issues/1127#issuecomment-295841343
actions: [NavigationActions.navigate({ routeName: 'AccountList' })]
});
this.props.navigation.dispatch(resetAction);
} else {
await accounts.save(account, pin);
const resetAction = StackActions.reset({
index: 1,
key: undefined, // FIXME workaround for now, use SwitchNavigator later: https://github.com/react-navigation/react-navigation/issues/1127#issuecomment-295841343
actions: [
NavigationActions.navigate({ routeName: 'AccountList' }),
NavigationActions.navigate({ routeName: 'AccountDetails' })
......
......@@ -106,9 +106,6 @@ class AccountRecoverView extends React.Component {
ENTER RECOVERY WORDS
</Text>
<AccountSeed
onFocus={e => {
this.scroll.props.scrollToFocusedInput(findNodeHandle(e.target));
}}
valid={validateSeed(selected.seed, selected.validBip39Seed).valid}
onChangeText={seed => {
accounts.updateNew({ seed });
......
......@@ -50,6 +50,7 @@ export class AccountUnlockAndSign extends React.PureComponent {
navigate={() => {
const resetAction = StackActions.reset({
index: 1,
key: undefined, // FIXME workaround for now, use SwitchNavigator later: https://github.com/react-navigation/react-navigation/issues/1127#issuecomment-295841343
actions: [
NavigationActions.navigate({ routeName: 'AccountList' }),
NavigationActions.navigate({ routeName: next })
......@@ -84,6 +85,7 @@ export class AccountUnlock extends React.Component {
} else {
const resetAction = StackActions.reset({
index: 2,
key: undefined, // FIXME workaround for now, use SwitchNavigator later: https://github.com/react-navigation/react-navigation/issues/1127#issuecomment-295841343
actions: [
NavigationActions.navigate({ routeName: 'AccountList' }),
NavigationActions.navigate({ routeName: 'AccountDetails' }),
......
......@@ -19,7 +19,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import { Alert, StyleSheet, Text, View } from 'react-native';
import Camera from 'react-native-camera';
import { RNCamera } from 'react-native-camera';
import { Subscribe } from 'unstated';
import colors from '../colors';
import AccountsStore from '../stores/AccountsStore';
......@@ -113,7 +113,7 @@ export class QrScannerView extends React.PureComponent {
return <View style={styles.inactive} />;
}
return (
<Camera onBarCodeRead={this.props.onBarCodeRead} style={styles.view}>
<RNCamera onBarCodeRead={this.props.onBarCodeRead} style={styles.view}>
<View style={styles.body}>
<View style={styles.top}>
<Text style={styles.titleTop}>SCANNER</Text>
......@@ -128,7 +128,7 @@ export class QrScannerView extends React.PureComponent {
<Text style={styles.descSecondary}>To Sign a New Transaction</Text>
</View>
</View>
</Camera>
</RNCamera>
);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment