@@ -20,9 +20,10 @@ 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 ( ) ;
25-
26+
2627 useEffect ( ( ) => {
2728 console . log ( data ?. result . bannerImageUrl )
2829 if ( data ?. result ) {
@@ -68,16 +69,29 @@ const EventDetailPage = () => {
6869 } ) ;
6970 } ;
7071
72+ const handleLinkValidation = ( valid : boolean ) => {
73+ setIsLinkValid ( valid ) ;
74+ } ;
75+
7176 return (
7277 < DashboardLayout centerContent = "DASHBOARD" >
7378 < div className = "flex flex-col gap-5 mt-8 px-7" >
7479 < h1 className = "text-center text-xl font-bold mb-5" > 이벤트 상세 정보</ h1 >
7580 < FileUpload value = { bannerImageUrl } onChange = { setBannerImageUrl } useDefaultImage = { false } />
76- < TextEditor value = { description } onChange = { setDescription } />
77- < LinkInput value = { referenceLinks } onChange = { setReferenceLinks } />
81+ < TextEditor value = { description } onChange = { setDescription } />
82+ < LinkInput
83+ value = { referenceLinks }
84+ onChange = { setReferenceLinks }
85+ onValidationChange = { handleLinkValidation }
86+ />
7887 </ div >
7988 < div className = "w-full p-7" >
80- < Button label = "저장하기" onClick = { handleSave } className = "w-full h-12 rounded-full" />
89+ < Button
90+ label = "저장하기"
91+ onClick = { handleSave }
92+ className = "w-full h-12 rounded-full"
93+ disabled = { ! isLinkValid }
94+ />
8195 </ div >
8296 </ DashboardLayout >
8397 ) ;
0 commit comments