🚸 Remember current values as default in create user stepper
This commit is contained in:
@@ -5,13 +5,15 @@ import { z } from 'zod';
|
||||
|
||||
interface CreateAccountStepProps {
|
||||
nextStep: ({ eMail, username }: { username: string; eMail: string }) => void;
|
||||
defaultUsername: string;
|
||||
defaultEmail: string;
|
||||
}
|
||||
|
||||
export const CreateAccountStep = ({ nextStep }: CreateAccountStepProps) => {
|
||||
export const CreateAccountStep = ({ defaultEmail, defaultUsername, nextStep }: CreateAccountStepProps) => {
|
||||
const form = useForm({
|
||||
initialValues: {
|
||||
username: '',
|
||||
eMail: '',
|
||||
username: defaultUsername,
|
||||
eMail: defaultEmail,
|
||||
},
|
||||
validateInputOnBlur: true,
|
||||
validateInputOnChange: true,
|
||||
|
||||
@@ -43,17 +43,19 @@ function getStrength(password: string) {
|
||||
}
|
||||
|
||||
interface CreateAccountSecurityStepProps {
|
||||
defaultPassword: string;
|
||||
nextStep: ({ password }: { password: string }) => void;
|
||||
prevStep: () => void;
|
||||
}
|
||||
|
||||
export const CreateAccountSecurityStep = ({
|
||||
defaultPassword,
|
||||
nextStep,
|
||||
prevStep,
|
||||
}: CreateAccountSecurityStepProps) => {
|
||||
const form = useForm({
|
||||
initialValues: {
|
||||
password: '',
|
||||
password: defaultPassword,
|
||||
},
|
||||
validateInputOnBlur: true,
|
||||
validateInputOnChange: true,
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
IconLogout,
|
||||
IconMoonStars,
|
||||
IconSun,
|
||||
IconUserCog
|
||||
IconUserCog,
|
||||
} from '@tabler/icons-react';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { User } from 'next-auth';
|
||||
|
||||
Reference in New Issue
Block a user