Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 87d1b60

Browse files
committed
Cleanup seed-restore-mobile view
1 parent dd76047 commit 87d1b60

File tree

1 file changed

+41
-53
lines changed

1 file changed

+41
-53
lines changed

src/view/restore-seed-mobile.js

Lines changed: 41 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component } from 'react';
1+
import React from 'react';
22
import { observer } from 'mobx-react';
33
import PropTypes from 'prop-types';
44
import SeedEntry from '../component/seed-entry';
@@ -40,58 +40,46 @@ const styles = createStyles(
4040
})
4141
);
4242

43-
class RestoreSeedView extends Component {
44-
constructor(props) {
45-
super(props);
46-
this.state = {
47-
focusedInput: 0,
48-
};
49-
}
50-
51-
render() {
52-
const { store, wallet } = this.props;
53-
return (
54-
<Background image="purple-gradient-bg">
55-
<Header>
56-
<BackButton onPress={() => wallet.initPrevRestorePage()} />
57-
<Button disabled onPress={() => {}} />
58-
</Header>
59-
<MainContent style={styles.content}>
60-
<CopyOnboardText style={styles.title}>
61-
{'Restore your wallet'}
62-
</CopyOnboardText>
63-
<Card>
64-
<FormSubText style={styles.subText}>
65-
{store.restoreVerifyCopy}
66-
</FormSubText>
67-
{store.restoreVerifyIndexes.map((seedIndex, i) => (
68-
<SeedEntry
69-
seedIndex={seedIndex}
70-
value={store.seedMnemonic[seedIndex - 1]}
71-
onChangeText={word =>
72-
wallet.setRestoreSeed({ word, index: seedIndex - 1 })
73-
}
74-
key={i}
75-
autoFocus={seedIndex - 1 === store.wallet.focusedRestoreInd}
76-
onSubmitEditing={() =>
77-
i === 2
78-
? wallet.initNextRestorePage()
79-
: wallet.setFocusedRestoreInd({ index: seedIndex })
80-
}
81-
onClick={() =>
82-
wallet.setFocusedRestoreInd({ index: seedIndex - 1 })
83-
}
84-
/>
85-
))}
86-
</Card>
87-
<SmallGlasButton onPress={() => wallet.initNextRestorePage()}>
88-
Next
89-
</SmallGlasButton>
90-
</MainContent>
91-
</Background>
92-
);
93-
}
94-
}
43+
const RestoreSeedView = ({ store, wallet }) => (
44+
<Background image="purple-gradient-bg">
45+
<Header>
46+
<BackButton onPress={() => wallet.initPrevRestorePage()} />
47+
<Button disabled onPress={() => {}} />
48+
</Header>
49+
<MainContent style={styles.content}>
50+
<CopyOnboardText style={styles.title}>
51+
Restore your wallet
52+
</CopyOnboardText>
53+
<Card>
54+
<FormSubText style={styles.subText}>
55+
{store.restoreVerifyCopy}
56+
</FormSubText>
57+
{store.restoreVerifyIndexes.map((seedIndex, i) => (
58+
<SeedEntry
59+
seedIndex={seedIndex}
60+
value={store.seedMnemonic[seedIndex - 1]}
61+
onChangeText={word =>
62+
wallet.setRestoreSeed({ word, index: seedIndex - 1 })
63+
}
64+
key={i}
65+
autoFocus={seedIndex - 1 === store.wallet.focusedRestoreInd}
66+
onSubmitEditing={() =>
67+
i === 2
68+
? wallet.initNextRestorePage()
69+
: wallet.setFocusedRestoreInd({ index: seedIndex })
70+
}
71+
onClick={() =>
72+
wallet.setFocusedRestoreInd({ index: seedIndex - 1 })
73+
}
74+
/>
75+
))}
76+
</Card>
77+
<SmallGlasButton onPress={() => wallet.initNextRestorePage()}>
78+
Next
79+
</SmallGlasButton>
80+
</MainContent>
81+
</Background>
82+
);
9583

9684
RestoreSeedView.propTypes = {
9785
store: PropTypes.object.isRequired,

0 commit comments

Comments
 (0)