@@ -9,16 +9,10 @@ import { isValidMnemonic } from '../utils/mnemonic';
9
9
import CreateUnlockWalletPassword from '../containers/CreateUnlockWalletPassword' ;
10
10
11
11
type Props = {
12
- setAccountFromMnemonic : SetAccountFromMnemonic ,
13
- unlockWalletPassword : string ,
14
- isValidUnlockPassword : boolean
12
+ setAccountFromMnemonic : SetAccountFromMnemonic
15
13
} ;
16
14
17
- export default ( {
18
- setAccountFromMnemonic,
19
- unlockWalletPassword,
20
- isValidUnlockPassword
21
- } : Props ) => {
15
+ export default ( { setAccountFromMnemonic } : Props ) => {
22
16
const checkIsValidMnemonicPhrase = function checkIsValidMnemonicPhrase ( ) {
23
17
setIsMnemonicValid ( isValidMnemonic ( newMnemonicPhrase ) ) ;
24
18
} ;
@@ -38,6 +32,17 @@ export default ({
38
32
setIsMnemonicValid ( false ) ;
39
33
} ;
40
34
35
+ const setValidCreateUnlockWalletPassword = function setValidCreateUnlockWalletPassword (
36
+ unlockPwd : string ,
37
+ isValid : boolean
38
+ ) : void {
39
+ setUnlockWalletPassword ( unlockPwd ) ;
40
+ setIsValidUnlockPassword ( isValid ) ;
41
+ } ;
42
+
43
+ const [ unlockWalletPassword , setUnlockWalletPassword ] = useState ( '' ) ;
44
+ const [ isValidUnlockPassword , setIsValidUnlockPassword ] = useState ( false ) ;
45
+
41
46
const [ isMnemonicValid , setIsMnemonicValid ] = useState ( true ) ;
42
47
43
48
const [ newMnemonicPhrase , setNewMnemonicPhrase ] = useState ( '' ) ;
@@ -66,10 +71,8 @@ export default ({
66
71
< Form . Text >
67
72
Example:
68
73
< br />
69
- < span >
70
- decade panther require cruise robust mail gadget advice tonight
71
- post inner snack
72
- </ span >
74
+ decade panther require cruise robust mail gadget advice tonight post
75
+ inner snack
73
76
</ Form . Text >
74
77
< Form . Control
75
78
type = "password"
@@ -80,12 +83,14 @@ export default ({
80
83
className = "mt-3"
81
84
/>
82
85
< Form . Text >
83
- < span >
84
- This secret password is part of the BIP39 standard to generate
85
- safer wallet seeds.
86
- </ span >
86
+ This secret password is part of the BIP39 standard to generate safer
87
+ wallet seeds.
87
88
</ Form . Text >
88
- < CreateUnlockWalletPassword />
89
+ < CreateUnlockWalletPassword
90
+ setValidCreateUnlockWalletPassword = {
91
+ setValidCreateUnlockWalletPassword
92
+ }
93
+ />
89
94
</ Form . Group >
90
95
< Row className = "justify-content-between" >
91
96
< Button variant = "secondary" type = "button" >
0 commit comments