@daeryun/dr_components 0.4.50 → 0.4.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/asset/images/myCase/icon/check box_3.webp +0 -0
  2. package/dist/asset/images/myCase/icon/file.webp +0 -0
  3. package/dist/asset/images/myCase/icon/jpeg.webp +0 -0
  4. package/dist/asset/images/myCase/icon/upload.webp +0 -0
  5. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  6. package/dist/components/common/integrate/index.d.ts +1 -1
  7. package/dist/components/page/MyCase/[id]/_component/MyCaseDetailPageContainer.jsx +1 -1
  8. package/dist/components/page/MyCase/[id]/_component/MyCaseDetailPageContainer.tsx +2 -0
  9. package/dist/components/page/MyCase/[id]/_component/_document/Document.d.ts +3 -1
  10. package/dist/components/page/MyCase/[id]/_component/_document/Document.jsx +3 -1
  11. package/dist/components/page/MyCase/[id]/_component/_document/Document.tsx +13 -1
  12. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.jsx +36 -5
  13. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.tsx +39 -6
  14. package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.d.ts +5 -0
  15. package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.jsx +32 -0
  16. package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.tsx +65 -0
  17. package/dist/components/page/MyCase/[id]/_component/_document/FileUpload.d.ts +10 -0
  18. package/dist/components/page/MyCase/[id]/_component/_document/FileUpload.js +43 -0
  19. package/dist/components/page/MyCase/[id]/_component/_document/FileUpload.ts +38 -0
  20. package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.d.ts +5 -0
  21. package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.jsx +22 -0
  22. package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.tsx +50 -0
  23. package/dist/components/page/MyCase/[id]/_component/_modal/FileUploadModal.d.ts +7 -0
  24. package/dist/components/page/MyCase/[id]/_component/_modal/FileUploadModal.jsx +71 -0
  25. package/dist/components/page/MyCase/[id]/_component/_modal/FileUploadModal.tsx +117 -0
  26. package/dist/components/page/MyCase/_actions/action.d.ts +5 -3
  27. package/dist/components/page/MyCase/_actions/action.js +23 -2
  28. package/dist/components/page/MyCase/_actions/action.ts +25 -6
  29. package/dist/components/page/MyCase/_component/CaseContainer.jsx +1 -3
  30. package/dist/components/page/MyCase/_component/CaseContainer.tsx +4 -9
  31. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenu.jsx +2 -2
  32. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenu.tsx +12 -2
  33. package/dist/components/page/MyCase/_fetchers/addMyFileUpload.d.ts +5 -0
  34. package/dist/components/page/MyCase/_fetchers/addMyFileUpload.js +34 -0
  35. package/dist/components/page/MyCase/_fetchers/addMyFileUpload.ts +27 -0
  36. package/dist/styles/globals.css +276 -177
  37. package/dist/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +2 -1
