diff --git a/app/(authenticated)/chunithm/page.tsx b/app/(authenticated)/chunithm/page.tsx index 2cbfe09..7f9c446 100644 --- a/app/(authenticated)/chunithm/page.tsx +++ b/app/(authenticated)/chunithm/page.tsx @@ -1,3 +1,4 @@ +import { AvatarCustomization } from "@/components/avatarcustomization/page"; import ChunithmScorePlaylog from "@/components/scoreplaylog/page"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; @@ -12,7 +13,11 @@ const ChunithmPage = () => { - Change your password here. + +
+ +
+
); diff --git a/components/avatarcustomization/page.tsx b/components/avatarcustomization/page.tsx new file mode 100644 index 0000000..6996a25 --- /dev/null +++ b/components/avatarcustomization/page.tsx @@ -0,0 +1,324 @@ +"use client"; + +import { zodResolver } from "@hookform/resolvers/zod"; +import { Check, ChevronsUpDown } from "lucide-react"; +import { useForm } from "react-hook-form"; +import { z } from "zod"; + +import { cn } from "@/lib/utils"; +import { Button } from "@/components/ui/button"; +import { + Command, + CommandEmpty, + CommandGroup, + CommandInput, + CommandItem, + CommandList, +} from "@/components/ui/command"; +import { + Form, + FormControl, + FormDescription, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; +import { toast } from "@/components/ui/use-toast"; + +const AvatarParts = [ + { label: "English", value: "en" }, + { label: "French", value: "fr" }, + { label: "German", value: "de" }, + { label: "Spanish", value: "es" }, + { label: "Portuguese", value: "pt" }, + { label: "Russian", value: "ru" }, + { label: "Japanese", value: "ja" }, + { label: "Korean", value: "ko" }, + { label: "Chinese", value: "zh" }, +] as const; + +const FormSchema = z.object({ + AvatarHead: z.string({ + required_error: "Please select a head item.", + }), + AvatarBody: z.string({ + required_error: "Please select a body item.", + }), + AvatarFace: z.string({ + required_error: "Please select a face item.", + }), + AvatarBack: z.string({ + required_error: "Please select a back item.", + }), +}); + +export function AvatarCustomization() { + const form = useForm>({ + resolver: zodResolver(FormSchema), + }); + + function onSubmit(data: z.infer) { + toast({ + title: "You submitted the following values:", + description: ( +
+          {JSON.stringify(data, null, 2)}
+        
+ ), + }); + } + + return ( +
+ + ( + + Avatar Head Item + + + + + + + + + + + No head item found. + + {AvatarParts.map((part) => ( + { + form.setValue("AvatarHead", part.value); + }} + > + + {part.label} + + ))} + + + + + + + + + )} + /> + ( + + Avatar Body Item + + + + + + + + + + + No body item found. + + {AvatarParts.map((part) => ( + { + form.setValue("AvatarBody", part.value); + }} + > + + {part.label} + + ))} + + + + + + + + + )} + /> + ( + + Avatar Face Item + + + + + + + + + + + No face item found. + + {AvatarParts.map((part) => ( + { + form.setValue("AvatarFace", part.value); + }} + > + + {part.label} + + ))} + + + + + + + + + )} + /> + ( + + Avatar Back Item + + + + + + + + + + + No back item found. + + {AvatarParts.map((part) => ( + { + form.setValue("AvatarBack", part.value); + }} + > + + {part.label} + + ))} + + + + + + + + + )} + /> + + + + ); +}