diff --git a/src/components/Manage/User/Create/create-account-step.tsx b/src/components/Manage/User/Create/create-account-step.tsx index b06531559..d2fda30c6 100644 --- a/src/components/Manage/User/Create/create-account-step.tsx +++ b/src/components/Manage/User/Create/create-account-step.tsx @@ -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, diff --git a/src/components/Manage/User/Create/security-step.tsx b/src/components/Manage/User/Create/security-step.tsx index afccbacd6..17143faa5 100644 --- a/src/components/Manage/User/Create/security-step.tsx +++ b/src/components/Manage/User/Create/security-step.tsx @@ -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, diff --git a/src/components/layout/header/AvatarMenu.tsx b/src/components/layout/header/AvatarMenu.tsx index 0ee06a83b..c3bbcb47d 100644 --- a/src/components/layout/header/AvatarMenu.tsx +++ b/src/components/layout/header/AvatarMenu.tsx @@ -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'; diff --git a/src/pages/manage/users/create.tsx b/src/pages/manage/users/create.tsx index 92962fa7b..d8d1631a2 100644 --- a/src/pages/manage/users/create.tsx +++ b/src/pages/manage/users/create.tsx @@ -73,6 +73,8 @@ const CreateNewUserPage = () => { description="Create account" > { form.setFieldValue('account', value); nextStep(); @@ -87,6 +89,7 @@ const CreateNewUserPage = () => { description="Password" > { form.setFieldValue('security', value); nextStep(); @@ -160,7 +163,15 @@ const CreateNewUserPage = () => { - + + - +