@@ -8,16 +8,27 @@ import CustomButton from "../Common/CustomButton";
88
99const cx = className . bind ( style ) ;
1010
11- const RegisterItemForm = ( { } ) => {
11+ const RegisterItemForm = ( {
12+ price, material, name, information, mode,
13+ setPrice, setMaterial, setName, setInformation,
14+ registerItem, openRegistrationForm
15+ } ) => {
16+
17+
1218 return (
13- < form className = { cx ( 'registerItemForm-form' ) } >
19+ < form
20+ className = { cx ( 'registerItemForm-form' ) }
21+ action = { "#" }
22+ onSubmit = { ( ) => registerItem ( mode , name , material , price , information ) }
23+ >
1424 < div className = { cx ( 'registerItemForm-leftPage' ) } >
1525 < div className = { cx ( 'registerItemForm-registerRow' ) } >
1626 < Typography variant = { "h6" } > 제품 이름 </ Typography >
1727 < Select
1828 style = { { width : "50%" } }
19- value = { '와이셔츠' }
29+ value = { name }
2030 defaultValue = { '와이셔츠' }
31+ onChange = { ( e ) => setName ( e . target . value ) }
2132 >
2233 < MenuItem value = { '와이셔츠' } > 와이셔츠</ MenuItem >
2334 < MenuItem value = { '청바지' } > 청바지</ MenuItem >
@@ -27,23 +38,34 @@ const RegisterItemForm = ({}) => {
2738 < Typography variant = { "h6" } > 제품 소재 </ Typography >
2839 < Select
2940 style = { { width : "50%" } }
30- value = { '와이셔츠' }
41+ value = { material }
3142 defaultValue = { '와이셔츠' }
43+ onChange = { ( e ) => setMaterial ( e . target . value ) }
3244 >
3345 < MenuItem value = { '와이셔츠' } > 와이셔츠</ MenuItem >
3446 < MenuItem value = { '청바지' } > 청바지</ MenuItem >
3547 </ Select >
3648 </ div >
3749 < div className = { cx ( 'registerItemForm-registerRow' ) } >
3850 < Typography variant = { "h6" } > 제품 가격 </ Typography >
39- < CustomInput className = { cx ( 'registerItemForm-priceInput' ) } />
51+ < CustomInput
52+ className = { cx ( 'registerItemForm-priceInput' ) }
53+ value = { price }
54+ onChangeEvent = { setPrice }
55+ required = { true }
56+ />
4057 </ div >
4158 </ div >
4259 < div className = { cx ( 'registerItemForm-rightPage' ) } >
4360 < Typography variant = { "h6" } > 제품 특이사항 </ Typography >
44- < textarea className = { cx ( 'registerItemForm-etcText' ) } />
61+ < textarea
62+ className = { cx ( 'registerItemForm-etcText' ) }
63+ value = { information }
64+ onChange = { ( e ) => setInformation ( e . target . value ) }
65+ required = { true }
66+ />
4567 < CustomButton
46- type = { 'submmit ' }
68+ type = { 'submit ' }
4769 value = { '제출하기' }
4870 className = { cx ( 'registerItemForm-submitBtn' ) }
4971 />
0 commit comments