mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 20:14:35 -04:00
fix(frontend): add error prop to password input
Signed-off-by: Avinash <avinash.kumar.cs92@gmail.com>
This commit is contained in:
parent
58819f6018
commit
dae3b9d8dc
4 changed files with 24 additions and 8 deletions
|
@ -69,6 +69,10 @@ export const RegisterPage: NextPage = () => {
|
|||
)
|
||||
}, [username, password, displayName, passwordAgain])
|
||||
|
||||
const isWeakPassword = useMemo(() => {
|
||||
return error === RegisterErrorType.PASSWORD_TOO_WEAK
|
||||
}, [error])
|
||||
|
||||
const onUsernameChange = useOnInputChange(setUsername)
|
||||
const onDisplayNameChange = useOnInputChange(setDisplayName)
|
||||
const onPasswordChange = useOnInputChange(setPassword)
|
||||
|
@ -95,8 +99,13 @@ export const RegisterPage: NextPage = () => {
|
|||
<Form onSubmit={doRegisterSubmit}>
|
||||
<UsernameField onChange={onUsernameChange} value={username} />
|
||||
<DisplayNameField onChange={onDisplayNameChange} value={displayName} />
|
||||
<NewPasswordField onChange={onPasswordChange} value={password} />
|
||||
<PasswordAgainField password={password} onChange={onPasswordAgainChange} value={passwordAgain} />
|
||||
<NewPasswordField onChange={onPasswordChange} value={password} hasError={isWeakPassword} />
|
||||
<PasswordAgainField
|
||||
password={password}
|
||||
onChange={onPasswordAgainChange}
|
||||
value={passwordAgain}
|
||||
hasError={isWeakPassword}
|
||||
/>
|
||||
|
||||
<RegisterInfos />
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue