@daeryun/dr_components 0.3.1 → 0.3.3
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/asset/images/myCase/icon/check_box.webp +0 -0
- package/dist/asset/images/myCase/icon/check_box_gray.webp +0 -0
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/ViewMoreSection/ViewMoreSection.jsx +1 -1
- package/dist/components/ViewMoreSection/ViewMoreSection.tsx +1 -1
- package/dist/components/banner/TopBanner.stories.jsx +8 -4
- package/dist/components/banner/TopBanner.stories.tsx +8 -4
- 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 +33 -0
- package/dist/components/page/MyCase/[id]/MyCaseDetailPage.d.ts +3 -0
- package/dist/components/page/MyCase/[id]/MyCaseDetailPage.jsx +78 -0
- package/dist/components/page/MyCase/[id]/MyCaseDetailPage.tsx +156 -0
- package/dist/components/page/MyCase/[id]/_component/ContactInfo.d.ts +2 -0
- package/dist/components/page/MyCase/[id]/_component/ContactInfo.jsx +89 -0
- package/dist/components/page/MyCase/[id]/_component/ContactInfo.tsx +115 -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 +93 -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 +73 -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 +187 -0
- package/dist/components/page/MyCase/[id]/_component/_document/Document.d.ts +6 -0
- package/dist/components/page/MyCase/[id]/_component/_document/Document.jsx +31 -0
- package/dist/components/page/MyCase/[id]/_component/_document/Document.tsx +53 -0
- package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.d.ts +6 -0
- package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.jsx +44 -0
- package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.tsx +61 -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 +24 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryConfirmModal.tsx +57 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.d.ts +5 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.jsx +37 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.tsx +59 -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 +34 -0
- package/dist/components/page/MyCase/_actions/action.js +143 -0
- package/dist/components/page/MyCase/_actions/action.ts +163 -0
- package/dist/components/page/MyCase/_component/CaseContainer.d.ts +2 -0
- package/dist/components/page/MyCase/_component/CaseContainer.jsx +194 -0
- package/dist/components/page/MyCase/_component/CaseContainer.tsx +242 -0
- package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenu.d.ts +8 -0
- package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenu.jsx +43 -0
- package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenu.tsx +73 -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 +86 -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/IntroWrapper.d.ts +9 -0
- package/dist/components/page/MyCase/_component/_layout/IntroWrapper.jsx +30 -0
- package/dist/components/page/MyCase/_component/_layout/IntroWrapper.tsx +71 -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/PaginationComponent.d.ts +10 -0
- package/dist/components/page/MyCase/_component/_pagination/PaginationComponent.jsx +80 -0
- package/dist/components/page/MyCase/_component/_pagination/PaginationComponent.tsx +133 -0
- package/dist/components/page/MyCase/_component/_table/CaseLine.d.ts +5 -0
- package/dist/components/page/MyCase/_component/_table/CaseLine.jsx +66 -0
- package/dist/components/page/MyCase/_component/_table/CaseLine.tsx +139 -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 +62 -0
- package/dist/components/page/MyCase/_component/_table/CaseTable.tsx +93 -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 +39 -0
- package/dist/components/page/MyCase/_component/_table/CaseTableMoBox.tsx +55 -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 +6 -0
- package/dist/components/page/MyCase/_fetchers/getCaseList.js +30 -0
- package/dist/components/page/MyCase/_fetchers/getCaseList.ts +21 -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/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 +1 -0
- package/dist/components/page/index.js +1 -1
- package/dist/components/page/index.ts +1 -1
- package/dist/styles/globals.css +2332 -235
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -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 { actionPostMyCaseQuestion } 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 } = actionPostMyCaseQuestion(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="border-grayScale4 bg-grayScale8 sm-top:max-h-[786px] sm-top:w-[calc(100%-60px)] sm-top:max-w-[780px] sm-top:rounded-[32px] sm-top:p-[52px] absolute h-full max-h-[568px] w-[calc(100%-40px)] overflow-y-auto rounded-[16px] border border-solid p-[32px] 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="sm-top:h-[20px] sm-top:w-[20px] h-[16px] w-[16px] cursor-pointer lg:h-[24px] lg:w-[24px]"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
<div className="sm-top:mt-[20px] mt-[12px]">
|
|
58
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 max-sm-top:hidden text-black">
|
|
59
|
+
본 사건에 대해 궁금하신 점이 있다면 작성해 주세요.
|
|
60
|
+
</p>
|
|
61
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 max-sm-top:hidden text-black">
|
|
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="sm-top:gap-[8px] flex flex-row items-center justify-center gap-[4px]">
|
|
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="sm-top:mt-[15px] mt-[12px] 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
|
+
? 'sm-top:mt-[20px] mt-[21px] lg:mt-[16px]'
|
|
111
|
+
: 'sm-top:mt-[55px] mt-[50px] lg:mt-[53px]'
|
|
112
|
+
}`}
|
|
113
|
+
>
|
|
114
|
+
<button
|
|
115
|
+
className={`sm-top:h-[60px] sm-top:w-full sm-top:rounded-[8px] flex h-[48px] w-full items-center justify-center rounded-[4px] 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,24 @@
|
|
|
1
|
+
import Image from 'next/image';
|
|
2
|
+
import ModalContainer from './ModalCotainer';
|
|
3
|
+
const CaseInquiryConfirmModal = ({ isOpen, onClose, id, refetch }) => {
|
|
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-[52px] 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-[16.11px] sm-top:mt-[20px] lg:mt-[36px]">
|
|
11
|
+
사건문의 작성이 완료되었습니다.
|
|
12
|
+
</p>
|
|
13
|
+
<p className="body_medium2_mo sm-top:body_medium2_tb lg:body_medium2 mt-[8px] text-center text-grayScale3 sm-top:mt-[16px] lg:mt-[20px]">
|
|
14
|
+
문의에 대한 답변은 평균 1일 정도 소요될 예정입니다.
|
|
15
|
+
</p>
|
|
16
|
+
<button className={`mt-[20px] h-[48px] w-full rounded-[4px] bg-grayScale1 sm-top:mt-[40px] sm-top:h-[60px] sm-top:rounded-[8px] lg:mt-[47px] lg:h-[72px] lg:rounded-[16px] `} onClick={() => {
|
|
17
|
+
onClose();
|
|
18
|
+
}}>
|
|
19
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">확인</p>
|
|
20
|
+
</button>
|
|
21
|
+
</div>
|
|
22
|
+
</ModalContainer>);
|
|
23
|
+
};
|
|
24
|
+
export default CaseInquiryConfirmModal;
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { actionPostMyCaseQuestion } from '../../../_actions/action';
|
|
6
|
+
import Loading from '../../../_component/_loading/Loading';
|
|
7
|
+
|
|
8
|
+
const CaseInquiryConfirmModal = ({
|
|
9
|
+
isOpen,
|
|
10
|
+
onClose,
|
|
11
|
+
id,
|
|
12
|
+
refetch
|
|
13
|
+
}: {
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
id: string;
|
|
17
|
+
refetch: () => void;
|
|
18
|
+
}) => {
|
|
19
|
+
// console.log(isLoading);
|
|
20
|
+
return (
|
|
21
|
+
<ModalContainer
|
|
22
|
+
isOpen={isOpen}
|
|
23
|
+
onClose={() => {
|
|
24
|
+
onClose();
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
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-[52px] sm-top:py-[44px] lg:w-full lg:max-w-[804px] lg:p-[52px] "
|
|
29
|
+
onClick={e => e.stopPropagation()}
|
|
30
|
+
>
|
|
31
|
+
<Image
|
|
32
|
+
src="/images/mycase/icon/modal_icon.webp"
|
|
33
|
+
alt="check"
|
|
34
|
+
width={40}
|
|
35
|
+
height={48.9}
|
|
36
|
+
className="h-[48.9px] w-[40px] sm-top:h-[68.44px] sm-top:w-[56px] lg:h-[88px] lg:w-[72px]"
|
|
37
|
+
/>
|
|
38
|
+
<p className="body_large1_mo sm-top:body_large1_tb sm-top: lg:body_large1 mt-[16.11px] sm-top:mt-[20px] lg:mt-[36px]">
|
|
39
|
+
사건문의 작성이 완료되었습니다.
|
|
40
|
+
</p>
|
|
41
|
+
<p className="body_medium2_mo sm-top:body_medium2_tb lg:body_medium2 mt-[8px] text-center text-grayScale3 sm-top:mt-[16px] lg:mt-[20px]">
|
|
42
|
+
문의에 대한 답변은 평균 1일 정도 소요될 예정입니다.
|
|
43
|
+
</p>
|
|
44
|
+
<button
|
|
45
|
+
className={`mt-[20px] h-[48px] w-full rounded-[4px] bg-grayScale1 sm-top:mt-[40px] sm-top:h-[60px] sm-top:rounded-[8px] lg:mt-[47px] lg:h-[72px] lg:rounded-[16px] `}
|
|
46
|
+
onClick={() => {
|
|
47
|
+
onClose();
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">확인</p>
|
|
51
|
+
</button>
|
|
52
|
+
</div>
|
|
53
|
+
</ModalContainer>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default CaseInquiryConfirmModal;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Image from 'next/image';
|
|
2
|
+
import ModalContainer from './ModalCotainer';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import close from '../../../../../asset/images/mycase/icon/close.webp';
|
|
5
|
+
const ContractModal = ({ isOpen, onClose }) => {
|
|
6
|
+
// const [value, setValue] = useState('');
|
|
7
|
+
// const [isCheck, setIsCheck] = useState(false);
|
|
8
|
+
const [isOpenConfirm, setIsOpenConfirm] = useState(false);
|
|
9
|
+
// const { mutateAsync, isLoading } = actionPostMyCaseQuestion(id, value);
|
|
10
|
+
// console.log(isLoading);
|
|
11
|
+
return (<>
|
|
12
|
+
<ModalContainer isOpen={isOpen} onClose={() => {
|
|
13
|
+
onClose();
|
|
14
|
+
}}>
|
|
15
|
+
<div className="border-grayScale4 bg-grayScale8 sm-top:max-h-[786px] sm-top:w-[calc(100%-60px)] sm-top:max-w-[780px] sm-top:rounded-[32px] sm-top:p-[52px] absolute w-[calc(100%-40px)] overflow-y-auto rounded-[16px] border border-solid p-[32px] lg:h-full lg:max-h-[1000px] lg:w-full lg:max-w-[1000px] " onClick={e => e.stopPropagation()}>
|
|
16
|
+
<div className="flex flex-row items-center justify-between">
|
|
17
|
+
<p className="title_medium_mo sm-top:title_medium_tb lg:title_medium text-black">내 약정서</p>
|
|
18
|
+
<Image src={close} alt="close" width={24} height={24} onClick={() => {
|
|
19
|
+
onClose();
|
|
20
|
+
}} className="sm-top:h-[20px] sm-top:w-[20px] h-[16px] w-[16px] cursor-pointer lg:h-[24px] lg:w-[24px]"/>
|
|
21
|
+
</div>
|
|
22
|
+
<div className="border-grayScale1 sm-top:mt-[20px] sm-top:h-[605px] mt-[12px] h-[453px] w-full overflow-y-auto rounded-[8px] border border-solid lg:h-[836px]">
|
|
23
|
+
이미지
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
{/* {isLoading ? (
|
|
27
|
+
<div className="absolute top-[0] flex h-full w-full items-center justify-center">
|
|
28
|
+
<Loading />
|
|
29
|
+
</div>
|
|
30
|
+
) : (
|
|
31
|
+
<></>
|
|
32
|
+
)} */}
|
|
33
|
+
</div>
|
|
34
|
+
</ModalContainer>
|
|
35
|
+
</>);
|
|
36
|
+
};
|
|
37
|
+
export default ContractModal;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { actionPostMyCaseQuestion } 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
|
+
|
|
10
|
+
const ContractModal = ({ isOpen, onClose }: { isOpen: boolean; onClose: () => void }) => {
|
|
11
|
+
// const [value, setValue] = useState('');
|
|
12
|
+
// const [isCheck, setIsCheck] = useState(false);
|
|
13
|
+
const [isOpenConfirm, setIsOpenConfirm] = useState(false);
|
|
14
|
+
|
|
15
|
+
// const { mutateAsync, isLoading } = actionPostMyCaseQuestion(id, value);
|
|
16
|
+
// console.log(isLoading);
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<ModalContainer
|
|
20
|
+
isOpen={isOpen}
|
|
21
|
+
onClose={() => {
|
|
22
|
+
onClose();
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<div
|
|
26
|
+
className="border-grayScale4 bg-grayScale8 sm-top:max-h-[786px] sm-top:w-[calc(100%-60px)] sm-top:max-w-[780px] sm-top:rounded-[32px] sm-top:p-[52px] absolute w-[calc(100%-40px)] overflow-y-auto rounded-[16px] border border-solid p-[32px] lg:h-full lg:max-h-[1000px] lg:w-full lg:max-w-[1000px] "
|
|
27
|
+
onClick={e => e.stopPropagation()}
|
|
28
|
+
>
|
|
29
|
+
<div className="flex flex-row items-center justify-between">
|
|
30
|
+
<p className="title_medium_mo sm-top:title_medium_tb lg:title_medium text-black">내 약정서</p>
|
|
31
|
+
<Image
|
|
32
|
+
src={close}
|
|
33
|
+
alt="close"
|
|
34
|
+
width={24}
|
|
35
|
+
height={24}
|
|
36
|
+
onClick={() => {
|
|
37
|
+
onClose();
|
|
38
|
+
}}
|
|
39
|
+
className="sm-top:h-[20px] sm-top:w-[20px] h-[16px] w-[16px] cursor-pointer lg:h-[24px] lg:w-[24px]"
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
<div className="border-grayScale1 sm-top:mt-[20px] sm-top:h-[605px] mt-[12px] h-[453px] w-full overflow-y-auto rounded-[8px] border border-solid lg:h-[836px]">
|
|
43
|
+
이미지
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
{/* {isLoading ? (
|
|
47
|
+
<div className="absolute top-[0] flex h-full w-full items-center justify-center">
|
|
48
|
+
<Loading />
|
|
49
|
+
</div>
|
|
50
|
+
) : (
|
|
51
|
+
<></>
|
|
52
|
+
)} */}
|
|
53
|
+
</div>
|
|
54
|
+
</ModalContainer>
|
|
55
|
+
</>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default ContractModal;
|
|
@@ -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,34 @@
|
|
|
1
|
+
import { FetchType, DetailList, TimeLineType, FileList, Question } from '../_type/type';
|
|
2
|
+
export declare const actionGetCaseList: ({ tapState, pageNumber, pageSize }: {
|
|
3
|
+
tapState: string;
|
|
4
|
+
pageNumber: number;
|
|
5
|
+
pageSize: number;
|
|
6
|
+
}) => {
|
|
7
|
+
data: any;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const actionGetDetailList: (id: string) => {
|
|
11
|
+
data: FetchType<DetailList> | undefined;
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const actionGetTimeLine: (id: string) => {
|
|
15
|
+
data: FetchType<TimeLineType> | undefined;
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const actionGetCourtFileList: (id: string) => {
|
|
19
|
+
data: FetchType<FileList[]> | undefined;
|
|
20
|
+
isLoading: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare const actionGetMyFileList: (id: string) => {
|
|
23
|
+
data: FetchType<FileList[]> | undefined;
|
|
24
|
+
isLoading: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare const actionGetMyCaseQuestion: (id: string, page: number, pageSize: number) => {
|
|
27
|
+
data: FetchType<Question[]> | undefined;
|
|
28
|
+
isLoading: boolean;
|
|
29
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<FetchType<Question[]>, Error>>;
|
|
30
|
+
};
|
|
31
|
+
export declare const actionPostMyCaseQuestion: (id: string, content: string) => {
|
|
32
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<FetchType<Question[]>, Error, void, unknown>;
|
|
33
|
+
isLoading: boolean;
|
|
34
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
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 { useMutation, useQuery } from '@tanstack/react-query';
|
|
11
|
+
import getCase from '../_fetchers/getCase';
|
|
12
|
+
import getTimeLine from '../_fetchers/getTimeLine';
|
|
13
|
+
import getCourtFileList from '../_fetchers/getCourtFileList';
|
|
14
|
+
import getMyFileList from '../_fetchers/getMyFileList';
|
|
15
|
+
import getMyCaseQuestion from '../_fetchers/getMyCaseQuestion';
|
|
16
|
+
import addMyCaseQuestion from '../_fetchers/addMyCaseQuestion';
|
|
17
|
+
import getCaseList from '../_fetchers/getCaseList';
|
|
18
|
+
const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjIsImlhdCI6MTc0MDAxNDYzOCwiZXhwIjoxNzcxNTcyMjM4fQ.11ra7DkzlOVmBqDjo8SJTQnZDZdRHXjjU3ujK8G3OOY';
|
|
19
|
+
// 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjMsImVtYWlsIjoiNjAzMDgwNEBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzQwNDQ2Nzg1LCJleHAiOjE3NDA0ODI3ODV9.v_d7htci4fjLA5MqBXWxUqyNjsAm2GEcdRBO5se-DB8'; //빈거
|
|
20
|
+
export const actionGetCaseList = ({ tapState, pageNumber, pageSize }) => {
|
|
21
|
+
const { data, isLoading } = useQuery({
|
|
22
|
+
queryKey: ['case', tapState, pageNumber, pageSize],
|
|
23
|
+
queryFn: () => getCaseList({
|
|
24
|
+
jwt: jwt,
|
|
25
|
+
size: pageSize,
|
|
26
|
+
page: pageNumber
|
|
27
|
+
}),
|
|
28
|
+
//브라우저 화면을 focus할 때 새로 api를 호출할 건지 설정하는 옵션
|
|
29
|
+
refetchOnWindowFocus: false,
|
|
30
|
+
//기본설정 cacheTime:5분, staleTime:0초, 값을 Infinity로 설정할 경우 api return 값이 바뀌지 않는 이상 서버에 새로 요청하지 않고 캐싱된 데이터를 영구적으로 사용하여 api 호출 최적화
|
|
31
|
+
// cacheTime: 0,
|
|
32
|
+
gcTime: 0,
|
|
33
|
+
staleTime: 0
|
|
34
|
+
});
|
|
35
|
+
return { data, isLoading };
|
|
36
|
+
};
|
|
37
|
+
export const actionGetDetailList = (id) => {
|
|
38
|
+
const { data, isLoading } = useQuery({
|
|
39
|
+
queryKey: ['case', id],
|
|
40
|
+
queryFn: () => getCase({
|
|
41
|
+
jwt: jwt,
|
|
42
|
+
id: id
|
|
43
|
+
}),
|
|
44
|
+
//브라우저 화면을 focus할 때 새로 api를 호출할 건지 설정하는 옵션
|
|
45
|
+
refetchOnWindowFocus: false,
|
|
46
|
+
//기본설정 cacheTime:5분, staleTime:0초, 값을 Infinity로 설정할 경우 api return 값이 바뀌지 않는 이상 서버에 새로 요청하지 않고 캐싱된 데이터를 영구적으로 사용하여 api 호출 최적화
|
|
47
|
+
gcTime: 0,
|
|
48
|
+
staleTime: 0,
|
|
49
|
+
enabled: !!id
|
|
50
|
+
// onSuccess: res => {},
|
|
51
|
+
// onError: error => {
|
|
52
|
+
// console.log(error);
|
|
53
|
+
// }
|
|
54
|
+
});
|
|
55
|
+
return { data, isLoading };
|
|
56
|
+
};
|
|
57
|
+
export const actionGetTimeLine = (id) => {
|
|
58
|
+
const { data, isLoading } = useQuery({
|
|
59
|
+
queryKey: ['case', 'timeline', id],
|
|
60
|
+
queryFn: () => getTimeLine({
|
|
61
|
+
jwt: jwt,
|
|
62
|
+
id: id
|
|
63
|
+
}),
|
|
64
|
+
gcTime: 0,
|
|
65
|
+
staleTime: 0,
|
|
66
|
+
enabled: !!id
|
|
67
|
+
// onSuccess: res => {},
|
|
68
|
+
// onError: error => {
|
|
69
|
+
// console.log(error);
|
|
70
|
+
// }
|
|
71
|
+
});
|
|
72
|
+
return { data, isLoading };
|
|
73
|
+
};
|
|
74
|
+
export const actionGetCourtFileList = (id) => {
|
|
75
|
+
const { data, isLoading } = useQuery({
|
|
76
|
+
queryKey: ['case', 'courtFileList', id],
|
|
77
|
+
queryFn: () => getCourtFileList({
|
|
78
|
+
jwt: jwt,
|
|
79
|
+
id: id
|
|
80
|
+
}),
|
|
81
|
+
gcTime: 0,
|
|
82
|
+
staleTime: 0,
|
|
83
|
+
enabled: !!id
|
|
84
|
+
// onSuccess: res => {},
|
|
85
|
+
// onError: error => {
|
|
86
|
+
// console.log(error);
|
|
87
|
+
// }
|
|
88
|
+
});
|
|
89
|
+
return { data, isLoading };
|
|
90
|
+
};
|
|
91
|
+
export const actionGetMyFileList = (id) => {
|
|
92
|
+
const { data, isLoading } = useQuery({
|
|
93
|
+
queryKey: ['case', 'myFileList', id],
|
|
94
|
+
queryFn: () => getMyFileList({
|
|
95
|
+
jwt: jwt,
|
|
96
|
+
id: id
|
|
97
|
+
}),
|
|
98
|
+
gcTime: 0,
|
|
99
|
+
staleTime: 0,
|
|
100
|
+
enabled: !!id
|
|
101
|
+
// onSuccess: res => {},
|
|
102
|
+
// onError: error => {
|
|
103
|
+
// console.log(error);
|
|
104
|
+
// }
|
|
105
|
+
});
|
|
106
|
+
return { data, isLoading };
|
|
107
|
+
};
|
|
108
|
+
export const actionGetMyCaseQuestion = (id, page, pageSize) => {
|
|
109
|
+
const { data, isLoading, refetch } = useQuery({
|
|
110
|
+
queryKey: ['case', 'myCaseQuestion', id, page, pageSize],
|
|
111
|
+
queryFn: () => getMyCaseQuestion({
|
|
112
|
+
jwt: jwt,
|
|
113
|
+
id: id,
|
|
114
|
+
page: page,
|
|
115
|
+
size: pageSize
|
|
116
|
+
}),
|
|
117
|
+
gcTime: 0,
|
|
118
|
+
staleTime: 0,
|
|
119
|
+
enabled: !!id
|
|
120
|
+
// onSuccess: res => {},
|
|
121
|
+
// onError: error => {
|
|
122
|
+
// console.log(error);
|
|
123
|
+
// }
|
|
124
|
+
});
|
|
125
|
+
return { data, isLoading, refetch };
|
|
126
|
+
};
|
|
127
|
+
export const actionPostMyCaseQuestion = (id, content) => {
|
|
128
|
+
const { mutateAsync, status } = useMutation({
|
|
129
|
+
mutationFn: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
130
|
+
return yield addMyCaseQuestion({
|
|
131
|
+
jwt: jwt,
|
|
132
|
+
id: id,
|
|
133
|
+
content: content
|
|
134
|
+
});
|
|
135
|
+
}),
|
|
136
|
+
onSuccess: res => { },
|
|
137
|
+
onError: error => {
|
|
138
|
+
console.log(error);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
const isLoading = status === 'pending';
|
|
142
|
+
return { mutateAsync, isLoading };
|
|
143
|
+
};
|