Skip to content

Commit

Permalink
refactor: change select component
Browse files Browse the repository at this point in the history
  • Loading branch information
mini-aron committed Jul 29, 2024
1 parent 6d14c7d commit 5c5952d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
6 changes: 0 additions & 6 deletions packages/app/src/features/register/data/PortfolioList.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/app/src/features/register/data/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { default as WorkType } from './WorkType'
export { default as MilitaryList } from './MilitaryList'
export { default as PortfolioList } from './PortfolioList'
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ChangeEvent } from 'react'
import { InputColumn, FormWrapper } from '@features/register/atoms'
import { Input, Select, FileInput } from '@sms/shared'
import { PortfolioList } from '@features/register/data'
import { Input, NewSelect as Select, FileInput } from '@sms/shared'
import {
Control,
FieldErrors,
Expand All @@ -26,7 +25,7 @@ const PortfolioInputs = ({
register,
errors,
setError,
control,
setValue,
watch,
resetField,
}: Props) => {
Expand All @@ -38,11 +37,24 @@ const PortfolioInputs = ({
<InputColumn comment='포트폴리오 형식'>
<Select
name='portfolioType'
control={control}
register={register}
options={PortfolioList}
defaultOpen={false}
defaultValue={watch('portfolioType')}
value={watch('portfolioType')}
/>
onValueChange={(value) =>
setValue(
'portfolioType',
value as RegisterFormType['portfolioType']
)
}
>
<Select.SelectTrigger>
<Select.SelectValue placeholder='포트폴리오 형식' />
</Select.SelectTrigger>
<Select.SelectContent>
<Select.SelectItem value='URL'>URL 형식</Select.SelectItem>
<Select.SelectItem value='PDF'>PDF 파일</Select.SelectItem>
</Select.SelectContent>
</Select>
</InputColumn>
{watch('portfolioType') === 'URL' && (
<InputColumn comment='URL'>
Expand Down

0 comments on commit 5c5952d

Please sign in to comment.