File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed
Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ const EventDetailPage = () => {
2020 const [ bannerImageUrl , setBannerImageUrl ] = useState ( '' ) ;
2121 const [ description , setDescription ] = useState ( '' ) ;
2222 const [ referenceLinks , setReferenceLinks ] = useState < Link [ ] > ( [ ] ) ;
23+ const [ isLinkValid , setIsLinkValid ] = useState ( true ) ;
2324
2425 const queryClient = useQueryClient ( ) ;
2526
@@ -67,16 +68,29 @@ const EventDetailPage = () => {
6768 } ) ;
6869 } ;
6970
71+ const handleLinkValidation = ( valid : boolean ) => {
72+ setIsLinkValid ( valid ) ;
73+ } ;
74+
7075 return (
7176 < DashboardLayout centerContent = "DASHBOARD" >
7277 < div className = "flex flex-col gap-5 mt-8 px-7" >
7378 < h1 className = "text-center text-xl font-bold mb-5" > 이벤트 상세 정보</ h1 >
7479 < FileUpload value = { bannerImageUrl } onChange = { setBannerImageUrl } useDefaultImage = { false } />
7580 < TextEditor value = { description } onChange = { setDescription } />
76- < LinkInput value = { referenceLinks } onChange = { setReferenceLinks } />
81+ < LinkInput
82+ value = { referenceLinks }
83+ onChange = { setReferenceLinks }
84+ onValidationChange = { handleLinkValidation }
85+ />
7786 </ div >
7887 < div className = "w-full p-7" >
79- < Button label = "저장하기" onClick = { handleSave } className = "w-full h-12 rounded-full" />
88+ < Button
89+ label = "저장하기"
90+ onClick = { handleSave }
91+ className = "w-full h-12 rounded-full"
92+ disabled = { ! isLinkValid }
93+ />
8094 </ div >
8195 </ DashboardLayout >
8296 ) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const EventInfoPage = ({ onValidationChange }: EventInfoPageProps) => {
1212 const { eventState, setEventState } = useFunnelState ( ) ;
1313 const [ isFileValid , setIsFileValid ] = useState ( false ) ;
1414 const [ isTextValid , setIsTextValid ] = useState ( false ) ;
15- const [ isLinkValid , setIsLinkValid ] = useState ( false ) ;
15+ const [ isLinkValid , setIsLinkValid ] = useState ( true ) ;
1616
1717 const handleFileValidation = ( valid : boolean ) => {
1818 setIsFileValid ( valid ) ;
@@ -46,7 +46,12 @@ const EventInfoPage = ({ onValidationChange }: EventInfoPageProps) => {
4646 setEventState = { setEventState }
4747 onValidationChange = { handleTextValidation }
4848 />
49- < LinkInput eventState = { eventState } setEventState = { setEventState } onValidationChange = { handleLinkValidation } />
49+ < LinkInput
50+ eventState = { eventState }
51+ setEventState = { setEventState }
52+ onValidationChange = { handleLinkValidation }
53+ value = { eventState ?. referenceLinks }
54+ />
5055 </ div >
5156 ) ;
5257} ;
You can’t perform that action at this time.
0 commit comments