Skip to content

Commit 1761414

Browse files
committed
<span> tag is used insetead of <em> and Form.Feedback is added
1 parent 75a13f1 commit 1761414

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

examples/wallet/app/components/CreateUnlockWalletPassword.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ export default ({ setValidUnlockWalletPassword }) => {
7777
className="mt-3"
7878
/>
7979
<Form.Text>
80-
This key allows you to unlock your wallet every time you start it and
81-
to keep your account data in a more secure way.
80+
<span>
81+
This key allows you to unlock your wallet every time you start it
82+
and to keep your account data in a more secure way.
83+
</span>
8284
</Form.Text>
8385
<Form.Control.Feedback type="invalid">
8486
password and confirmation must be the same.

examples/wallet/app/components/RestoreWalletFromMnemonic.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,16 @@ export default ({
6060
onChange={event => setNewMnemonicPhrase(event.target.value)}
6161
onBlur={() => checkIsValidMnemonicPhrase()}
6262
/>
63-
<Form.Label className="text-danger" hidden={isMnemonicValid}>
64-
<em className="text-danger">
65-
The phrase can have 12, 15, 18, 21 or 24 valid words.
66-
</em>
67-
</Form.Label>
63+
<Form.Control.Feedback type="invalid">
64+
The phrase can have 12, 15, 18, 21 or 24 valid words.
65+
</Form.Control.Feedback>
6866
<Form.Text>
6967
Example:
7068
<br />
71-
<em className="text-danger">
69+
<span>
7270
decade panther require cruise robust mail gadget advice tonight
7371
post inner snack
74-
</em>
72+
</span>
7573
</Form.Text>
7674
<Form.Control
7775
type="password"
@@ -82,10 +80,10 @@ export default ({
8280
className="mt-3"
8381
/>
8482
<Form.Text>
85-
<em className="text-danger">
83+
<span>
8684
This secret password is part of the BIP39 standard to generate
8785
safer wallet seeds.
88-
</em>
86+
</span>
8987
</Form.Text>
9088
<CreateUnlockWalletPassword />
9189
</Form.Group>

examples/wallet/app/components/RestoreWalletFromPrivateKey.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ export default ({
2323
const handleSubmit = function handleSubmit(event) {
2424
event.preventDefault();
2525
if (isValidUnlockPassword) {
26-
setAccount(newPrivateKey, unlockWalletPassword);
26+
return setAccount(newPrivateKey, unlockWalletPassword).catch(error => {
27+
console.error(error);
28+
setPrivateKeyErrorMessage('Invalid private key');
29+
});
2730
}
2831
};
2932

3033
const [newPrivateKey, setNewPrivateKey] = useState('');
34+
const [privateKeyErrorMessage, setPrivateKeyErrorMessage] = useState('');
3135

3236
return (
3337
<Container>
@@ -39,14 +43,18 @@ export default ({
3943
type="text"
4044
name="privateKey"
4145
value={newPrivateKey}
46+
isInvalid={privateKeyErrorMessage}
4247
onChange={event => setNewPrivateKey(event.target.value)}
4348
/>
49+
<Form.Control.Feedback type="invalid">
50+
{privateKeyErrorMessage}
51+
</Form.Control.Feedback>
4452
<Form.Text>
4553
It&apos;s a string like:
4654
<br />
47-
<em className="text-danger">
55+
<span>
4856
ed25519e_sk15psr45hyqnpwcl8xd4lv0m32prenhh8kcltgte2305h5jgynndxect9274j0am0qmmd0snjuadnm6xkgssnkn2njvkg8et8qg0vevsgnwvmpl
49-
</em>
57+
</span>
5058
</Form.Text>
5159
<CreateUnlockWalletPassword />
5260
</Form.Group>

examples/wallet/app/pages/UnlockWallet.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ export default ({ setKeysWithUnlockWalletPassword }: Props) => {
4242
isInvalid={isWrongSpendingPassword}
4343
onChange={event => setUnlockWalletPassword(event.target.value)}
4444
/>
45-
<Form.Label className="text-danger" hidden={!isWrongSpendingPassword}>
46-
<code>Incorrect password</code>
47-
</Form.Label>
45+
<Form.Control.Feedback type="invalid">
46+
Incorrect password
47+
</Form.Control.Feedback>
4848
</Form.Group>
4949
<Row className="justify-content-center">
5050
<Button variant="primary" type="submit">

0 commit comments

Comments
 (0)