This repository was archived by the owner on Feb 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 168
Restore wallet #612
Merged
Merged
Restore wallet #612
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
89564f0
Remove unused styles from settings unit/fiat.
valentinewallace ad92127
Add recovery window const to config and initWallet.
valentinewallace f01ded5
Add `restoring` and `restoreSeed` fields to store + setters.
valentinewallace 90f9d73
Add wallet.restoreWallet, giving lnd the seed and password to restore.
valentinewallace bc93d7e
Add computed fields for restore: seed indices, verify and copy.
valentinewallace c5ef05a
Add restoreIndex field to store and init functions for wallet restore.
valentinewallace 1fd414c
Add "SelectSeed" view.
valentinewallace aca414d
Navigate to SelectSeed instead of Seed on fresh app start.
valentinewallace 2ae3fa1
Modify RestoreWallet (now RestoreSeed) to utilize new seedVerifyIndic…
valentinewallace 0c8b010
Add RestorePassword view for password entry during restore.
valentinewallace d778154
Hook up RestoreSeed view.
valentinewallace File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import React from 'react'; | ||
| import { StyleSheet, View } from 'react-native'; | ||
| import { observer } from 'mobx-react'; | ||
| import PropTypes from 'prop-types'; | ||
| import Background from '../component/background'; | ||
| import MainContent from '../component/main-content'; | ||
| import { H1Text } from '../component/text'; | ||
| import { Header } from '../component/header'; | ||
| import { Button, BackButton, GlasButton } from '../component/button'; | ||
| import { InputField } from '../component/field'; | ||
| import Card from '../component/card'; | ||
| import { FormSubText, FormStretcher } from '../component/form'; | ||
|
|
||
| // | ||
| // Restore Wallet Password View | ||
| // | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| content: { | ||
| justifyContent: 'flex-end', | ||
| }, | ||
| title: { | ||
| textAlign: 'center', | ||
| marginBottom: 20, | ||
| }, | ||
| card: { | ||
| maxHeight: 350, | ||
| maxWidth: 680, | ||
| paddingLeft: 45, | ||
| paddingRight: 45, | ||
| paddingBottom: 50, | ||
| }, | ||
| }); | ||
|
|
||
| const RestorePasswordView = ({ store, wallet, nav }) => ( | ||
| <Background image="purple-gradient-bg"> | ||
| <Header> | ||
| <BackButton onPress={() => nav.goSelectSeed()} /> | ||
| <Button disabled onPress={() => {}} /> | ||
| </Header> | ||
| <MainContent style={styles.content}> | ||
| <View> | ||
| <H1Text style={styles.title}>Restore wallet</H1Text> | ||
| </View> | ||
| <Card style={styles.card}> | ||
| <FormSubText>Please enter your password.</FormSubText> | ||
| <FormStretcher> | ||
| <InputField | ||
| style={styles.input} | ||
| placeholder="Password" | ||
| secureTextEntry={true} | ||
| autoFocus={true} | ||
| value={store.wallet.password} | ||
| onChangeText={password => wallet.setPassword({ password })} | ||
| onSubmitEditing={() => wallet.restoreWallet()} | ||
| /> | ||
| </FormStretcher> | ||
| </Card> | ||
| <GlasButton onPress={() => wallet.restoreWallet()}>Restore</GlasButton> | ||
| </MainContent> | ||
| </Background> | ||
| ); | ||
|
|
||
| RestorePasswordView.propTypes = { | ||
| store: PropTypes.object.isRequired, | ||
| wallet: PropTypes.object.isRequired, | ||
| nav: PropTypes.object.isRequired, | ||
| }; | ||
|
|
||
| export default observer(RestorePasswordView); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above does the same in one line. Why the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, did you see this comment? #612 (comment) This is the reason I changed it, you may not be getting the same issue?