@@ -0,0 +1,32 @@
1
+ import Image from 'next/image';
2
+ import { useState } from 'react';
3
+ import FileUploadModal from '../_modal/FileUploadModal';
4
+ import FileSuccessModal from '../_modal/FileSuccessModal';
5
+ import FileUpload from './FileUpload';
6
+ import upload from '../../../../../../asset/images/mycase/icon/upload.webp';
7
+ const FileDropZone = ({ id, refetch }) => {
8
+ const [isOpen, setIsOpen] = useState(false);
9
+ const saved = localStorage.getItem('isFileUploadModalCheck');
10
+ const { getRootProps, getInputProps, isSuccess, setIsSuccess } = FileUpload({ id, refetch });
11
+ return (<div className="mb-[40px] mt-[20px] flex w-full items-end justify-end">
12
+ {/* saved가 true일 때만 Dropzone 적용 */}
13
+ {saved ? (<div {...getRootProps()} className="">
14
+ <input {...getInputProps()}/>
15
+ <button className="flex h-[48px] items-center justify-center gap-[16px] rounded-[24px] bg-mycaseMainColor px-[16px] sm-top:h-[60px] sm-top:gap-[28px] sm-top:rounded-[36px] sm-top:px-[26px] lg:gap-[24px] lg:px-[36px]">
16
+ <Image src={upload} alt="file_upload" width={48} height={48} className="h-[16px] w-[16px] sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px] "/>
17
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">파일 제출</p>
18
+ </button>
19
+ </div>) : (<button className="flex h-[48px] items-center justify-center gap-[16px] rounded-[24px] bg-mycaseMainColor px-[16px] sm-top:h-[60px] sm-top:gap-[28px] sm-top:rounded-[36px] sm-top:px-[26px] lg:gap-[24px] lg:px-[36px]" onClick={() => setIsOpen(true)}>
20
+ <Image src={upload} alt="file_upload" width={48} height={48} className="h-[16px] w-[16px] sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px] "/>
21
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">파일 제출</p>
22
+ </button>)}
23
+
24
+ {/* 모달 */}
25
+ <FileUploadModal isOpen={isOpen} onClose={() => setIsOpen(false)} getRootProps={getRootProps} getInputProps={getInputProps}/>
26
+ <FileSuccessModal isOpen={isSuccess} onClose={() => {
27
+ setIsSuccess(false);
28
+ setIsOpen(false);
29
+ }}/>
30
+ </div>);
31
+ };
32
+ export default FileDropZone;
@@ -0,0 +1,65 @@
1
+ import Image from 'next/image';
2
+ import { useState } from 'react';
3
+ import FileUploadModal from '../_modal/FileUploadModal';
4
+ import FileSuccessModal from '../_modal/FileSuccessModal';
5
+ import FileUpload from './FileUpload';
6
+ import upload from '../../../../../../asset/images/mycase/icon/upload.webp';
7
+
8
+ const FileDropZone = ({ id, refetch }: { id: string; refetch: () => void }) => {
9
+ const [isOpen, setIsOpen] = useState(false);
10
+ const saved = localStorage.getItem('isFileUploadModalCheck');
11
+
12
+ const { getRootProps, getInputProps, isSuccess, setIsSuccess } = FileUpload({ id, refetch });
13
+
14
+ return (
15
+ <div className="mb-[40px] mt-[20px] flex w-full items-end justify-end">
16
+ {/* saved가 true일 때만 Dropzone 적용 */}
17
+ {saved ? (
18
+ <div {...getRootProps()} className="">
19
+ <input {...getInputProps()} />
20
+ <button className="flex h-[48px] items-center justify-center gap-[16px] rounded-[24px] bg-mycaseMainColor px-[16px] sm-top:h-[60px] sm-top:gap-[28px] sm-top:rounded-[36px] sm-top:px-[26px] lg:gap-[24px] lg:px-[36px]">
21
+ <Image
22
+ src={upload}
23
+ alt="file_upload"
24
+ width={48}
25
+ height={48}
26
+ className="h-[16px] w-[16px] sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px] "
27
+ />
28
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">파일 제출</p>
29
+ </button>
30
+ </div>
31
+ ) : (
32
+ <button
33
+ className="flex h-[48px] items-center justify-center gap-[16px] rounded-[24px] bg-mycaseMainColor px-[16px] sm-top:h-[60px] sm-top:gap-[28px] sm-top:rounded-[36px] sm-top:px-[26px] lg:gap-[24px] lg:px-[36px]"
34
+ onClick={() => setIsOpen(true)}
35
+ >
36
+ <Image
37
+ src={upload}
38
+ alt="file_upload"
39
+ width={48}
40
+ height={48}
41
+ className="h-[16px] w-[16px] sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px] "
42
+ />
43
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">파일 제출</p>
44
+ </button>
45
+ )}
46
+
47
+ {/* 모달 */}
48
+ <FileUploadModal
49
+ isOpen={isOpen}
50
+ onClose={() => setIsOpen(false)}
51
+ getRootProps={getRootProps}
52
+ getInputProps={getInputProps}
53
+ />
54
+ <FileSuccessModal
55
+ isOpen={isSuccess}
56
+ onClose={() => {
57
+ setIsSuccess(false);
58
+ setIsOpen(false);
59
+ }}
60
+ />
61
+ </div>
62
+ );
63
+ };
64
+
65
+ export default FileDropZone;
@@ -0,0 +1,10 @@
1
+ declare const FileUpload: ({ id, refetch }: {
2
+ id: string;
3
+ refetch: () => void;
4
+ }) => {
5
+ getRootProps: <T extends import("react-dropzone").DropzoneRootProps>(props?: T) => T;
6
+ getInputProps: <T extends import("react-dropzone").DropzoneInputProps>(props?: T) => T;
7
+ isSuccess: boolean;
8
+ setIsSuccess: import("react").Dispatch<import("react").SetStateAction<boolean>>;
9
+ };
10
+ export default FileUpload;
@@ -0,0 +1,43 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { useDropzone } from 'react-dropzone';
11
+ import { useState, useCallback } from 'react';
12
+ import { useActionPostMyFileUpload } from '../../../_actions/action';
13
+ const FileUpload = ({ id, refetch }) => {
14
+ const [uploadedFiles, setUploadedFiles] = useState([]);
15
+ const { mutateAsync, isLoading } = useActionPostMyFileUpload(id);
16
+ const [isSuccess, setIsSuccess] = useState(false);
17
+ const onDrop = useCallback((acceptedFiles) => __awaiter(void 0, void 0, void 0, function* () {
18
+ // setUploadedFiles((prev: File[]) => [...prev, ...acceptedFiles]);
19
+ console.log('test2244442');
20
+ const res = yield mutateAsync(acceptedFiles[0]);
21
+ console.log('res:', res);
22
+ if (res.result) {
23
+ setIsSuccess(res.result);
24
+ if (refetch) {
25
+ refetch();
26
+ }
27
+ }
28
+ }), []);
29
+ const { getRootProps, getInputProps } = useDropzone({
30
+ onDrop,
31
+ accept: {
32
+ 'image/jpeg': ['.jpeg', '.jpg'],
33
+ 'image/png': ['.png'],
34
+ 'application/pdf': ['.pdf'],
35
+ 'application/msword': ['.doc'],
36
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': ['.docx']
37
+ },
38
+ multiple: false,
39
+ maxSize: 10 * 1024 * 1024 // 10MB
40
+ });
41
+ return { getRootProps, getInputProps, isSuccess, setIsSuccess };
42
+ };
43
+ export default FileUpload;
@@ -0,0 +1,38 @@
1
+ import { useDropzone } from 'react-dropzone';
2
+ import { useState, useCallback } from 'react';
3
+ import { useActionPostMyFileUpload } from '../../../_actions/action';
4
+
5
+ const FileUpload = ({ id, refetch }: { id: string; refetch: () => void }) => {
6
+ const [uploadedFiles, setUploadedFiles] = useState<File[]>([]);
7
+ const { mutateAsync, isLoading } = useActionPostMyFileUpload(id);
8
+ const [isSuccess, setIsSuccess] = useState(false);
9
+ const onDrop = useCallback(async (acceptedFiles: File[]) => {
10
+ // setUploadedFiles((prev: File[]) => [...prev, ...acceptedFiles]);
11
+ console.log('test2244442');
12
+ const res = await mutateAsync(acceptedFiles[0]);
13
+ console.log('res:', res);
14
+ if (res.result) {
15
+ setIsSuccess(res.result);
16
+ if (refetch) {
17
+ refetch();
18
+ }
19
+ }
20
+ }, []);
21
+
22
+ const { getRootProps, getInputProps } = useDropzone({
23
+ onDrop,
24
+ accept: {
25
+ 'image/jpeg': ['.jpeg', '.jpg'],
26
+ 'image/png': ['.png'],
27
+ 'application/pdf': ['.pdf'],
28
+ 'application/msword': ['.doc'],
29
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': ['.docx']
30
+ },
31
+ multiple: false,
32
+ maxSize: 10 * 1024 * 1024 // 10MB
33
+ });
34
+
35
+ return { getRootProps, getInputProps, isSuccess, setIsSuccess };
36
+ };
37
+
38
+ export default FileUpload;
@@ -0,0 +1,5 @@
1
+ declare const CaseInquiryConfirmModal: ({ isOpen, onClose, }: {
2
+ isOpen: boolean;
3
+ onClose: () => void;
4
+ }) => import("react").JSX.Element;
5
+ export default CaseInquiryConfirmModal;
@@ -0,0 +1,22 @@
1
+ import Image from 'next/image';
2
+ import ModalContainer from './ModalCotainer';
3
+ const CaseInquiryConfirmModal = ({ isOpen, onClose, }) => {
4
+ // console.log(isLoading);
5
+ return (<ModalContainer isOpen={isOpen} onClose={() => {
6
+ onClose();
7
+ }}>
8
+ <div className="absolute flex w-[calc(100%-40px)] flex-col items-center justify-center overflow-y-auto rounded-[12px] border border-solid border-grayScale4 bg-grayScale8 p-[30px] sm-top:w-[calc(100%-252px)] sm-top:max-w-[648px] sm-top:rounded-[24px] sm-top:px-[54px] sm-top:py-[44px] lg:w-full lg:max-w-[804px] lg:p-[52px] " onClick={e => e.stopPropagation()}>
9
+ <Image src="/images/mycase/icon/modal_icon.webp" alt="check" width={40} height={48.9} className="h-[48.9px] w-[40px] sm-top:h-[68.44px] sm-top:w-[56px] lg:h-[88px] lg:w-[72px]"/>
10
+ <p className="body_large1_mo sm-top:body_large1_tb sm-top: lg:body_large1 mt-[20.11px] sm-top:mt-[48px] lg:mt-[60px]">
11
+ 파일 제출이 완료되었습니다.
12
+ </p>
13
+
14
+ <button className={`mt-[20px] h-[48px] w-full rounded-[4px] bg-grayScale1 sm-top:mt-[53px] sm-top:h-[60px] sm-top:rounded-[8px] lg:mt-[73px] lg:h-[72px] lg:rounded-[16px] `} onClick={() => {
15
+ onClose();
16
+ }}>
17
+ <p className="text-white body_large2_mo sm-top:body_large2_tb lg:body_large2">확인</p>
18
+ </button>
19
+ </div>
20
+ </ModalContainer>);
21
+ };
22
+ export default CaseInquiryConfirmModal;
@@ -0,0 +1,50 @@
1
+ import Image from 'next/image';
2
+ import ModalContainer from './ModalCotainer';
3
+
4
+
5
+ const CaseInquiryConfirmModal = ({
6
+ isOpen,
7
+ onClose,
8
+
9
+ }: {
10
+ isOpen: boolean;
11
+ onClose: () => void;
12
+
13
+ }) => {
14
+ // console.log(isLoading);
15
+ return (
16
+ <ModalContainer
17
+ isOpen={isOpen}
18
+ onClose={() => {
19
+ onClose();
20
+ }}
21
+ >
22
+ <div
23
+ className="absolute flex w-[calc(100%-40px)] flex-col items-center justify-center overflow-y-auto rounded-[12px] border border-solid border-grayScale4 bg-grayScale8 p-[30px] sm-top:w-[calc(100%-252px)] sm-top:max-w-[648px] sm-top:rounded-[24px] sm-top:px-[54px] sm-top:py-[44px] lg:w-full lg:max-w-[804px] lg:p-[52px] "
24
+ onClick={e => e.stopPropagation()}
25
+ >
26
+ <Image
27
+ src="/images/mycase/icon/modal_icon.webp"
28
+ alt="check"
29
+ width={40}
30
+ height={48.9}
31
+ className="h-[48.9px] w-[40px] sm-top:h-[68.44px] sm-top:w-[56px] lg:h-[88px] lg:w-[72px]"
32
+ />
33
+ <p className="body_large1_mo sm-top:body_large1_tb sm-top: lg:body_large1 mt-[20.11px] sm-top:mt-[48px] lg:mt-[60px]">
34
+ 파일 제출이 완료되었습니다.
35
+ </p>
36
+
37
+ <button
38
+ className={`mt-[20px] h-[48px] w-full rounded-[4px] bg-grayScale1 sm-top:mt-[53px] sm-top:h-[60px] sm-top:rounded-[8px] lg:mt-[73px] lg:h-[72px] lg:rounded-[16px] `}
39
+ onClick={() => {
40
+ onClose();
41
+ }}
42
+ >
43
+ <p className="text-white body_large2_mo sm-top:body_large2_tb lg:body_large2">확인</p>
44
+ </button>
45
+ </div>
46
+ </ModalContainer>
47
+ );
48
+ };
49
+
50
+ export default CaseInquiryConfirmModal;
@@ -0,0 +1,7 @@
1
+ declare const FileUploadModal: ({ isOpen, onClose, getRootProps, getInputProps }: {
2
+ isOpen: boolean;
3
+ onClose: () => void;
4
+ getRootProps: any;
5
+ getInputProps: any;
6
+ }) => import("react").JSX.Element;
7
+ export default FileUploadModal;
@@ -0,0 +1,71 @@
1
+ import Image from 'next/image';
2
+ import ModalContainer from './ModalCotainer';
3
+ import file from '../../../../../../asset/images/mycase/icon/file.webp';
4
+ import { useState } from 'react';
5
+ const FileUploadModal = ({ isOpen, onClose, getRootProps, getInputProps }) => {
6
+ const [value, setValue] = useState('');
7
+ const [isCheck, setIsCheck] = useState(false);
8
+ const [isOpenConfirm, setIsOpenConfirm] = useState(false);
9
+ const customClickHandler = (event) => {
10
+ // 체크박스가 선택되었을 경우 localStorage 저장
11
+ if (isCheck) {
12
+ localStorage.setItem('isFileUploadModalCheck', 'true');
13
+ }
14
+ // 🔥 getRootProps()에서 제공하는 onClick 실행
15
+ const { onClick } = getRootProps();
16
+ if (onClick) {
17
+ onClick(event);
18
+ }
19
+ // onClose();
20
+ };
21
+ return (<>
22
+ <ModalContainer isOpen={isOpen} onClose={() => {
23
+ setValue('');
24
+ setIsCheck(false);
25
+ onClose();
26
+ }}>
27
+ <div className={'absolute flex h-full max-h-[317px] w-[calc(100%-40px)] flex-col items-center justify-center overflow-y-auto rounded-[16px] border border-solid border-grayScale4 bg-grayScale8 p-[30px] ' +
28
+ ' sm-top:max-h-[372px] sm-top:w-[644px] sm-top:rounded-[24px] sm-top:px-[52px] sm-top:py-[44px] ' +
29
+ ' lg:h-full lg:max-h-[465px] lg:w-full lg:max-w-[804px] lg:p-[52px]'} onClick={e => e.stopPropagation()}>
30
+ <div className="flex w-full items-center justify-center">
31
+ <Image src={file} alt="upload" width={120} height={120} className="h-[40px] w-[48px] sm-top:h-[50px] sm-top:w-[60px] lg:h-[66.67px] lg:w-[80px]"/>
32
+ </div>
33
+ <p className="body_large1_mo sm-top:body_large1_tb lg:body_large1 mt-[16px] sm-top:mt-[20px] lg:mt-[36.33px]">
34
+ 파일 제출 안내
35
+ </p>
36
+ <div className="body_medium2_mo mt-[12px] text-center sm-top:hidden">
37
+ <p>제출하신 파일은 관리자에게 전달되며,</p>
38
+ <p>제출 후 수정 및 삭제가 불가능합니다.</p>
39
+ <p>필요한 경우 담당자에게 요청해 주세요.</p>
40
+ </div>
41
+ <div className="sm-top:body_medium2_tb flex flex-col items-center justify-center max-sm-top:hidden sm-top:mt-[8px] lg:hidden">
42
+ <p>제출하신 파일은 관리자에게 전달되며, 제출 후 수정 및 삭제가</p>
43
+ <p>불가능합니다. 필요한 경우 담당자에게 요청해 주세요.</p>
44
+ </div>
45
+ <div className="lg:body_medium2 max-lg:hidden lg:mt-[12px] lg:text-center">
46
+ <p>제출하신 파일은 관리자에게 전달되며, 제출 후 수정 및 삭제가 불가능합니다.</p>
47
+ <p>필요한 경우 담당자에게 요청해 주세요.</p>
48
+ </div>
49
+ <div className="mt-[20px] flex w-full items-center justify-center gap-[8px] sm-top:mt-[24px] lg:mt-[28px] lg:gap-[12px]">
50
+ <input type="checkbox" id="agreementCheckbox" checked={isCheck} onChange={() => setIsCheck(!isCheck)} className="h-[12px] w-[12px] sm-top:h-[16px] sm-top:w-[16px] lg:h-[20px] lg:w-[20px]"/>
51
+ <label htmlFor="agreementCheckbox" className="body_small2_mo sm-top:body_small2_tb lg:body_small2 cursor-pointer leading-[20px] text-grayScale3 sm-top:leading-[26px] lg:leading-[28px]">
52
+ 다시 보지 않기
53
+ </label>
54
+ </div>
55
+ <div className="mt-[12px] flex w-full flex-row gap-[4px] sm-top:mt-[16px] sm-top:gap-[12px] lg:mt-[20px] lg:gap-[12px]">
56
+ <button className="h-[48px] w-full rounded-[4px] bg-grayScale7 text-black sm-top:h-[60px] sm-top:rounded-[8px] lg:h-[72px] lg:rounded-[16px]" onClick={() => {
57
+ setIsCheck(false);
58
+ onClose();
59
+ }}>
60
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2">닫기</p>
61
+ </button>
62
+ <div {...getRootProps()} className="flex h-[48px] w-full cursor-pointer items-center justify-center rounded-[4px] bg-grayScale1 text-white sm-top:h-[60px] sm-top:rounded-[8px] lg:h-[72px] lg:rounded-[16px]" onClick={customClickHandler}>
63
+ <input {...getInputProps()}/>
64
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2">확인</p>
65
+ </div>
66
+ </div>
67
+ </div>
68
+ </ModalContainer>
69
+ </>);
70
+ };
71
+ export default FileUploadModal;
@@ -0,0 +1,117 @@
1
+ import Image from 'next/image';
2
+ import ModalContainer from './ModalCotainer';
3
+ import file from '../../../../../../asset/images/mycase/icon/file.webp';
4
+ import { useState } from 'react';
5
+
6
+ const FileUploadModal = ({
7
+ isOpen,
8
+ onClose,
9
+ getRootProps,
10
+ getInputProps
11
+ }: {
12
+ isOpen: boolean;
13
+ onClose: () => void;
14
+ getRootProps: any;
15
+ getInputProps: any;
16
+ }) => {
17
+ const [value, setValue] = useState('');
18
+ const [isCheck, setIsCheck] = useState(false);
19
+ const [isOpenConfirm, setIsOpenConfirm] = useState(false);
20
+
21
+ const customClickHandler = (event: React.MouseEvent<HTMLDivElement>) => {
22
+ // 체크박스가 선택되었을 경우 localStorage 저장
23
+ if (isCheck) {
24
+ localStorage.setItem('isFileUploadModalCheck', 'true');
25
+ }
26
+
27
+ // 🔥 getRootProps()에서 제공하는 onClick 실행
28
+ const { onClick } = getRootProps();
29
+ if (onClick) {
30
+ onClick(event);
31
+ }
32
+ // onClose();
33
+ };
34
+ return (
35
+ <>
36
+ <ModalContainer
37
+ isOpen={isOpen}
38
+ onClose={() => {
39
+ setValue('');
40
+ setIsCheck(false);
41
+ onClose();
42
+ }}
43
+ >
44
+ <div
45
+ className={
46
+ 'absolute flex h-full max-h-[317px] w-[calc(100%-40px)] flex-col items-center justify-center overflow-y-auto rounded-[16px] border border-solid border-grayScale4 bg-grayScale8 p-[30px] ' +
47
+ ' sm-top:max-h-[372px] sm-top:w-[644px] sm-top:rounded-[24px] sm-top:px-[52px] sm-top:py-[44px] ' +
48
+ ' lg:h-full lg:max-h-[465px] lg:w-full lg:max-w-[804px] lg:p-[52px]'
49
+ }
50
+ onClick={e => e.stopPropagation()}
51
+ >
52
+ <div className="flex w-full items-center justify-center">
53
+ <Image
54
+ src={file}
55
+ alt="upload"
56
+ width={120}
57
+ height={120}
58
+ className="h-[40px] w-[48px] sm-top:h-[50px] sm-top:w-[60px] lg:h-[66.67px] lg:w-[80px]"
59
+ />
60
+ </div>
61
+ <p className="body_large1_mo sm-top:body_large1_tb lg:body_large1 mt-[16px] sm-top:mt-[20px] lg:mt-[36.33px]">
62
+ 파일 제출 안내
63
+ </p>
64
+ <div className="body_medium2_mo mt-[12px] text-center sm-top:hidden">
65
+ <p>제출하신 파일은 관리자에게 전달되며,</p>
66
+ <p>제출 후 수정 및 삭제가 불가능합니다.</p>
67
+ <p>필요한 경우 담당자에게 요청해 주세요.</p>
68
+ </div>
69
+ <div className="sm-top:body_medium2_tb flex flex-col items-center justify-center max-sm-top:hidden sm-top:mt-[8px] lg:hidden">
70
+ <p>제출하신 파일은 관리자에게 전달되며, 제출 후 수정 및 삭제가</p>
71
+ <p>불가능합니다. 필요한 경우 담당자에게 요청해 주세요.</p>
72
+ </div>
73
+ <div className="lg:body_medium2 max-lg:hidden lg:mt-[12px] lg:text-center">
74
+ <p>제출하신 파일은 관리자에게 전달되며, 제출 후 수정 및 삭제가 불가능합니다.</p>
75
+ <p>필요한 경우 담당자에게 요청해 주세요.</p>
76
+ </div>
77
+ <div className="mt-[20px] flex w-full items-center justify-center gap-[8px] sm-top:mt-[24px] lg:mt-[28px] lg:gap-[12px]">
78
+ <input
79
+ type="checkbox"
80
+ id="agreementCheckbox"
81
+ checked={isCheck}
82
+ onChange={() => setIsCheck(!isCheck)}
83
+ className="h-[12px] w-[12px] sm-top:h-[16px] sm-top:w-[16px] lg:h-[20px] lg:w-[20px]"
84
+ />
85
+ <label
86
+ htmlFor="agreementCheckbox"
87
+ className="body_small2_mo sm-top:body_small2_tb lg:body_small2 cursor-pointer leading-[20px] text-grayScale3 sm-top:leading-[26px] lg:leading-[28px]"
88
+ >
89
+ 다시 보지 않기
90
+ </label>
91
+ </div>
92
+ <div className="mt-[12px] flex w-full flex-row gap-[4px] sm-top:mt-[16px] sm-top:gap-[12px] lg:mt-[20px] lg:gap-[12px]">
93
+ <button
94
+ className="h-[48px] w-full rounded-[4px] bg-grayScale7 text-black sm-top:h-[60px] sm-top:rounded-[8px] lg:h-[72px] lg:rounded-[16px]"
95
+ onClick={() => {
96
+ setIsCheck(false);
97
+ onClose();
98
+ }}
99
+ >
100
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2">닫기</p>
101
+ </button>
102
+ <div
103
+ {...getRootProps()}
104
+ className="flex h-[48px] w-full cursor-pointer items-center justify-center rounded-[4px] bg-grayScale1 text-white sm-top:h-[60px] sm-top:rounded-[8px] lg:h-[72px] lg:rounded-[16px]"
105
+ onClick={customClickHandler}
106
+ >
107
+ <input {...getInputProps()} />
108
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2">확인</p>
109
+ </div>
110
+ </div>
111
+ </div>
112
+ </ModalContainer>
113
+ </>
114
+ );
115
+ };
116
+
117
+ export default FileUploadModal;
@@ -1,10 +1,8 @@
1
1
  import { FetchType, DetailList, TimeLineType, FileList, Question, PaymentList } from '../_type/type';
