Skip to content

Commit

Permalink
fix: watch 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
simeunseo committed Jan 4, 2025
1 parent 0ebf32e commit 7e18943
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 33 deletions.
31 changes: 11 additions & 20 deletions src/components/members/upload/FormSection/Basic/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default function MemberBasicFormSection() {
const {
control,
register,
watch,
formState: { errors },
getValues,
setValue,
Expand Down Expand Up @@ -77,7 +76,7 @@ export default function MemberBasicFormSection() {
<StyledTextField
disabled
{...register('name')}
value={watch('name') || ''}
value=''
isError={errors.hasOwnProperty('name')}
errorMessage={errors.name?.message}
placeholder='이름 입력'
Expand All @@ -87,23 +86,23 @@ export default function MemberBasicFormSection() {
<BirthdayInputWrapper>
<StyledTextField
{...register('birthday.year')}
value={watch('birthday.year') || ''}
value=''
placeholder='년도'
isError={errors.birthday?.hasOwnProperty('year')}
type='number'
pattern='\d*'
/>
<StyledTextField
{...register('birthday.month')}
value={watch('birthday.month') || ''}
value=''
placeholder='월'
isError={errors.birthday?.hasOwnProperty('month')}
type='number'
pattern='\d*'
/>
<StyledTextField
{...register('birthday.day')}
value={watch('birthday.day') || ''}
value=''
placeholder='일'
isError={errors.birthday?.hasOwnProperty('day')}
type='number'
Expand All @@ -119,45 +118,37 @@ export default function MemberBasicFormSection() {
onClick={(e) => handleBlind(e, 'isPhoneBlind', openMaskingPhoneModal)}
/>
</StyledBlindSwitch>
<StyledTextField {...register('phone')} value={watch('phone') || ''} placeholder='010XXXXXXXX' />
<StyledTextField {...register('phone')} value='' placeholder='010XXXXXXXX' />
</FormItem>
<FormItem title='이메일' required errorMessage={errors.email?.message} className='maskable'>
<StyledTextField {...register('email')} value={watch('email') || ''} type='email' placeholder='이메일 입력' />
<StyledTextField {...register('email')} value='' type='email' placeholder='이메일 입력' />
</FormItem>
<FormItem
title='활동 지역'
description={`가까운 지하철역을 작성해주세요. \n활동 지역이 여러개일 경우 쉼표(,)로 구분해서 적어주세요.`}
>
<StyledTextField
{...register('address')}
value={watch('address') || ''}
value=''
placeholder='ex) 광나루역, 서울역, 홍대입구역'
style={{ marginTop: '4px' }}
/>
</FormItem>
<Responsive only='desktop'>
<EducationInputWrapper>
<FormItem title='학교'>
<StyledEducationInput
{...register('university')}
value={watch('university') || ''}
placeholder='학교 입력'
/>
<StyledEducationInput {...register('university')} value='' placeholder='학교 입력' />
</FormItem>
<FormItem title='전공'>
<StyledEducationInput {...register('major')} value={watch('major') || ''} placeholder='전공 입력' />
<StyledEducationInput {...register('major')} value='' placeholder='전공 입력' />
</FormItem>
</EducationInputWrapper>
</Responsive>
<Responsive only='mobile' asChild>
<FormItem title='학교 / 전공'>
<EducationInputWrapper>
<StyledEducationInput
{...register('university')}
value={watch('university') || ''}
placeholder='학교 입력'
/>
<StyledEducationInput {...register('major')} value={watch('major') || ''} placeholder='전공 입력' />
<StyledEducationInput {...register('university')} value='' placeholder='학교 입력' />
<StyledEducationInput {...register('major')} value='' placeholder='전공 입력' />
</EducationInputWrapper>
</FormItem>
</Responsive>
Expand Down
10 changes: 5 additions & 5 deletions src/components/members/upload/FormSection/Career.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ export default function CareerFormSection({ header }: CareerFormSectionProps) {
<CareerInputWrapper>
<TextField
{...register(`careers.${index}.companyName`)}
value={watch(`careers.${index}.companyName`) || ''}
value=''
placeholder='회사 입력 ex. 토스, 네이버, 당근, 쿠팡'
/>
<TextField
{...register(`careers.${index}.title`)}
value={watch(`careers.${index}.title`) || ''}
value=''
placeholder='직무 입력 ex. 프로덕트 디자이너'
/>
</CareerInputWrapper>
Expand Down Expand Up @@ -163,15 +163,15 @@ export default function CareerFormSection({ header }: CareerFormSectionProps) {
<Responsive only='desktop' asChild>
<StyledTextField
{...register('skill')}
value={watch('skill') || ''}
value=''
onChange={(e) => setValue('skill', e.target.value, { shouldDirty: true })}
placeholder='ex) Node, Product Managing, Branding, UI'
/>
</Responsive>
<Responsive only='mobile'>
<StyledTextarea
{...register('skill')}
value={watch('skill') || ''}
value=''
onChange={(e) => setValue('skill', e.target.value, { shouldDirty: true })}
placeholder='ex) Node, Product Managing, BI/BX'
fixedHeight={128}
Expand Down Expand Up @@ -221,7 +221,7 @@ export default function CareerFormSection({ header }: CareerFormSectionProps) {
/>
<TextField
{...register(`links.${index}.url`)}
value={watch(`links.${index}.url`) || ''}
value=''
isError={errors?.links?.[index]?.hasOwnProperty('url')}
placeholder='https://'
className='link'
Expand Down
11 changes: 3 additions & 8 deletions src/components/members/upload/FormSection/Tmi/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export default function TmiFormSection() {
control,
formState: { errors },
register,
watch,
} = useFormContext<MemberUploadForm>();

const getMbtiErrorMessage = () => {
Expand Down Expand Up @@ -63,7 +62,7 @@ export default function TmiFormSection() {
/>
<StyledTextArea
{...register('mbtiDescription')}
value={watch('mbtiDescription') || ''}
value=''
placeholder='ex) 저는 극강의 EEE에요.'
fixedHeight={100}
/>
Expand Down Expand Up @@ -101,16 +100,12 @@ export default function TmiFormSection() {

<StyledMemberFormItem title='저는 요새 이런 걸 좋아해요!'>
<Responsive only='desktop' asChild>
<StyledTextField
{...register('interest')}
value={watch('interest') || ''}
placeholder='ex) 요즘 넷플릭스 ‘더 글로리’에 빠졌어요.'
/>
<StyledTextField {...register('interest')} value='' placeholder='ex) 요즘 넷플릭스 ‘더 글로리’에 빠졌어요.' />
</Responsive>
<Responsive only='mobile'>
<StyledTextArea
{...register('interest')}
value={watch('interest') || ''}
value=''
placeholder='ex) 요즘 넷플릭스 ‘더 글로리’에 빠졌어요.'
fixedHeight={100}
/>
Expand Down

0 comments on commit 7e18943

Please sign in to comment.