From 723c4e272823655fcea9e8b16d434bc5a62ba7e7 Mon Sep 17 00:00:00 2001 From: phoenixpereira Date: Fri, 16 Feb 2024 10:16:15 +1030 Subject: [PATCH] feat: fill name in settings --- src/app/(account)/settings/PersonalInfoSettings.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/(account)/settings/PersonalInfoSettings.tsx b/src/app/(account)/settings/PersonalInfoSettings.tsx index 8d948239..f1b0c11b 100644 --- a/src/app/(account)/settings/PersonalInfoSettings.tsx +++ b/src/app/(account)/settings/PersonalInfoSettings.tsx @@ -2,6 +2,7 @@ import Button from '@/components/Button'; import ControlledField from '@/components/ControlledField'; import { AGE_BRACKETS, GENDERS, STUDENT_TYPES, STUDENT_STATUSES } from '@/constants/student-info'; import { useMount } from '@/hooks/use-mount'; +import { useUser } from '@clerk/nextjs'; import { zodResolver } from '@hookform/resolvers/zod'; import { useState } from 'react'; import { useForm } from 'react-hook-form'; @@ -23,9 +24,10 @@ const personalInfoSchema = z.object({ }); export default function PersonalInfoSettings() { + const { user } = useUser(); const [formData, setFormData] = useState({ - firstName: '', - lastName: '', + firstName: user?.firstName || '', + lastName: user?.lastName || '', ageBracket: '', gender: '', studentType: '', @@ -62,10 +64,8 @@ export default function PersonalInfoSettings() { return (
-
-

Change Personal Info

-
-
+

Change Personal Info

+