2
- export declare const useActionGetCaseList: ({ tapState, state, pageNumber, pageSize, jwt }: {
2
+ export declare const useActionGetCaseList: ({ tapState, pageNumber, pageSize }: {
3
3
  tapState: string;
4
- state: "ongoing" | "closed";
5
4
  pageNumber: number;
6
5
  pageSize: number;
7
- jwt?: string;
8
6
  }) => {
9
7
  data: any;
10
8
  isLoading: boolean;
@@ -38,3 +36,7 @@ export declare const useActionGetContact: (id: string) => {
38
36
  data: FetchType<PaymentList> | undefined;
39
37
  isLoading: boolean;
40
38
  };
39
+ export declare const useActionPostMyFileUpload: (id: string) => {
40
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<FetchType<Question[]>, unknown, File, unknown>;
41
+ isLoading: boolean;
42
+ };
@@ -16,11 +16,16 @@ import getMyCaseQuestion from '../_fetchers/getMyCaseQuestion';
16
16
  import addMyCaseQuestion from '../_fetchers/addMyCaseQuestion';
17
17
  import getCaseList from '../_fetchers/getCaseList';
18
18
  import getContact from '../_fetchers/getContact';
19
+ import addMyFileUpload from '../_fetchers/addMyFileUpload';
19
20
  const jwt2 = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjIsImlhdCI6MTc0MDAxNDYzOCwiZXhwIjoxNzcxNTcyMjM4fQ.11ra7DkzlOVmBqDjo8SJTQnZDZdRHXjjU3ujK8G3OOY';
20
21
  // 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjMsImVtYWlsIjoiNjAzMDgwNEBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzQwNDQ2Nzg1LCJleHAiOjE3NDA0ODI3ODV9.v_d7htci4fjLA5MqBXWxUqyNjsAm2GEcdRBO5se-DB8'; //빈거
21
- export const useActionGetCaseList = ({ tapState, state, pageNumber, pageSize, jwt }) => {
22
+ export const useActionGetCaseList = ({ tapState,
23
+ // state,
24
+ pageNumber, pageSize
25
+ // jwt
26
+ }) => {
22
27
  const { data, isLoading } = useQuery({
23
- queryKey: ['case', tapState, pageNumber, pageSize, state],
28
+ queryKey: ['case', tapState, pageNumber, pageSize],
24
29
  queryFn: () => getCaseList({
25
30
  jwt: jwt2,
26
31
  size: pageSize,
@@ -159,3 +164,19 @@ export const useActionGetContact = (id) => {
159
164
  });
160
165
  return { data, isLoading };
161
166
  };
167
+ export const useActionPostMyFileUpload = (id) => {
168
+ const { mutateAsync, status } = useMutation({
169
+ mutationFn: (file) => __awaiter(void 0, void 0, void 0, function* () {
170
+ return yield addMyFileUpload({
171
+ id: id,
172
+ file: file
173
+ });
174
+ }),
175
+ onSuccess: res => { },
176
+ onError: error => {
177
+ console.log(error);
178
+ }
179
+ });
180
+ const isLoading = status === 'pending';
181
+ return { mutateAsync, isLoading };
182
+ };
@@ -9,6 +9,7 @@ import getMyCaseQuestion from '../_fetchers/getMyCaseQuestion';
9
9
  import addMyCaseQuestion from '../_fetchers/addMyCaseQuestion';
10
10
  import getCaseList from '../_fetchers/getCaseList';
11
11
  import getContact from '../_fetchers/getContact';
12
+ import addMyFileUpload from '../_fetchers/addMyFileUpload';
12
13
 
13
14
  const jwt2 =
14
15
  'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjIsImlhdCI6MTc0MDAxNDYzOCwiZXhwIjoxNzcxNTcyMjM4fQ.11ra7DkzlOVmBqDjo8SJTQnZDZdRHXjjU3ujK8G3OOY';
@@ -16,19 +17,19 @@ const jwt2 =
16
17
 
17
18
  export const useActionGetCaseList = ({
18
19
  tapState,
19
- state,
20
+ // state,
20
21
  pageNumber,
21
- pageSize,
22
- jwt
22
+ pageSize
23
+ // jwt
23
24
  }: {
24
25
  tapState: string;
25
- state: 'ongoing' | 'closed';
26
+ // state: 'ongoing' | 'closed';
26
27
  pageNumber: number;
27
28
  pageSize: number;
28
- jwt?: string;
29
+ // jwt?: string;
29
30
  }) => {
30
31
  const { data, isLoading } = useQuery({
31
- queryKey: ['case', tapState, pageNumber, pageSize, state],
32
+ queryKey: ['case', tapState, pageNumber, pageSize],
32
33
  queryFn: () =>
33
34
  getCaseList({
34
35
  jwt: jwt2,
@@ -183,3 +184,21 @@ export const useActionGetContact = (id: string) => {
183
184
  });
184
185
  return { data, isLoading };
185
186
  };
187
+
188
+ export const useActionPostMyFileUpload = (id: string) => {
189
+ const { mutateAsync, status } = useMutation<FetchType<Question[]>, unknown, File>({
190
+ mutationFn: async (file: File) =>
191
+ await addMyFileUpload({
192
+ id: id as string,
193
+ file: file
194
+ }),
195
+
196
+ onSuccess: res => {},
197
+ onError: error => {
198
+ console.log(error);
199
+ }
200
+ });
201
+
202
+ const isLoading = status === 'pending';
203
+ return { mutateAsync, isLoading };
204
+ };
@@ -36,10 +36,8 @@ const CaseContainer = ({ jwt }) => {
36
36
  // };
37
37
  const { data, isLoading } = useActionGetCaseList({
38
38
  tapState,
39
- state: tapState === 'ongoing' ? 'ongoing' : 'closed',
40
39
  pageNumber,
41
- pageSize,
42
- jwt
40
+ pageSize
43
41
  });
44
42
  // useEffect(() => {
45
43
  // const handleResize = () => {
@@ -1,10 +1,6 @@
1
- import { useEffect, useState, Suspense } from 'react';
1
+ import { useState, Suspense } from 'react';
2
2
  import CaseLayout from './_layout/CaseLayout';
3
- import SubColor1Button from './_button/SubColor1Button';
4
- import { useQuery } from 'react-query';
5
- import getCaseList from '../_fetchers/getCaseList';
6
- import CaseTable from './_table/CaseTable';
7
- import { Case } from '../_type/type';
3
+
8
4
  import EmptyTable from './_empty/EmptyTable';
9
5
  import { useRouter, useSearchParams } from 'next/navigation';
10
6
  import Loading from './_loading/Loading';
@@ -63,10 +59,9 @@ const CaseContainer = ({ jwt }: { jwt?: string }) => {
63
59
 
64
60
  const { data, isLoading } = useActionGetCaseList({
65
61
  tapState,
66
- state: tapState === 'ongoing' ? 'ongoing' : 'closed',
62
+
67
63
  pageNumber,
68
- pageSize,
69
- jwt
64
+ pageSize
70
65
  });
71
66
  // useEffect(() => {
72
67
  // const handleResize = () => {
@@ -32,12 +32,12 @@ const CategoryMenu = (props) => {
32
32
  <Image src={imagePath} alt={'집'} width={15} height={15} className={'mb-[1px] h-auto sm:w-[17px] lg:w-[18px]'}/>
33
33
  </Link>
34
34
  <Image src={arrowImage} alt={'화살표_1'} width={8} height={13} className={'h-[13px] w-[8px]'}/>
35
- {menu.title === menu.subTitle ? (<Link href={`/${menu.address}`} onClick={() => reloadUrl(`/${menu.address}`)}>
35
+ {menu.title === menu.subTitle ? (<Link href={menu.address ? `/${menu.address}`.replace(/^\/+/, '') : '/'} onClick={() => menu.address && reloadUrl(menu.address.startsWith('/') ? menu.address : `/${menu.address}`)}>
36
36
  <div className={textColor}>{menu === null || menu === void 0 ? void 0 : menu.title}</div>
37
37
  </Link>) : (<>
38
38
  <div className={textColor}>{menu === null || menu === void 0 ? void 0 : menu.title}</div>
39
39
  <Image src={arrowImage} alt={'화살표_2'} width={8} height={13} className={'h-[13px] w-[8px]'}/>
40
- <Link href={`/${menu.address}`} onClick={() => reloadUrl(`/${menu.address}`)}>
40
+ <Link href={menu.address ? `/${menu.address}`.replace(/^\/+/, '') : '/'} onClick={() => menu.address && reloadUrl(menu.address.startsWith('/') ? menu.address : `/${menu.address}`)}>
41
41
  <div className={textColor}>{menu === null || menu === void 0 ? void 0 : menu.subTitle}</div>
42
42
  </Link>
43
43
  </>)}