Skip to content

Commit

Permalink
feat: fill name in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixpereira committed Feb 15, 2024
1 parent bf8a87b commit 723c4e2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app/(account)/settings/PersonalInfoSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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: '',
Expand Down Expand Up @@ -62,10 +64,8 @@ export default function PersonalInfoSettings() {

return (
<form onSubmit={handleSubmit(onSubmit)} className="flex flex-col gap-4">
<div>
<h2 className="text-2xl font-bold">Change Personal Info</h2>
<div className="mb-2 border-b-2 border-black"></div>
</div>
<h2 className="text-2xl font-bold">Change Personal Info</h2>
<div className="mb-2 border-b-2 border-black"></div>
<ControlledField
label="First Name"
name="firstName"
Expand Down

0 comments on commit 723c4e2

Please sign in to comment.