0
Fork 0
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:
simeng-li 2023-03-01 13:42:45 +08:00 committed by GitHub
parent f111128320
commit a43c8720f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 10 deletions

View file

@ -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>
);

View file

@ -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) => {

View file

@ -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}