@daeryun/dr_components 0.2.98 → 0.3.0
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.
- package/dist/components/myCase/MyCase.d.ts +5 -0
- package/dist/components/myCase/MyCase.jsx +27 -0
- package/dist/components/myCase/MyCase.tsx +48 -0
- package/dist/components/page/MyCase/MyCase.stories.d.ts +6 -0
- package/dist/components/page/MyCase/MyCase.stories.jsx +17 -0
- package/dist/components/page/MyCase/MyCase.stories.tsx +25 -0
- package/dist/components/page/MyCase/MyCaseApp.d.ts +2 -0
- package/dist/components/page/MyCase/MyCaseApp.jsx +19 -0
- package/dist/components/page/MyCase/MyCaseApp.tsx +32 -0
- package/dist/components/page/MyCase/MyCasePage.d.ts +3 -0
- package/dist/components/page/MyCase/MyCasePage.jsx +21 -0
- package/dist/components/page/MyCase/MyCasePage.tsx +32 -0
- package/dist/components/page/MyCase/[id]/MyCaseDetail.stories.d.ts +6 -0
- package/dist/components/page/MyCase/[id]/MyCaseDetail.stories.jsx +17 -0
- package/dist/components/page/MyCase/[id]/MyCaseDetail.stories.tsx +25 -0
- package/dist/components/page/MyCase/[id]/MyCaseDetailApp.d.ts +3 -0
- package/dist/components/page/MyCase/[id]/MyCaseDetailApp.jsx +66 -0
- package/dist/components/page/MyCase/[id]/MyCaseDetailApp.tsx +159 -0
- package/dist/components/page/MyCase/[id]/MyCaseDetailPage.d.ts +3 -0
- package/dist/components/page/MyCase/[id]/MyCaseDetailPage.jsx +65 -0
- package/dist/components/page/MyCase/[id]/MyCaseDetailPage.tsx +157 -0
- package/dist/components/page/MyCase/[id]/_component/ContactInfo.d.ts +2 -0
- package/dist/components/page/MyCase/[id]/_component/ContactInfo.jsx +79 -0
- package/dist/components/page/MyCase/[id]/_component/ContactInfo.tsx +102 -0
- package/dist/components/page/MyCase/[id]/_component/DetailInfo.d.ts +6 -0
- package/dist/components/page/MyCase/[id]/_component/DetailInfo.jsx +44 -0
- package/dist/components/page/MyCase/[id]/_component/DetailInfo.tsx +94 -0
- package/dist/components/page/MyCase/[id]/_component/TimeLine.d.ts +6 -0
- package/dist/components/page/MyCase/[id]/_component/TimeLine.jsx +46 -0
- package/dist/components/page/MyCase/[id]/_component/TimeLine.tsx +72 -0
- package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.d.ts +11 -0
- package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.jsx +80 -0
- package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.tsx +188 -0
- package/dist/components/page/MyCase/[id]/_component/_document/Document.d.ts +6 -0
- package/dist/components/page/MyCase/[id]/_component/_document/Document.jsx +35 -0
- package/dist/components/page/MyCase/[id]/_component/_document/Document.tsx +59 -0
- package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.d.ts +6 -0
- package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.jsx +76 -0
- package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.tsx +94 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryAddModal.d.ts +7 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryAddModal.jsx +107 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryAddModal.tsx +150 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryConfirmModal.d.ts +7 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryConfirmModal.jsx +25 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryConfirmModal.tsx +55 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/ModalCotainer.d.ts +7 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/ModalCotainer.jsx +26 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/ModalCotainer.tsx +39 -0
- package/dist/components/page/MyCase/[id]/_component/_textarea/TextArea.d.ts +7 -0
- package/dist/components/page/MyCase/[id]/_component/_textarea/TextArea.jsx +4 -0
- package/dist/components/page/MyCase/[id]/_component/_textarea/TextArea.tsx +24 -0
- package/dist/components/page/MyCase/_actions/action.d.ts +35 -0
- package/dist/components/page/MyCase/_actions/action.js +145 -0
- package/dist/components/page/MyCase/_actions/action.ts +165 -0
- package/dist/components/page/MyCase/_component/CaseAppContainer.d.ts +2 -0
- package/dist/components/page/MyCase/_component/CaseAppContainer.jsx +117 -0
- package/dist/components/page/MyCase/_component/CaseAppContainer.tsx +255 -0
- package/dist/components/page/MyCase/_component/CasePageContainer.d.ts +2 -0
- package/dist/components/page/MyCase/_component/CasePageContainer.jsx +106 -0
- package/dist/components/page/MyCase/_component/CasePageContainer.tsx +244 -0
- package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuApp.d.ts +7 -0
- package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuApp.jsx +47 -0
- package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuApp.tsx +77 -0
- package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuPage.d.ts +8 -0
- package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuPage.jsx +47 -0
- package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuPage.tsx +77 -0
- package/dist/components/page/MyCase/_component/_button/Badge.d.ts +14 -0
- package/dist/components/page/MyCase/_component/_button/Badge.jsx +16 -0
- package/dist/components/page/MyCase/_component/_button/Badge.tsx +22 -0
- package/dist/components/page/MyCase/_component/_button/SubColor1Button.d.ts +7 -0
- package/dist/components/page/MyCase/_component/_button/SubColor1Button.jsx +9 -0
- package/dist/components/page/MyCase/_component/_button/SubColor1Button.tsx +33 -0
- package/dist/components/page/MyCase/_component/_button/SubMenuButton.d.ts +7 -0
- package/dist/components/page/MyCase/_component/_button/SubMenuButton.jsx +9 -0
- package/dist/components/page/MyCase/_component/_button/SubMenuButton.tsx +31 -0
- package/dist/components/page/MyCase/_component/_empty/EmptyTable.d.ts +6 -0
- package/dist/components/page/MyCase/_component/_empty/EmptyTable.jsx +75 -0
- package/dist/components/page/MyCase/_component/_empty/EmptyTable.tsx +85 -0
- package/dist/components/page/MyCase/_component/_layout/CaseLayout.d.ts +7 -0
- package/dist/components/page/MyCase/_component/_layout/CaseLayout.jsx +11 -0
- package/dist/components/page/MyCase/_component/_layout/CaseLayout.tsx +29 -0
- package/dist/components/page/MyCase/_component/_layout/CaseWrapper.d.ts +12 -0
- package/dist/components/page/MyCase/_component/_layout/CaseWrapper.jsx +25 -0
- package/dist/components/page/MyCase/_component/_layout/CaseWrapper.tsx +41 -0
- package/dist/components/page/MyCase/_component/_layout/HeaderLayout.d.ts +4 -0
- package/dist/components/page/MyCase/_component/_layout/HeaderLayout.jsx +4 -0
- package/dist/components/page/MyCase/_component/_layout/HeaderLayout.tsx +5 -0
- package/dist/components/page/MyCase/_component/_layout/IntroAppWrapper.d.ts +10 -0
- package/dist/components/page/MyCase/_component/_layout/IntroAppWrapper.jsx +29 -0
- package/dist/components/page/MyCase/_component/_layout/IntroAppWrapper.tsx +80 -0
- package/dist/components/page/MyCase/_component/_layout/IntroPageWrapper.d.ts +10 -0
- package/dist/components/page/MyCase/_component/_layout/IntroPageWrapper.jsx +31 -0
- package/dist/components/page/MyCase/_component/_layout/IntroPageWrapper.tsx +81 -0
- package/dist/components/page/MyCase/_component/_loading/Loading.d.ts +2 -0
- package/dist/components/page/MyCase/_component/_loading/Loading.jsx +89 -0
- package/dist/components/page/MyCase/_component/_loading/Loading.tsx +92 -0
- package/dist/components/page/MyCase/_component/_pagination/PaginationComponentApp.d.ts +10 -0
- package/dist/components/page/MyCase/_component/_pagination/PaginationComponentApp.jsx +82 -0
- package/dist/components/page/MyCase/_component/_pagination/PaginationComponentApp.tsx +137 -0
- package/dist/components/page/MyCase/_component/_pagination/PaginationComponentPage.d.ts +10 -0
- package/dist/components/page/MyCase/_component/_pagination/PaginationComponentPage.jsx +81 -0
- package/dist/components/page/MyCase/_component/_pagination/PaginationComponentPage.tsx +135 -0
- package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.d.ts +9 -0
- package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.jsx +65 -0
- package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.tsx +79 -0
- package/dist/components/page/MyCase/_component/_table/CaseTable.d.ts +9 -0
- package/dist/components/page/MyCase/_component/_table/CaseTable.jsx +63 -0
- package/dist/components/page/MyCase/_component/_table/CaseTable.tsx +94 -0
- package/dist/components/page/MyCase/_component/_table/CaseTableMo.d.ts +9 -0
- package/dist/components/page/MyCase/_component/_table/CaseTableMo.jsx +11 -0
- package/dist/components/page/MyCase/_component/_table/CaseTableMo.tsx +28 -0
- package/dist/components/page/MyCase/_component/_table/CaseTableMoBox.d.ts +5 -0
- package/dist/components/page/MyCase/_component/_table/CaseTableMoBox.jsx +35 -0
- package/dist/components/page/MyCase/_component/_table/CaseTableMoBox.tsx +43 -0
- package/dist/components/page/MyCase/_component/_table/CaseTableMoPage.d.ts +9 -0
- package/dist/components/page/MyCase/_component/_table/CaseTableMoPage.jsx +11 -0
- package/dist/components/page/MyCase/_component/_table/CaseTableMoPage.tsx +28 -0
- package/dist/components/page/MyCase/_fetchers/addMyCaseQuestion.d.ts +6 -0
- package/dist/components/page/MyCase/_fetchers/addMyCaseQuestion.js +31 -0
- package/dist/components/page/MyCase/_fetchers/addMyCaseQuestion.ts +22 -0
- package/dist/components/page/MyCase/_fetchers/getCase.d.ts +5 -0
- package/dist/components/page/MyCase/_fetchers/getCase.js +30 -0
- package/dist/components/page/MyCase/_fetchers/getCase.ts +21 -0
- package/dist/components/page/MyCase/_fetchers/getCaseList.d.ts +7 -0
- package/dist/components/page/MyCase/_fetchers/getCaseList.js +30 -0
- package/dist/components/page/MyCase/_fetchers/getCaseList.ts +24 -0
- package/dist/components/page/MyCase/_fetchers/getCourtFileList.d.ts +5 -0
- package/dist/components/page/MyCase/_fetchers/getCourtFileList.js +30 -0
- package/dist/components/page/MyCase/_fetchers/getCourtFileList.ts +21 -0
- package/dist/components/page/MyCase/_fetchers/getMyCaseQuestion.d.ts +7 -0
- package/dist/components/page/MyCase/_fetchers/getMyCaseQuestion.js +30 -0
- package/dist/components/page/MyCase/_fetchers/getMyCaseQuestion.ts +24 -0
- package/dist/components/page/MyCase/_fetchers/getMyFileList.d.ts +5 -0
- package/dist/components/page/MyCase/_fetchers/getMyFileList.js +30 -0
- package/dist/components/page/MyCase/_fetchers/getMyFileList.ts +21 -0
- package/dist/components/page/MyCase/_fetchers/getTimeLine.d.ts +5 -0
- package/dist/components/page/MyCase/_fetchers/getTimeLine.js +30 -0
- package/dist/components/page/MyCase/_fetchers/getTimeLine.ts +21 -0
- package/dist/components/page/MyCase/_lib/catagoryMenuName.d.ts +8 -0
- package/dist/components/page/MyCase/_lib/catagoryMenuName.js +8 -0
- package/dist/components/page/MyCase/_lib/catagoryMenuName.ts +11 -0
- package/dist/components/page/MyCase/_lib/catagoryMenuNameApp.d.ts +7 -0
- package/dist/components/page/MyCase/_lib/catagoryMenuNameApp.js +8 -0
- package/dist/components/page/MyCase/_lib/catagoryMenuNameApp.ts +11 -0
- package/dist/components/page/MyCase/_lib/pagination/locale/ko_KR.d.ts +15 -0
- package/dist/components/page/MyCase/_lib/pagination/locale/ko_KR.js +21 -0
- package/dist/components/page/MyCase/_type/type.d.ts +73 -0
- package/dist/components/page/MyCase/_type/type.js +1 -0
- package/dist/components/page/MyCase/_type/type.ts +81 -0
- package/dist/components/page/index.d.ts +4 -0
- package/dist/components/page/index.js +4 -0
- package/dist/components/page/index.ts +4 -0
- package/dist/styles/globals.css +2080 -118
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -2
|
@@ -0,0 +1,107 @@
|
|
|
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 Image from 'next/image';
|
|
11
|
+
import ModalContainer from './ModalCotainer';
|
|
12
|
+
import TextArea from '../_textarea/TextArea';
|
|
13
|
+
import { useState } from 'react';
|
|
14
|
+
import { usePostMyCaseQuestion } from '../../../_actions/action';
|
|
15
|
+
import Loading from '../../../_component/_loading/Loading';
|
|
16
|
+
import CaseInquiryConfirmModal from './CaseInquiryConfirmModal';
|
|
17
|
+
import close from '../../../../../../asset/images/myCase/icon/close.webp';
|
|
18
|
+
const CaseInquiryAddModal = ({ isOpen, onClose, id, refetch }) => {
|
|
19
|
+
const [value, setValue] = useState('');
|
|
20
|
+
const [isCheck, setIsCheck] = useState(false);
|
|
21
|
+
const [isOpenConfirm, setIsOpenConfirm] = useState(false);
|
|
22
|
+
const { mutateAsync, isLoading } = usePostMyCaseQuestion(id, value);
|
|
23
|
+
// console.log(isLoading);
|
|
24
|
+
return (<>
|
|
25
|
+
<ModalContainer isOpen={isOpen} onClose={() => {
|
|
26
|
+
setValue('');
|
|
27
|
+
setIsCheck(false);
|
|
28
|
+
onClose();
|
|
29
|
+
}}>
|
|
30
|
+
<div className="absolute h-full max-h-[568px] w-[calc(100%-40px)] overflow-y-auto rounded-[16px] border border-solid border-grayScale4 bg-grayScale8 p-[32px] sm-top:max-h-[786px] sm-top:w-[calc(100%-60px)] sm-top:max-w-[780px] sm-top:rounded-[32px] sm-top:p-[52px] lg:h-full lg:max-h-[1000px] lg:w-full lg:max-w-[1000px] " onClick={e => e.stopPropagation()}>
|
|
31
|
+
<div className="flex flex-row items-center justify-between">
|
|
32
|
+
<p className="title_medium_mo sm-top:title_medium_tb lg:title_medium text-black">
|
|
33
|
+
사건문의 작성
|
|
34
|
+
</p>
|
|
35
|
+
<Image src={close} alt="close" width={24} height={24} onClick={() => {
|
|
36
|
+
setValue('');
|
|
37
|
+
setIsCheck(false);
|
|
38
|
+
onClose();
|
|
39
|
+
}} className="h-[16px] w-[16px] cursor-pointer sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px]"/>
|
|
40
|
+
</div>
|
|
41
|
+
<div className="mt-[12px] sm-top:mt-[20px]">
|
|
42
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-black max-sm-top:hidden">
|
|
43
|
+
본 사건에 대해 궁금하신 점이 있다면 작성해 주세요.
|
|
44
|
+
</p>
|
|
45
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-black max-sm-top:hidden">
|
|
46
|
+
담당자가 확인하여 성심껏 답변해 드리겠습니다!
|
|
47
|
+
</p>
|
|
48
|
+
<p className="body_large2_mo sm-top:hidden">
|
|
49
|
+
본 사건에 대해 궁금하신 점이 있다면 작성해 주세요. 담당자가 확인하여 성심껏 답변해
|
|
50
|
+
드리겠습니다!
|
|
51
|
+
</p>
|
|
52
|
+
</div>
|
|
53
|
+
<div className="mt-[16px] flex flex-row items-center justify-between">
|
|
54
|
+
<div className="flex flex-row items-center justify-center gap-[4px] sm-top:gap-[8px]">
|
|
55
|
+
<p className="body_medium1_mo sm-top:body_medium1_tb lg:body_medium1 text-black">
|
|
56
|
+
문의내용
|
|
57
|
+
</p>
|
|
58
|
+
<p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-grayScale3">
|
|
59
|
+
(30자 이상<span className="text-mycaseMainColor"> *</span>)
|
|
60
|
+
</p>
|
|
61
|
+
</div>
|
|
62
|
+
<div className="">
|
|
63
|
+
<p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-black">
|
|
64
|
+
<span className="text-mycaseMainColor">{value.length}</span> / 1,000
|
|
65
|
+
</p>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div className="mt-[12px] sm-top:mt-[15px] lg:mt-[18px]">
|
|
69
|
+
<TextArea placeholder="문의내용을 입력해 주세요." value={value} onChange={e => setValue(e.target.value)} isCheck={isCheck}/>
|
|
70
|
+
</div>
|
|
71
|
+
{isCheck && (<div className=" mt-[8px]">
|
|
72
|
+
<p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-mycaseMainColor">
|
|
73
|
+
*문의내용은 최소 30자 이상으로 입력해 주세요.
|
|
74
|
+
</p>
|
|
75
|
+
</div>)}
|
|
76
|
+
|
|
77
|
+
{isLoading ? (<div className="absolute top-[0] flex h-full w-full items-center justify-center">
|
|
78
|
+
<Loading />
|
|
79
|
+
</div>) : (<></>)}
|
|
80
|
+
<div className={`${isCheck
|
|
81
|
+
? 'mt-[21px] sm-top:mt-[20px] lg:mt-[16px]'
|
|
82
|
+
: 'mt-[50px] sm-top:mt-[55px] lg:mt-[53px]'}`}>
|
|
83
|
+
<button className={`flex h-[48px] w-full items-center justify-center rounded-[4px] sm-top:h-[60px] sm-top:w-full sm-top:rounded-[8px] lg:h-[72px] lg:w-[896px] lg:rounded-[16px] ${value.length >= 30 ? ' bg-grayScale1 text-white' : 'bg-grayScale6 text-grayScale3 '}`} onClick={() => __awaiter(void 0, void 0, void 0, function* () {
|
|
84
|
+
if (value.length >= 30) {
|
|
85
|
+
setIsCheck(false);
|
|
86
|
+
const result = yield mutateAsync();
|
|
87
|
+
if (result) {
|
|
88
|
+
refetch();
|
|
89
|
+
setValue('');
|
|
90
|
+
window.scrollTo(0, 0);
|
|
91
|
+
setIsOpenConfirm(true);
|
|
92
|
+
}
|
|
93
|
+
onClose();
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
setIsCheck(true);
|
|
97
|
+
}
|
|
98
|
+
})}>
|
|
99
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2">문의하기</p>
|
|
100
|
+
</button>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</ModalContainer>
|
|
104
|
+
<CaseInquiryConfirmModal isOpen={isOpenConfirm} onClose={() => setIsOpenConfirm(false)} id={id} refetch={refetch}/>
|
|
105
|
+
</>);
|
|
106
|
+
};
|
|
107
|
+
export default CaseInquiryAddModal;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import Image from 'next/image';
|
|
2
|
+
import ModalContainer from './ModalCotainer';
|
|
3
|
+
import TextArea from '../_textarea/TextArea';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { usePostMyCaseQuestion } from '../../../_actions/action';
|
|
6
|
+
import Loading from '../../../_component/_loading/Loading';
|
|
7
|
+
import CaseInquiryConfirmModal from './CaseInquiryConfirmModal';
|
|
8
|
+
import close from '../../../../../../asset/images/myCase/icon/close.webp';
|
|
9
|
+
const CaseInquiryAddModal = ({
|
|
10
|
+
isOpen,
|
|
11
|
+
onClose,
|
|
12
|
+
id,
|
|
13
|
+
refetch
|
|
14
|
+
}: {
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
id: string;
|
|
18
|
+
refetch: () => void;
|
|
19
|
+
}) => {
|
|
20
|
+
const [value, setValue] = useState('');
|
|
21
|
+
const [isCheck, setIsCheck] = useState(false);
|
|
22
|
+
const [isOpenConfirm, setIsOpenConfirm] = useState(false);
|
|
23
|
+
|
|
24
|
+
const { mutateAsync, isLoading } = usePostMyCaseQuestion(id, value);
|
|
25
|
+
// console.log(isLoading);
|
|
26
|
+
return (
|
|
27
|
+
<>
|
|
28
|
+
<ModalContainer
|
|
29
|
+
isOpen={isOpen}
|
|
30
|
+
onClose={() => {
|
|
31
|
+
setValue('');
|
|
32
|
+
setIsCheck(false);
|
|
33
|
+
onClose();
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
<div
|
|
37
|
+
className="absolute h-full max-h-[568px] w-[calc(100%-40px)] overflow-y-auto rounded-[16px] border border-solid border-grayScale4 bg-grayScale8 p-[32px] sm-top:max-h-[786px] sm-top:w-[calc(100%-60px)] sm-top:max-w-[780px] sm-top:rounded-[32px] sm-top:p-[52px] lg:h-full lg:max-h-[1000px] lg:w-full lg:max-w-[1000px] "
|
|
38
|
+
onClick={e => e.stopPropagation()}
|
|
39
|
+
>
|
|
40
|
+
<div className="flex flex-row items-center justify-between">
|
|
41
|
+
<p className="title_medium_mo sm-top:title_medium_tb lg:title_medium text-black">
|
|
42
|
+
사건문의 작성
|
|
43
|
+
</p>
|
|
44
|
+
<Image
|
|
45
|
+
src={close}
|
|
46
|
+
alt="close"
|
|
47
|
+
width={24}
|
|
48
|
+
height={24}
|
|
49
|
+
onClick={() => {
|
|
50
|
+
setValue('');
|
|
51
|
+
setIsCheck(false);
|
|
52
|
+
onClose();
|
|
53
|
+
}}
|
|
54
|
+
className="h-[16px] w-[16px] cursor-pointer sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px]"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
<div className="mt-[12px] sm-top:mt-[20px]">
|
|
58
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-black max-sm-top:hidden">
|
|
59
|
+
본 사건에 대해 궁금하신 점이 있다면 작성해 주세요.
|
|
60
|
+
</p>
|
|
61
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-black max-sm-top:hidden">
|
|
62
|
+
담당자가 확인하여 성심껏 답변해 드리겠습니다!
|
|
63
|
+
</p>
|
|
64
|
+
<p className="body_large2_mo sm-top:hidden">
|
|
65
|
+
본 사건에 대해 궁금하신 점이 있다면 작성해 주세요. 담당자가 확인하여 성심껏 답변해
|
|
66
|
+
드리겠습니다!
|
|
67
|
+
</p>
|
|
68
|
+
</div>
|
|
69
|
+
<div className="mt-[16px] flex flex-row items-center justify-between">
|
|
70
|
+
<div className="flex flex-row items-center justify-center gap-[4px] sm-top:gap-[8px]">
|
|
71
|
+
<p className="body_medium1_mo sm-top:body_medium1_tb lg:body_medium1 text-black">
|
|
72
|
+
문의내용
|
|
73
|
+
</p>
|
|
74
|
+
<p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-grayScale3">
|
|
75
|
+
(30자 이상<span className="text-mycaseMainColor"> *</span>)
|
|
76
|
+
</p>
|
|
77
|
+
</div>
|
|
78
|
+
<div className="">
|
|
79
|
+
<p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-black">
|
|
80
|
+
<span className="text-mycaseMainColor">{value.length}</span> / 1,000
|
|
81
|
+
</p>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
<div className="mt-[12px] sm-top:mt-[15px] lg:mt-[18px]">
|
|
85
|
+
<TextArea
|
|
86
|
+
placeholder="문의내용을 입력해 주세요."
|
|
87
|
+
value={value}
|
|
88
|
+
onChange={e => setValue(e.target.value)}
|
|
89
|
+
isCheck={isCheck}
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
92
|
+
{isCheck && (
|
|
93
|
+
<div className=" mt-[8px]">
|
|
94
|
+
<p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-mycaseMainColor">
|
|
95
|
+
*문의내용은 최소 30자 이상으로 입력해 주세요.
|
|
96
|
+
</p>
|
|
97
|
+
</div>
|
|
98
|
+
)}
|
|
99
|
+
|
|
100
|
+
{isLoading ? (
|
|
101
|
+
<div className="absolute top-[0] flex h-full w-full items-center justify-center">
|
|
102
|
+
<Loading />
|
|
103
|
+
</div>
|
|
104
|
+
) : (
|
|
105
|
+
<></>
|
|
106
|
+
)}
|
|
107
|
+
<div
|
|
108
|
+
className={`${
|
|
109
|
+
isCheck
|
|
110
|
+
? 'mt-[21px] sm-top:mt-[20px] lg:mt-[16px]'
|
|
111
|
+
: 'mt-[50px] sm-top:mt-[55px] lg:mt-[53px]'
|
|
112
|
+
}`}
|
|
113
|
+
>
|
|
114
|
+
<button
|
|
115
|
+
className={`flex h-[48px] w-full items-center justify-center rounded-[4px] sm-top:h-[60px] sm-top:w-full sm-top:rounded-[8px] lg:h-[72px] lg:w-[896px] lg:rounded-[16px] ${
|
|
116
|
+
value.length >= 30 ? ' bg-grayScale1 text-white' : 'bg-grayScale6 text-grayScale3 '
|
|
117
|
+
}`}
|
|
118
|
+
onClick={async () => {
|
|
119
|
+
if (value.length >= 30) {
|
|
120
|
+
setIsCheck(false);
|
|
121
|
+
|
|
122
|
+
const result = await mutateAsync();
|
|
123
|
+
if (result) {
|
|
124
|
+
refetch();
|
|
125
|
+
setValue('');
|
|
126
|
+
window.scrollTo(0, 0);
|
|
127
|
+
setIsOpenConfirm(true);
|
|
128
|
+
}
|
|
129
|
+
onClose();
|
|
130
|
+
} else {
|
|
131
|
+
setIsCheck(true);
|
|
132
|
+
}
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2">문의하기</p>
|
|
136
|
+
</button>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</ModalContainer>
|
|
140
|
+
<CaseInquiryConfirmModal
|
|
141
|
+
isOpen={isOpenConfirm}
|
|
142
|
+
onClose={() => setIsOpenConfirm(false)}
|
|
143
|
+
id={id}
|
|
144
|
+
refetch={refetch}
|
|
145
|
+
/>
|
|
146
|
+
</>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export default CaseInquiryAddModal;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Image from 'next/image';
|
|
2
|
+
import ModalContainer from './ModalCotainer';
|
|
3
|
+
import modalIcon from '../../../../../../asset/images/myCase/icon/modal_icon.webp';
|
|
4
|
+
const CaseInquiryConfirmModal = ({ isOpen, onClose, id, refetch }) => {
|
|
5
|
+
// console.log(isLoading);
|
|
6
|
+
return (<ModalContainer isOpen={isOpen} onClose={() => {
|
|
7
|
+
onClose();
|
|
8
|
+
}}>
|
|
9
|
+
<div className="border-grayScale4 bg-grayScale8 sm-top:w-[calc(100%-252px)] sm-top:max-w-[648px] sm-top:rounded-[24px] sm-top:px-[52px] sm-top:py-[44px] absolute flex w-[calc(100%-40px)] flex-col items-center justify-center overflow-y-auto rounded-[12px] border border-solid p-[30px] lg:w-full lg:max-w-[804px] lg:p-[52px] " onClick={e => e.stopPropagation()}>
|
|
10
|
+
<Image src={modalIcon} alt="check" width={40} height={48.9} className="sm-top:h-[68.44px] sm-top:w-[56px] h-[48.9px] w-[40px] lg:h-[88px] lg:w-[72px]"/>
|
|
11
|
+
<p className="body_large1_mo sm-top:body_large1_tb sm-top: lg:body_large1 sm-top:mt-[20px] mt-[16.11px] lg:mt-[36px]">
|
|
12
|
+
사건문의 작성이 완료되었습니다.
|
|
13
|
+
</p>
|
|
14
|
+
<p className="body_medium2_mo sm-top:body_medium2_tb lg:body_medium2 text-grayScale3 sm-top:mt-[16px] mt-[8px] text-center lg:mt-[20px]">
|
|
15
|
+
문의에 대한 답변은 평균 1일 정도 소요될 예정입니다.
|
|
16
|
+
</p>
|
|
17
|
+
<button className={`bg-grayScale1 sm-top:mt-[40px] sm-top:h-[60px] sm-top:rounded-[8px] mt-[20px] h-[48px] w-full rounded-[4px] lg:mt-[47px] lg:h-[72px] lg:rounded-[16px] `} onClick={() => {
|
|
18
|
+
onClose();
|
|
19
|
+
}}>
|
|
20
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">확인</p>
|
|
21
|
+
</button>
|
|
22
|
+
</div>
|
|
23
|
+
</ModalContainer>);
|
|
24
|
+
};
|
|
25
|
+
export default CaseInquiryConfirmModal;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import Image from 'next/image';
|
|
2
|
+
import ModalContainer from './ModalCotainer';
|
|
3
|
+
|
|
4
|
+
import modalIcon from '../../../../../../asset/images/myCase/icon/modal_icon.webp';
|
|
5
|
+
|
|
6
|
+
const CaseInquiryConfirmModal = ({
|
|
7
|
+
isOpen,
|
|
8
|
+
onClose,
|
|
9
|
+
id,
|
|
10
|
+
refetch
|
|
11
|
+
}: {
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
id: string;
|
|
15
|
+
refetch: () => void;
|
|
16
|
+
}) => {
|
|
17
|
+
// console.log(isLoading);
|
|
18
|
+
return (
|
|
19
|
+
<ModalContainer
|
|
20
|
+
isOpen={isOpen}
|
|
21
|
+
onClose={() => {
|
|
22
|
+
onClose();
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<div
|
|
26
|
+
className="border-grayScale4 bg-grayScale8 sm-top:w-[calc(100%-252px)] sm-top:max-w-[648px] sm-top:rounded-[24px] sm-top:px-[52px] sm-top:py-[44px] absolute flex w-[calc(100%-40px)] flex-col items-center justify-center overflow-y-auto rounded-[12px] border border-solid p-[30px] lg:w-full lg:max-w-[804px] lg:p-[52px] "
|
|
27
|
+
onClick={e => e.stopPropagation()}
|
|
28
|
+
>
|
|
29
|
+
<Image
|
|
30
|
+
src={modalIcon}
|
|
31
|
+
alt="check"
|
|
32
|
+
width={40}
|
|
33
|
+
height={48.9}
|
|
34
|
+
className="sm-top:h-[68.44px] sm-top:w-[56px] h-[48.9px] w-[40px] lg:h-[88px] lg:w-[72px]"
|
|
35
|
+
/>
|
|
36
|
+
<p className="body_large1_mo sm-top:body_large1_tb sm-top: lg:body_large1 sm-top:mt-[20px] mt-[16.11px] lg:mt-[36px]">
|
|
37
|
+
사건문의 작성이 완료되었습니다.
|
|
38
|
+
</p>
|
|
39
|
+
<p className="body_medium2_mo sm-top:body_medium2_tb lg:body_medium2 text-grayScale3 sm-top:mt-[16px] mt-[8px] text-center lg:mt-[20px]">
|
|
40
|
+
문의에 대한 답변은 평균 1일 정도 소요될 예정입니다.
|
|
41
|
+
</p>
|
|
42
|
+
<button
|
|
43
|
+
className={`bg-grayScale1 sm-top:mt-[40px] sm-top:h-[60px] sm-top:rounded-[8px] mt-[20px] h-[48px] w-full rounded-[4px] lg:mt-[47px] lg:h-[72px] lg:rounded-[16px] `}
|
|
44
|
+
onClick={() => {
|
|
45
|
+
onClose();
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">확인</p>
|
|
49
|
+
</button>
|
|
50
|
+
</div>
|
|
51
|
+
</ModalContainer>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default CaseInquiryConfirmModal;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
const ModalContainer = ({ isOpen, onClose, children }) => {
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
// 모달이 열릴 때 스크롤 방지
|
|
6
|
+
if (isOpen) {
|
|
7
|
+
document.body.style.overflow = 'hidden';
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
document.body.style.overflow = 'unset';
|
|
11
|
+
}
|
|
12
|
+
return () => {
|
|
13
|
+
document.body.style.overflow = 'unset'; // 컴포넌트 언마운트 시 스크롤 복원
|
|
14
|
+
};
|
|
15
|
+
}, [isOpen]);
|
|
16
|
+
return ReactDOM.createPortal(isOpen && (<div className="fixed inset-0 z-[9999] flex items-center justify-center bg-[#3D3D3DCC] " // z-index를 높게 설정
|
|
17
|
+
onClick={onClose} // 배경 클릭 시 모달 닫기
|
|
18
|
+
>
|
|
19
|
+
<div className="flex items-center justify-center w-full h-full z-60" // z-index를 더 높게 설정
|
|
20
|
+
>
|
|
21
|
+
{children}
|
|
22
|
+
</div>
|
|
23
|
+
</div>), document.body // Portal을 사용하여 body에 렌더링
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
export default ModalContainer;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
interface ModalContainerProps {
|
|
4
|
+
isOpen: boolean; // 모달 열림 상태
|
|
5
|
+
onClose: () => void; // 모달 닫기 함수
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const ModalContainer: React.FC<ModalContainerProps> = ({ isOpen, onClose, children }) => {
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
// 모달이 열릴 때 스크롤 방지
|
|
12
|
+
if (isOpen) {
|
|
13
|
+
document.body.style.overflow = 'hidden';
|
|
14
|
+
} else {
|
|
15
|
+
document.body.style.overflow = 'unset';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return () => {
|
|
19
|
+
document.body.style.overflow = 'unset'; // 컴포넌트 언마운트 시 스크롤 복원
|
|
20
|
+
};
|
|
21
|
+
}, [isOpen]);
|
|
22
|
+
return ReactDOM.createPortal(
|
|
23
|
+
isOpen && (
|
|
24
|
+
<div
|
|
25
|
+
className="fixed inset-0 z-[9999] flex items-center justify-center bg-[#3D3D3DCC] " // z-index를 높게 설정
|
|
26
|
+
onClick={onClose} // 배경 클릭 시 모달 닫기
|
|
27
|
+
>
|
|
28
|
+
<div
|
|
29
|
+
className="flex items-center justify-center w-full h-full z-60" // z-index를 더 높게 설정
|
|
30
|
+
>
|
|
31
|
+
{children}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
),
|
|
35
|
+
document.body // Portal을 사용하여 body에 렌더링
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default ModalContainer;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const TextArea = ({ placeholder, value, onChange, isCheck }) => {
|
|
2
|
+
return (<textarea value={value} className={`body_medium2_mo sm-top:h-[368px] sm-top:p-[32px] sm-top:body_medium2_tb lg:body_medium2 h-[232px] w-full resize-none rounded-[10px] border border-solid p-[16px] placeholder:text-grayScale3 lg:h-[512px] lg:p-[36px] ${isCheck ? 'border-mycaseMainColor' : 'border-grayScale5'}`} placeholder={placeholder} onChange={onChange}/>);
|
|
3
|
+
};
|
|
4
|
+
export default TextArea;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const TextArea = ({
|
|
2
|
+
placeholder,
|
|
3
|
+
value,
|
|
4
|
+
onChange,
|
|
5
|
+
isCheck
|
|
6
|
+
}: {
|
|
7
|
+
placeholder: string;
|
|
8
|
+
value: string;
|
|
9
|
+
onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
10
|
+
isCheck: boolean;
|
|
11
|
+
}) => {
|
|
12
|
+
return (
|
|
13
|
+
<textarea
|
|
14
|
+
value={value}
|
|
15
|
+
className={`body_medium2_mo sm-top:h-[368px] sm-top:p-[32px] sm-top:body_medium2_tb lg:body_medium2 h-[232px] w-full resize-none rounded-[10px] border border-solid p-[16px] placeholder:text-grayScale3 lg:h-[512px] lg:p-[36px] ${
|
|
16
|
+
isCheck ? 'border-mycaseMainColor' : 'border-grayScale5'
|
|
17
|
+
}`}
|
|
18
|
+
placeholder={placeholder}
|
|
19
|
+
onChange={onChange}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default TextArea;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FetchType, DetailList, TimeLineType, FileList, Question } from '../_type/type';
|
|
2
|
+
export declare const useGetCaseList: ({ tapState, subTapState, pageNumber, pageSize }: {
|
|
3
|
+
tapState: string;
|
|
4
|
+
subTapState: string;
|
|
5
|
+
pageNumber: number;
|
|
6
|
+
pageSize: number;
|
|
7
|
+
}) => {
|
|
8
|
+
data: any;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const useGetDetailList: (id: string) => {
|
|
12
|
+
data: FetchType<DetailList> | undefined;
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare const useGetTimeLine: (id: string) => {
|
|
16
|
+
data: FetchType<TimeLineType> | undefined;
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare const useGetCourtFileList: (id: string) => {
|
|
20
|
+
data: FetchType<FileList[]> | undefined;
|
|
21
|
+
isLoading: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const useGetMyFileList: (id: string) => {
|
|
24
|
+
data: FetchType<FileList[]> | undefined;
|
|
25
|
+
isLoading: boolean;
|
|
26
|
+
};
|
|
27
|
+
export declare const useGetMyCaseQuestion: (id: string, page: number, pageSize: number) => {
|
|
28
|
+
data: FetchType<Question[]> | undefined;
|
|
29
|
+
isLoading: boolean;
|
|
30
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<FetchType<Question[]>, Error>>;
|
|
31
|
+
};
|
|
32
|
+
export declare const usePostMyCaseQuestion: (id: string, content: string) => {
|
|
33
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<FetchType<Question[]>, Error, void, unknown>;
|
|
34
|
+
isLoading: boolean;
|
|
35
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { useMutation, useQuery } from '@tanstack/react-query';
|
|
12
|
+
import getCase from '../_fetchers/getCase';
|
|
13
|
+
import getTimeLine from '../_fetchers/getTimeLine';
|
|
14
|
+
import getCourtFileList from '../_fetchers/getCourtFileList';
|
|
15
|
+
import getMyFileList from '../_fetchers/getMyFileList';
|
|
16
|
+
import getMyCaseQuestion from '../_fetchers/getMyCaseQuestion';
|
|
17
|
+
import addMyCaseQuestion from '../_fetchers/addMyCaseQuestion';
|
|
18
|
+
import getCaseList from '../_fetchers/getCaseList';
|
|
19
|
+
const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjIsImlhdCI6MTc0MDAxNDYzOCwiZXhwIjoxNzcxNTcyMjM4fQ.11ra7DkzlOVmBqDjo8SJTQnZDZdRHXjjU3ujK8G3OOY';
|
|
20
|
+
// 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjMsImVtYWlsIjoiNjAzMDgwNEBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzQwNDQ2Nzg1LCJleHAiOjE3NDA0ODI3ODV9.v_d7htci4fjLA5MqBXWxUqyNjsAm2GEcdRBO5se-DB8'; //빈거
|
|
21
|
+
export const useGetCaseList = ({ tapState, subTapState, pageNumber, pageSize }) => {
|
|
22
|
+
const { data, isLoading } = useQuery({
|
|
23
|
+
queryKey: ['case', tapState, subTapState, pageNumber, pageSize],
|
|
24
|
+
queryFn: () => getCaseList({
|
|
25
|
+
jwt: jwt,
|
|
26
|
+
size: pageSize,
|
|
27
|
+
state: subTapState,
|
|
28
|
+
page: pageNumber
|
|
29
|
+
}),
|
|
30
|
+
//브라우저 화면을 focus할 때 새로 api를 호출할 건지 설정하는 옵션
|
|
31
|
+
refetchOnWindowFocus: false,
|
|
32
|
+
//기본설정 cacheTime:5분, staleTime:0초, 값을 Infinity로 설정할 경우 api return 값이 바뀌지 않는 이상 서버에 새로 요청하지 않고 캐싱된 데이터를 영구적으로 사용하여 api 호출 최적화
|
|
33
|
+
// cacheTime: 0,
|
|
34
|
+
gcTime: 0,
|
|
35
|
+
staleTime: 0
|
|
36
|
+
});
|
|
37
|
+
return { data, isLoading };
|
|
38
|
+
};
|
|
39
|
+
export const useGetDetailList = (id) => {
|
|
40
|
+
const { data, isLoading } = useQuery({
|
|
41
|
+
queryKey: ['case', id],
|
|
42
|
+
queryFn: () => getCase({
|
|
43
|
+
jwt: jwt,
|
|
44
|
+
id: id
|
|
45
|
+
}),
|
|
46
|
+
//브라우저 화면을 focus할 때 새로 api를 호출할 건지 설정하는 옵션
|
|
47
|
+
refetchOnWindowFocus: false,
|
|
48
|
+
//기본설정 cacheTime:5분, staleTime:0초, 값을 Infinity로 설정할 경우 api return 값이 바뀌지 않는 이상 서버에 새로 요청하지 않고 캐싱된 데이터를 영구적으로 사용하여 api 호출 최적화
|
|
49
|
+
gcTime: 0,
|
|
50
|
+
staleTime: 0,
|
|
51
|
+
enabled: !!id
|
|
52
|
+
// onSuccess: res => {},
|
|
53
|
+
// onError: error => {
|
|
54
|
+
// console.log(error);
|
|
55
|
+
// }
|
|
56
|
+
});
|
|
57
|
+
return { data, isLoading };
|
|
58
|
+
};
|
|
59
|
+
export const useGetTimeLine = (id) => {
|
|
60
|
+
const { data, isLoading } = useQuery({
|
|
61
|
+
queryKey: ['case', 'timeline', id],
|
|
62
|
+
queryFn: () => getTimeLine({
|
|
63
|
+
jwt: jwt,
|
|
64
|
+
id: id
|
|
65
|
+
}),
|
|
66
|
+
gcTime: 0,
|
|
67
|
+
staleTime: 0,
|
|
68
|
+
enabled: !!id
|
|
69
|
+
// onSuccess: res => {},
|
|
70
|
+
// onError: error => {
|
|
71
|
+
// console.log(error);
|
|
72
|
+
// }
|
|
73
|
+
});
|
|
74
|
+
return { data, isLoading };
|
|
75
|
+
};
|
|
76
|
+
export const useGetCourtFileList = (id) => {
|
|
77
|
+
const { data, isLoading } = useQuery({
|
|
78
|
+
queryKey: ['case', 'courtFileList', id],
|
|
79
|
+
queryFn: () => getCourtFileList({
|
|
80
|
+
jwt: jwt,
|
|
81
|
+
id: id
|
|
82
|
+
}),
|
|
83
|
+
gcTime: 0,
|
|
84
|
+
staleTime: 0,
|
|
85
|
+
enabled: !!id
|
|
86
|
+
// onSuccess: res => {},
|
|
87
|
+
// onError: error => {
|
|
88
|
+
// console.log(error);
|
|
89
|
+
// }
|
|
90
|
+
});
|
|
91
|
+
return { data, isLoading };
|
|
92
|
+
};
|
|
93
|
+
export const useGetMyFileList = (id) => {
|
|
94
|
+
const { data, isLoading } = useQuery({
|
|
95
|
+
queryKey: ['case', 'myFileList', id],
|
|
96
|
+
queryFn: () => getMyFileList({
|
|
97
|
+
jwt: jwt,
|
|
98
|
+
id: id
|
|
99
|
+
}),
|
|
100
|
+
gcTime: 0,
|
|
101
|
+
staleTime: 0,
|
|
102
|
+
enabled: !!id
|
|
103
|
+
// onSuccess: res => {},
|
|
104
|
+
// onError: error => {
|
|
105
|
+
// console.log(error);
|
|
106
|
+
// }
|
|
107
|
+
});
|
|
108
|
+
return { data, isLoading };
|
|
109
|
+
};
|
|
110
|
+
export const useGetMyCaseQuestion = (id, page, pageSize) => {
|
|
111
|
+
const { data, isLoading, refetch } = useQuery({
|
|
112
|
+
queryKey: ['case', 'myCaseQuestion', id, page, pageSize],
|
|
113
|
+
queryFn: () => getMyCaseQuestion({
|
|
114
|
+
jwt: jwt,
|
|
115
|
+
id: id,
|
|
116
|
+
page: page,
|
|
117
|
+
size: pageSize
|
|
118
|
+
}),
|
|
119
|
+
gcTime: 0,
|
|
120
|
+
staleTime: 0,
|
|
121
|
+
enabled: !!id
|
|
122
|
+
// onSuccess: res => {},
|
|
123
|
+
// onError: error => {
|
|
124
|
+
// console.log(error);
|
|
125
|
+
// }
|
|
126
|
+
});
|
|
127
|
+
return { data, isLoading, refetch };
|
|
128
|
+
};
|
|
129
|
+
export const usePostMyCaseQuestion = (id, content) => {
|
|
130
|
+
const { mutateAsync, status } = useMutation({
|
|
131
|
+
mutationFn: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
132
|
+
return yield addMyCaseQuestion({
|
|
133
|
+
jwt: jwt,
|
|
134
|
+
id: id,
|
|
135
|
+
content: content
|
|
136
|
+
});
|
|
137
|
+
}),
|
|
138
|
+
onSuccess: res => { },
|
|
139
|
+
onError: error => {
|
|
140
|
+
console.log(error);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
const isLoading = status === 'pending';
|
|
144
|
+
return { mutateAsync, isLoading };
|
|
145
|
+
};
|