Skip to content

Commit 95d054d

Browse files
committed
Form.Control.Feeback is added instead of instead of artisan validations
1 parent 4025244 commit 95d054d

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

examples/wallet/app/components/CreateUnlockWalletPassword.js

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,37 +60,29 @@ export default ({ setValidUnlockWalletPassword }) => {
6060
onChange={event => setPassword(event.target.value)}
6161
onBlur={() => checkValidUnlockWalletPassword(password)}
6262
/>
63-
<Form.Label className="text-danger" hidden={isValidPassword}>
64-
<em className="text-danger">
65-
The password must have at least 8 chars.
66-
</em>
67-
</Form.Label>
63+
<Form.Control.Feedback type="invalid">
64+
The password must have at least 8 chars.
65+
</Form.Control.Feedback>
6866
<Form.Control
6967
type="password"
7068
name="confirmPassword"
7169
id="confirmPassword"
7270
placeholder="Confirm password"
7371
value={confirmPassword}
72+
isInvalid={!arePasswordAndConfirmationEqual}
7473
onChange={event => setConfirmPassword(event.target.value)}
7574
onBlur={() =>
7675
checkValidUnlockWalletConfirmation(password, confirmPassword)
7776
}
7877
className="mt-3"
7978
/>
8079
<Form.Text>
81-
<em className="text-danger">
82-
This key allows you to unlock your wallet every time you start it
83-
and to keep your account data in a more secure way.
84-
</em>
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.
8582
</Form.Text>
86-
<Form.Label
87-
className="text-danger"
88-
hidden={arePasswordAndConfirmationEqual}
89-
>
90-
<em className="text-danger">
91-
password and confirmation must be the same.
92-
</em>
93-
</Form.Label>
83+
<Form.Control.Feedback type="invalid">
84+
password and confirmation must be the same.
85+
</Form.Control.Feedback>
9486
</Form.Group>
9587
</Form.Group>
9688
);

0 commit comments

Comments
 (0)