Skip to content

Commit 3a33877

Browse files
committed
fix(shadcn): Display name at top of form
1 parent 80c1d81 commit 3a33877

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

packages/shadcn/src/components/sign-up-auth-form.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@ export function SignUpAuthForm(props: SignUpAuthFormProps) {
4747
return (
4848
<Form {...form}>
4949
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-2">
50+
{requireDisplayName ? (
51+
<FormField
52+
control={form.control}
53+
name="displayName"
54+
render={({ field }) => (
55+
<FormItem>
56+
<FormLabel>{getTranslation(ui, "labels", "displayName")}</FormLabel>
57+
<FormControl>
58+
<Input {...field} />
59+
</FormControl>
60+
<FormMessage />
61+
</FormItem>
62+
)}
63+
/>
64+
) : null}
5065
<FormField
5166
control={form.control}
5267
name="email"
@@ -73,21 +88,6 @@ export function SignUpAuthForm(props: SignUpAuthFormProps) {
7388
</FormItem>
7489
)}
7590
/>
76-
{requireDisplayName ? (
77-
<FormField
78-
control={form.control}
79-
name="displayName"
80-
render={({ field }) => (
81-
<FormItem>
82-
<FormLabel>{getTranslation(ui, "labels", "displayName")}</FormLabel>
83-
<FormControl>
84-
<Input {...field} />
85-
</FormControl>
86-
<FormMessage />
87-
</FormItem>
88-
)}
89-
/>
90-
) : null}
9191
<Policies />
9292
<Button type="submit" disabled={ui.state !== "idle"}>
9393
{getTranslation(ui, "labels", "createAccount")}

0 commit comments

Comments
 (0)