mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
feat(ui): add password rule description (#3244)
Signed-off-by: tison <wander4096@gmail.com> Co-authored-by: tison <wander4096@gmail.com> Co-authored-by: Gao Sun <gao@silverhand.io>
This commit is contained in:
parent
f111128320
commit
a43c8720f7
3 changed files with 16 additions and 10 deletions
|
@ -1,19 +1,17 @@
|
|||
import type { TFuncKey } from 'react-i18next';
|
||||
|
||||
import SecondaryPageWrapper from '@/components/SecondaryPageWrapper';
|
||||
import SetPasswordForm from '@/containers/SetPassword';
|
||||
|
||||
import useSetPassword from './use-set-password';
|
||||
|
||||
type Props = {
|
||||
notification?: TFuncKey;
|
||||
};
|
||||
|
||||
const SetPassword = (props: Props) => {
|
||||
const SetPassword = () => {
|
||||
const { setPassword } = useSetPassword();
|
||||
|
||||
return (
|
||||
<SecondaryPageWrapper title="description.set_password" {...props}>
|
||||
<SecondaryPageWrapper
|
||||
title="description.set_password"
|
||||
description="error.password_min_length"
|
||||
descriptionProps={{ min: 6 }}
|
||||
>
|
||||
<SetPasswordForm autoFocus onSubmit={setPassword} />
|
||||
</SecondaryPageWrapper>
|
||||
);
|
||||
|
|
|
@ -16,7 +16,11 @@ const RegisterPassword = () => {
|
|||
}
|
||||
|
||||
return (
|
||||
<SecondaryPageWrapper title="description.new_password">
|
||||
<SecondaryPageWrapper
|
||||
title="description.new_password"
|
||||
description="error.password_min_length"
|
||||
descriptionProps={{ min: 6 }}
|
||||
>
|
||||
<SetPassword
|
||||
autoFocus
|
||||
onSubmit={(password) => {
|
||||
|
|
|
@ -7,7 +7,11 @@ const ResetPassword = () => {
|
|||
const { resetPassword, errorMessage, clearErrorMessage } = useResetPassword();
|
||||
|
||||
return (
|
||||
<SecondaryPageWrapper title="description.new_password">
|
||||
<SecondaryPageWrapper
|
||||
title="description.new_password"
|
||||
description="error.password_min_length"
|
||||
descriptionProps={{ min: 6 }}
|
||||
>
|
||||
<SetPassword
|
||||
autoFocus
|
||||
errorMessage={errorMessage}
|
||||
|
|
Loading…
Reference in a new issue