File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
frontend/src/app/onboard/_components/Forms Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change
1
+ "use client" ;
2
+
3
+ import { TextInput } from "@/components/form/TextInput" ;
4
+ import { UserAvatarInput } from "@/components/form/UserAvatarInput" ;
5
+ import { zodResolver } from "@hookform/resolvers/zod" ;
6
+ import { useForm } from "react-hook-form" ;
7
+ import { Form } from "@/components/ui/form" ;
8
+ import { z } from "zod" ;
9
+ import {
10
+ Card ,
11
+ CardContent ,
12
+ CardDescription ,
13
+ CardHeader ,
14
+ CardTitle ,
15
+ } from "@/components/ui/card" ;
16
+ import { Button } from "@/components/ui/button" ;
17
+
18
+ const FormSchema = z . object ( {
19
+ profilePicture : z . string ( ) , // TODO: change to actual image file type
20
+ displayName : z . string ( ) ,
21
+ } ) ;
22
+
23
+ export default function UserDetailsForm ( ) {
24
+ const form = useForm < z . infer < typeof FormSchema > > ( {
25
+ resolver : zodResolver ( FormSchema ) ,
26
+ defaultValues : {
27
+ profilePicture : "" ,
28
+ displayName : "" ,
29
+ } ,
30
+ } ) ;
31
+
32
+ return (
33
+ < Card className = "mt-3" >
34
+ < CardHeader >
35
+ < CardTitle className = "text-xl" > Let's setup your profile</ CardTitle >
36
+ < CardDescription >
37
+ Tell us more about yourself so that we can provide you a personalised
38
+ experience.
39
+ </ CardDescription >
40
+ </ CardHeader >
41
+ < CardContent >
42
+ < Form { ...form } >
43
+ < form className = "flex flex-col gap-5" >
44
+ < UserAvatarInput label = "Profile Image" name = "profilePicture" />
45
+ < TextInput
46
+ label = "Display Name"
47
+ name = "displayName"
48
+ placeholder = { "Name" }
49
+ className = "bg-input-background-100"
50
+ />
51
+ < Button className = "self-center max-w-40" type = "submit" > Next</ Button >
52
+ </ form >
53
+ </ Form >
54
+ </ CardContent >
55
+ </ Card >
56
+ ) ;
57
+ }
You can’t perform that action at this time.
0 commit comments