updated
This commit is contained in:
		| @@ -41,32 +41,32 @@ type FileUploadProps = { | ||||
|   children?: ReactNode | ||||
| } | ||||
|  | ||||
| const FileUpload = (props: FileUploadProps) => { | ||||
|   const { register, accept, multiple, children } = props | ||||
|   const inputRef = useRef<HTMLInputElement | null>(null) | ||||
|   const { ref, ...rest } = register as { ref: (instance: HTMLInputElement | null) => void } | ||||
| // const FileUpload = (props: FileUploadProps) => { | ||||
| //   const { register, accept, multiple, children } = props | ||||
| //   const inputRef = useRef<HTMLInputElement | null>(null) | ||||
| //   const { ref, ...rest } = register as { ref: (instance: HTMLInputElement | null) => void } | ||||
|  | ||||
|   const handleClick = () => inputRef.current?.click() | ||||
| //   const handleClick = () => inputRef.current?.click() | ||||
|  | ||||
|   return ( | ||||
|     <InputGroup onClick={handleClick}> | ||||
|       <input | ||||
|         type={'file'} | ||||
|         multiple={multiple || false} | ||||
|         hidden | ||||
|         accept={accept} | ||||
|         {...rest} | ||||
|         ref={(e) => { | ||||
|           ref(e) | ||||
|           inputRef.current = e | ||||
|         }} | ||||
|       /> | ||||
|       <> | ||||
|         {children} | ||||
|       </> | ||||
|     </InputGroup> | ||||
|   ) | ||||
| } | ||||
| //   return ( | ||||
| //     <InputGroup onClick={handleClick}> | ||||
| //       <input | ||||
| //         type={'file'} | ||||
| //         multiple={multiple || false} | ||||
| //         hidden | ||||
| //         accept={accept} | ||||
| //         {...rest} | ||||
| //         ref={(e) => { | ||||
| //           ref(e) | ||||
| //           inputRef.current = e | ||||
| //         }} | ||||
| //       /> | ||||
| //       <> | ||||
| //         {children} | ||||
| //       </> | ||||
| //     </InputGroup> | ||||
| //   ) | ||||
| // } | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -104,9 +104,9 @@ const AddAboutUs = ({ isOpen, onClose }: AddAboutUsProps) => { | ||||
|   } | ||||
|  | ||||
|  | ||||
|   type FormValues = { | ||||
|     file_: FileList | ||||
|   } | ||||
|   // type FormValues = { | ||||
|   //   file_: FileList | ||||
|   // } | ||||
|  | ||||
|  | ||||
|   const mutation = useMutation({ | ||||
|   | ||||
| @@ -46,32 +46,32 @@ type FileUploadProps = { | ||||
|     children?: ReactNode | ||||
| } | ||||
|  | ||||
| const FileUpload = (props: FileUploadProps) => { | ||||
|     const { register, accept, multiple, children } = props | ||||
|     const inputRef = useRef<HTMLInputElement | null>(null) | ||||
|     const { ref, ...rest } = register as { ref: (instance: HTMLInputElement | null) => void } | ||||
| // const FileUpload = (props: FileUploadProps) => { | ||||
| //     const { register, accept, multiple, children } = props | ||||
| //     const inputRef = useRef<HTMLInputElement | null>(null) | ||||
| //     const { ref, ...rest } = register as { ref: (instance: HTMLInputElement | null) => void } | ||||
|  | ||||
|     const handleClick = () => inputRef.current?.click() | ||||
| //     const handleClick = () => inputRef.current?.click() | ||||
|  | ||||
|     return ( | ||||
|         <InputGroup onClick={handleClick}> | ||||
|             <input | ||||
|                 type={'file'} | ||||
|                 multiple={multiple || false} | ||||
|                 hidden | ||||
|                 accept={accept} | ||||
|                 {...rest} | ||||
|                 ref={(e) => { | ||||
|                     ref(e) | ||||
|                     inputRef.current = e | ||||
|                 }} | ||||
|             /> | ||||
|             <> | ||||
|                 {children} | ||||
|             </> | ||||
|         </InputGroup> | ||||
|     ) | ||||
| } | ||||
| //     return ( | ||||
| //         <InputGroup onClick={handleClick}> | ||||
| //             <input | ||||
| //                 type={'file'} | ||||
| //                 multiple={multiple || false} | ||||
| //                 hidden | ||||
| //                 accept={accept} | ||||
| //                 {...rest} | ||||
| //                 ref={(e) => { | ||||
| //                     ref(e) | ||||
| //                     inputRef.current = e | ||||
| //                 }} | ||||
| //             /> | ||||
| //             <> | ||||
| //                 {children} | ||||
| //             </> | ||||
| //         </InputGroup> | ||||
| //     ) | ||||
| // } | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -118,9 +118,9 @@ const EditAboutUs = ({ aboutUs, isOpen, onClose }: EditAboutUsProps) => { | ||||
|     } | ||||
|  | ||||
|  | ||||
|     type FormValues = { | ||||
|         file_: FileList | ||||
|     } | ||||
|     // type FormValues = { | ||||
|     //     file_: FileList | ||||
|     // } | ||||
|  | ||||
|  | ||||
|     const mutation = useMutation({ | ||||
|   | ||||
| @@ -54,7 +54,6 @@ const CourseDetails = () => { | ||||
|         reset, | ||||
|         getValues, | ||||
|         setValue, | ||||
|         unregister, | ||||
|         formState: { isSubmitting, errors, isDirty }, | ||||
|     } = useForm<CourseCreate>({ | ||||
|         mode: "onBlur", | ||||
|   | ||||
| @@ -44,7 +44,6 @@ const CourseImages = () => { | ||||
|         reset, | ||||
|         getValues, | ||||
|         setValue, | ||||
|         unregister, | ||||
|         formState: { isSubmitting, errors, isDirty }, | ||||
|     } = useForm<ImageCreate>({ | ||||
|         mode: "onBlur", | ||||
|   | ||||
| @@ -39,9 +39,7 @@ const CourseInfoImages = () => { | ||||
|         register, | ||||
|         handleSubmit, | ||||
|         reset, | ||||
|         getValues, | ||||
|         setValue, | ||||
|         unregister, | ||||
|         formState: { isSubmitting, errors, isDirty }, | ||||
|     } = useForm<ImageCreate>({ | ||||
|         mode: "onBlur", | ||||
|   | ||||
| @@ -29,7 +29,7 @@ interface EditItemProps { | ||||
|     type: string | ||||
| } | ||||
|  | ||||
| const EditSechedule = ({ sechedule, type, isOpen, onClose }: EditItemProps) => { | ||||
| const EditSechedule = ({ sechedule, isOpen, onClose }: EditItemProps) => { | ||||
|     const queryClient = useQueryClient() | ||||
|     const showToast = useCustomToast() | ||||
|     const { | ||||
| @@ -38,7 +38,7 @@ const EditSechedule = ({ sechedule, type, isOpen, onClose }: EditItemProps) => { | ||||
|         reset, | ||||
|         setValue, | ||||
|         getValues, | ||||
|         formState: { isSubmitting, errors, isDirty }, | ||||
|         formState: { isSubmitting, errors }, | ||||
|     } = useForm<ScheduleUpdate>({ | ||||
|         mode: "onBlur", | ||||
|         criteriaMode: "all", | ||||
|   | ||||
| @@ -10,7 +10,6 @@ import { | ||||
| } from "@chakra-ui/react" | ||||
| import moment from 'moment'; | ||||
| import {  useQueryClient,  } from "@tanstack/react-query" | ||||
| import useCustomToast from "../../hooks/useCustomToast" | ||||
| import { CourseDetailsPublic } from "../../client" | ||||
| import ActionsMenu from "../../components/Common/ActionsMenu" | ||||
| import 'react-datetime-picker/dist/DateTimePicker.css'; | ||||
| @@ -21,7 +20,7 @@ const Sechedule = () => { | ||||
|     const queryClient = useQueryClient(); | ||||
|     const courseDetails = queryClient.getQueryData(['course']) as CourseDetailsPublic | undefined; | ||||
|  | ||||
|     const showToast = useCustomToast() | ||||
|   //  const showToast = useCustomToast() | ||||
|  | ||||
|     return ( | ||||
|         <Container maxW="full"> | ||||
| @@ -38,7 +37,7 @@ const Sechedule = () => { | ||||
|                         </Tr> | ||||
|                     </Thead> | ||||
|                     <Tbody> | ||||
|                         {courseDetails?.schedule?.map((schedule, index) => ( | ||||
|                         {courseDetails?.schedule?.map((schedule) => ( | ||||
|                             <Tr key={schedule.id}> | ||||
|                                 <Td maxWidth="20px"> | ||||
|                                     {moment(schedule.date).utcOffset("+08:00").format('DD-MM-YYYY HH:mm')} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user