@@ -7,19 +7,17 @@ import { LostItem, LostItemHandler } from 'pages/Articles/hooks/useLostItemForm'
7
7
import useBooleanState from 'utils/hooks/state/useBooleanState' ;
8
8
import { useEscapeKeyDown } from 'utils/hooks/ui/useEscapeKeyDown' ;
9
9
import { useOutsideClick } from 'utils/hooks/ui/useOutsideClick' ;
10
- import { FindUserCategory , useArticlesLogger } from 'pages/Articles/hooks/useArticlesLogger' ;
11
10
import FormImage from 'pages/Articles/components/FormImage' ;
12
11
import FormContent from 'pages/Articles/components/FormContent' ;
13
12
import FormFoundPlace from 'pages/Articles/components/FormFoundPlace' ;
13
+ import FormCategory from 'pages/Articles/components/FormCategory' ;
14
14
import styles from './LostItemForm.module.scss' ;
15
15
16
16
const MAX_LOST_ITEM_TYPE = {
17
17
found : '습득물' ,
18
18
lost : '분실물' ,
19
19
} ;
20
20
21
- const CATEGORIES : FindUserCategory [ ] = [ '카드' , '신분증' , '지갑' , '전자제품' , '그 외' ] ;
22
-
23
21
const getyyyyMMdd = ( date : Date ) => {
24
22
const yyyy = date . getFullYear ( ) ;
25
23
const MM = String ( date . getMonth ( ) + 1 ) . padStart ( 2 , '0' ) ;
@@ -59,12 +57,6 @@ export default function LostItemForm({
59
57
} = lostItemHandler ;
60
58
61
59
const [ calendarOpen , , closeCalendar , toggleCalendar ] = useBooleanState ( false ) ;
62
- const { logFindUserCategory } = useArticlesLogger ( ) ;
63
-
64
- const handleCategoryClick = ( item : FindUserCategory ) => {
65
- logFindUserCategory ( item ) ;
66
- setCategory ( item ) ;
67
- } ;
68
60
69
61
const handleDateSelect = ( date : Date ) => {
70
62
setFoundDate ( date ) ;
@@ -94,38 +86,12 @@ export default function LostItemForm({
94
86
</ div >
95
87
< div className = { styles . template } >
96
88
< div className = { `${ styles . template__left } ${ styles . left } ` } >
97
- < div className = { styles . category } >
98
- < div className = { styles . category__text } >
99
- < span className = { styles . title } > 품목</ span >
100
- < span className = { styles . title__description } > 품목을 선택해주세요.</ span >
101
- </ div >
102
- < div className = { styles . category__wrapper } >
103
- < div className = { styles . category__buttons } >
104
- { CATEGORIES . map ( ( item ) => (
105
- < button
106
- key = { item }
107
- type = "button"
108
- className = { cn ( {
109
- [ styles . category__button ] : true ,
110
- [ styles [ 'category__button--selected' ] ] : category === item ,
111
- } ) }
112
- onClick = { ( ) => handleCategoryClick ( item as FindUserCategory ) }
113
- >
114
- { item }
115
- </ button >
116
- ) ) }
117
- </ div >
118
- { ! isCategorySelected && (
119
- < span className = { styles . warning } >
120
- < WarnIcon />
121
- 품목이 선택되지 않았습니다.
122
- </ span >
123
- ) }
124
- </ div >
125
- </ div >
126
- < div
127
- className = { styles . date }
128
- >
89
+ < FormCategory
90
+ category = { category }
91
+ setCategory = { setCategory }
92
+ isCategorySelected = { isCategorySelected }
93
+ />
94
+ < div className = { styles . date } >
129
95
< span className = { styles . title } > 습득 일자</ span >
130
96
< div className = { styles . date__wrapper } ref = { containerRef } >
131
97
< div className = { styles . date__wrapper } >
0 commit comments