diff --git a/src/features/my-page/ui/profile-edit-modal.tsx b/src/features/my-page/ui/profile-edit-modal.tsx index dd6a4500..7f2e66fe 100644 --- a/src/features/my-page/ui/profile-edit-modal.tsx +++ b/src/features/my-page/ui/profile-edit-modal.tsx @@ -81,9 +81,7 @@ function ProfileEditForm({ // 이름 유효성 검사: 2~10자, 한글 또는 영문만 허용 const isNameValid = /^[가-힣a-zA-Z]{2,10}$/.test(profileForm.name); // 연락처 유효성 검사: "(2~3자리 지역번호)-(3~4자리 번호)-(4자리 번호)" 형식 - const isTelValid = - profileForm.tel.length === 0 || - /^\d{2,3}-\d{3,4}-\d{4}$/.test(profileForm.tel); + const isTelValid = /^\d{2,3}-\d{3,4}-\d{4}$/.test(profileForm.tel); const queryClient = useQueryClient(); const { mutateAsync: updateProfile } = useUpdateUserProfileMutation(memberId); @@ -191,12 +189,13 @@ function ProfileEditForm({ { // 숫자와 하이픈(-)만 입력 허용 @@ -209,6 +208,7 @@ function ProfileEditForm({ label="Github" type="text" description="본인의 활동을 확인할 수 있는 GitHub 링크를 입력해 주세요." + placeholder="https://github.com/username" value={profileForm.githubLink} onChange={(value) => setProfileForm({ diff --git a/src/shared/ui/form/form-field.tsx b/src/shared/ui/form/form-field.tsx index 737f3edf..943cb7d4 100644 --- a/src/shared/ui/form/form-field.tsx +++ b/src/shared/ui/form/form-field.tsx @@ -14,6 +14,7 @@ type InputType = interface FormFieldProps { label: string; description?: string; + placeholder?: string; type: InputType; maxLength?: number; required?: boolean; @@ -28,6 +29,7 @@ export function FormField({ label, error = false, description, + placeholder, type, required = false, maxLength = 30, @@ -42,7 +44,7 @@ export function FormField({ return ( <> onChange(e.target.value as T)} @@ -59,7 +61,7 @@ export function FormField({ case 'textarea': return ( ({ onChange(v as T)} /> {description && ( @@ -89,7 +91,7 @@ export function FormField({ options={options} defaultValue={value as string[]} onChange={(v) => onChange(v as T)} - placeholder="선택해주세요" + placeholder={placeholder || '선택해주세요.'} /> {description && (