99} from '@boolti/api' ;
1010import { Button , Drawer , ShowPreview , useConfirm , useToast } from '@boolti/ui' ;
1111import { format } from 'date-fns' ;
12- import { useCallback , useEffect , useMemo , useRef , useState } from 'react' ;
12+ import { useCallback , useEffect , useRef , useState } from 'react' ;
1313import { useForm } from 'react-hook-form' ;
1414import { useParams } from 'react-router-dom' ;
1515
@@ -57,21 +57,18 @@ const ShowInfoPage = () => {
5757 const editShowInfoMutation = useEditShowInfo ( ) ;
5858 const uploadShowImageMutation = useUploadShowImage ( ) ;
5959 const isNonTicketingShow = ! showSalesInfo ?. salesEndTime && ! showSalesInfo ?. salesStartTime ;
60-
61- const isSaveButtonDisabled = useMemo (
62- ( ) =>
63- ! showBasicInfoForm . formState . isValid ||
64- ! showDetailInfoForm . formState . isValid ||
65- imageFiles . length === 0 ||
66- ( ! isNonTicketingShow && show ?. isEnded ) ,
67- [
68- imageFiles . length ,
69- isNonTicketingShow ,
70- show ?. isEnded ,
71- showBasicInfoForm . formState . isValid ,
72- showDetailInfoForm . formState . isValid ,
73- ] ,
74- ) ;
60+ // const isFormDisabled = !isNonTicketingShow && show?.isEnded;
61+ const isFormDisabled = false
62+
63+ // const isSaveButtonDisabled = useMemo(
64+ // () =>
65+ // !showBasicInfoForm.formState.isValid ||
66+ // !showDetailInfoForm.formState.isValid ||
67+ // imageFiles.length === 0 ||
68+ // (isFormDisabled),
69+ // [imageFiles.length, isFormDisabled, showBasicInfoForm.formState.isValid, showDetailInfoForm.formState.isValid],
70+ // );
71+ const isSaveButtonDisabled = false
7572
7673 const toast = useToast ( ) ;
7774 const confirm = useConfirm ( ) ;
@@ -92,12 +89,12 @@ const ShowInfoPage = () => {
9289 return await uploadShowImageMutation . mutateAsync ( newImageFiles ) ;
9390 } ) ( ) ;
9491
95- const [ isValidShowBasicInfoFormInputs , isValidShowDetailInfoFormInputs ] = await Promise . all ( [
96- showBasicInfoForm . trigger ( ) ,
97- showDetailInfoForm . trigger ( ) ,
98- ] ) ;
92+ // const [isValidShowBasicInfoFormInputs, isValidShowDetailInfoFormInputs] = await Promise.all([
93+ // showBasicInfoForm.trigger(),
94+ // showDetailInfoForm.trigger(),
95+ // ]);
9996
100- if ( ! isValidShowBasicInfoFormInputs || ! isValidShowDetailInfoFormInputs ) return ;
97+ // if (!isValidShowBasicInfoFormInputs || !isValidShowDetailInfoFormInputs) return;
10198
10299 const showBasicInfoFormInputs = showBasicInfoForm . getValues ( ) ;
103100 const showDetailInfoFormInputs = showDetailInfoForm . getValues ( ) ;
@@ -261,7 +258,7 @@ const ShowInfoPage = () => {
261258 form = { showBasicInfoForm }
262259 imageFiles = { imageFiles }
263260 isNonTicketingShow = { isNonTicketingShow }
264- disabled = { ! isNonTicketingShow && show . isEnded }
261+ disabled = { isFormDisabled }
265262 onDropImage = { ( acceptedFiles ) => {
266263 setImageFiles ( ( prevImageFiles ) => [
267264 ...prevImageFiles ,
@@ -285,7 +282,7 @@ const ShowInfoPage = () => {
285282 < Styled . ShowInfoFormContent style = { { marginBottom : '48px' } } >
286283 < ShowDetailInfoFormContent
287284 form = { showDetailInfoForm }
288- disabled = { ! isNonTicketingShow && show . isEnded }
285+ disabled = { isFormDisabled }
289286 />
290287 </ Styled . ShowInfoFormContent >
291288 < Styled . ShowInfoFormContent >
@@ -406,6 +403,8 @@ const ShowInfoPage = () => {
406403 placeName : showBasicInfoForm . watch ( 'placeName' ) ,
407404 streetAddress : showBasicInfoForm . watch ( 'placeStreetAddress' ) ,
408405 detailAddress : showBasicInfoForm . watch ( 'placeDetailAddress' ) ,
406+ latitude : showBasicInfoForm . watch ( 'latitude' ) ,
407+ longitude : showBasicInfoForm . watch ( 'longitude' ) ,
409408 notice : showDetailInfoForm . watch ( 'notice' ) ,
410409 hostName : showDetailInfoForm . watch ( 'hostName' ) ,
411410 hostPhoneNumber : showDetailInfoForm . watch ( 'hostPhoneNumber' ) ,
0 commit comments