@daeryun/dr_components 0.2.99 → 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/banner/TopBanner.jsx +14 -11
- package/dist/components/banner/TopBanner.tsx +15 -12
- 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 +2 -2
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useMutation, useQuery } from '@tanstack/react-query';
|
|
3
|
+
import { FetchType, DetailList, TimeLineType, FileList, Question } from '../_type/type';
|
|
4
|
+
import getCase from '../_fetchers/getCase';
|
|
5
|
+
import getTimeLine from '../_fetchers/getTimeLine';
|
|
6
|
+
import { t } from 'i18next';
|
|
7
|
+
import getCourtFileList from '../_fetchers/getCourtFileList';
|
|
8
|
+
import getMyFileList from '../_fetchers/getMyFileList';
|
|
9
|
+
import getMyCaseQuestion from '../_fetchers/getMyCaseQuestion';
|
|
10
|
+
import addMyCaseQuestion from '../_fetchers/addMyCaseQuestion';
|
|
11
|
+
import getCaseList from '../_fetchers/getCaseList';
|
|
12
|
+
|
|
13
|
+
const jwt =
|
|
14
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjIsImlhdCI6MTc0MDAxNDYzOCwiZXhwIjoxNzcxNTcyMjM4fQ.11ra7DkzlOVmBqDjo8SJTQnZDZdRHXjjU3ujK8G3OOY';
|
|
15
|
+
// 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjMsImVtYWlsIjoiNjAzMDgwNEBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzQwNDQ2Nzg1LCJleHAiOjE3NDA0ODI3ODV9.v_d7htci4fjLA5MqBXWxUqyNjsAm2GEcdRBO5se-DB8'; //빈거
|
|
16
|
+
|
|
17
|
+
export const useGetCaseList = ({
|
|
18
|
+
tapState,
|
|
19
|
+
subTapState,
|
|
20
|
+
pageNumber,
|
|
21
|
+
pageSize
|
|
22
|
+
}: {
|
|
23
|
+
tapState: string;
|
|
24
|
+
subTapState: string;
|
|
25
|
+
pageNumber: number;
|
|
26
|
+
pageSize: number;
|
|
27
|
+
}) => {
|
|
28
|
+
const { data, isLoading } = useQuery({
|
|
29
|
+
queryKey: ['case', tapState, subTapState, pageNumber, pageSize],
|
|
30
|
+
queryFn: () =>
|
|
31
|
+
getCaseList({
|
|
32
|
+
jwt: jwt,
|
|
33
|
+
size: pageSize,
|
|
34
|
+
state: subTapState as string,
|
|
35
|
+
page: pageNumber
|
|
36
|
+
}),
|
|
37
|
+
//브라우저 화면을 focus할 때 새로 api를 호출할 건지 설정하는 옵션
|
|
38
|
+
refetchOnWindowFocus: false,
|
|
39
|
+
|
|
40
|
+
//기본설정 cacheTime:5분, staleTime:0초, 값을 Infinity로 설정할 경우 api return 값이 바뀌지 않는 이상 서버에 새로 요청하지 않고 캐싱된 데이터를 영구적으로 사용하여 api 호출 최적화
|
|
41
|
+
// cacheTime: 0,
|
|
42
|
+
gcTime: 0,
|
|
43
|
+
staleTime: 0
|
|
44
|
+
});
|
|
45
|
+
return { data, isLoading };
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const useGetDetailList = (id: string) => {
|
|
49
|
+
const { data, isLoading } = useQuery<FetchType<DetailList>>({
|
|
50
|
+
queryKey: ['case', id],
|
|
51
|
+
queryFn: () =>
|
|
52
|
+
getCase({
|
|
53
|
+
jwt: jwt,
|
|
54
|
+
id: id as string
|
|
55
|
+
}),
|
|
56
|
+
//브라우저 화면을 focus할 때 새로 api를 호출할 건지 설정하는 옵션
|
|
57
|
+
refetchOnWindowFocus: false,
|
|
58
|
+
//기본설정 cacheTime:5분, staleTime:0초, 값을 Infinity로 설정할 경우 api return 값이 바뀌지 않는 이상 서버에 새로 요청하지 않고 캐싱된 데이터를 영구적으로 사용하여 api 호출 최적화
|
|
59
|
+
gcTime: 0,
|
|
60
|
+
staleTime: 0,
|
|
61
|
+
enabled: !!id
|
|
62
|
+
// onSuccess: res => {},
|
|
63
|
+
// onError: error => {
|
|
64
|
+
// console.log(error);
|
|
65
|
+
// }
|
|
66
|
+
});
|
|
67
|
+
return { data, isLoading };
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const useGetTimeLine = (id: string) => {
|
|
71
|
+
const { data, isLoading } = useQuery<FetchType<TimeLineType>>({
|
|
72
|
+
queryKey: ['case', 'timeline', id],
|
|
73
|
+
queryFn: () =>
|
|
74
|
+
getTimeLine({
|
|
75
|
+
jwt: jwt,
|
|
76
|
+
id: id as string
|
|
77
|
+
}),
|
|
78
|
+
gcTime: 0,
|
|
79
|
+
staleTime: 0,
|
|
80
|
+
enabled: !!id
|
|
81
|
+
// onSuccess: res => {},
|
|
82
|
+
// onError: error => {
|
|
83
|
+
// console.log(error);
|
|
84
|
+
// }
|
|
85
|
+
});
|
|
86
|
+
return { data, isLoading };
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const useGetCourtFileList = (id: string) => {
|
|
90
|
+
const { data, isLoading } = useQuery<FetchType<FileList[]>>({
|
|
91
|
+
queryKey: ['case', 'courtFileList', id],
|
|
92
|
+
queryFn: () =>
|
|
93
|
+
getCourtFileList({
|
|
94
|
+
jwt: jwt,
|
|
95
|
+
id: id as string
|
|
96
|
+
}),
|
|
97
|
+
gcTime: 0,
|
|
98
|
+
staleTime: 0,
|
|
99
|
+
enabled: !!id
|
|
100
|
+
// onSuccess: res => {},
|
|
101
|
+
// onError: error => {
|
|
102
|
+
// console.log(error);
|
|
103
|
+
// }
|
|
104
|
+
});
|
|
105
|
+
return { data, isLoading };
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const useGetMyFileList = (id: string) => {
|
|
109
|
+
const { data, isLoading } = useQuery<FetchType<FileList[]>>({
|
|
110
|
+
queryKey: ['case', 'myFileList', id],
|
|
111
|
+
queryFn: () =>
|
|
112
|
+
getMyFileList({
|
|
113
|
+
jwt: jwt,
|
|
114
|
+
id: id as string
|
|
115
|
+
}),
|
|
116
|
+
gcTime: 0,
|
|
117
|
+
staleTime: 0,
|
|
118
|
+
enabled: !!id
|
|
119
|
+
// onSuccess: res => {},
|
|
120
|
+
// onError: error => {
|
|
121
|
+
// console.log(error);
|
|
122
|
+
// }
|
|
123
|
+
});
|
|
124
|
+
return { data, isLoading };
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const useGetMyCaseQuestion = (id: string, page: number, pageSize: number) => {
|
|
128
|
+
const { data, isLoading, refetch } = useQuery<FetchType<Question[]>>({
|
|
129
|
+
queryKey: ['case', 'myCaseQuestion', id, page, pageSize],
|
|
130
|
+
queryFn: () =>
|
|
131
|
+
getMyCaseQuestion({
|
|
132
|
+
jwt: jwt,
|
|
133
|
+
id: id as string,
|
|
134
|
+
page: page,
|
|
135
|
+
size: pageSize
|
|
136
|
+
}),
|
|
137
|
+
gcTime: 0,
|
|
138
|
+
staleTime: 0,
|
|
139
|
+
enabled: !!id
|
|
140
|
+
// onSuccess: res => {},
|
|
141
|
+
// onError: error => {
|
|
142
|
+
// console.log(error);
|
|
143
|
+
// }
|
|
144
|
+
});
|
|
145
|
+
return { data, isLoading, refetch };
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export const usePostMyCaseQuestion = (id: string, content: string) => {
|
|
149
|
+
const { mutateAsync, status } = useMutation<FetchType<Question[]>>({
|
|
150
|
+
mutationFn: async () =>
|
|
151
|
+
await addMyCaseQuestion({
|
|
152
|
+
jwt: jwt,
|
|
153
|
+
id: id as string,
|
|
154
|
+
content: content as string
|
|
155
|
+
}),
|
|
156
|
+
|
|
157
|
+
onSuccess: res => {},
|
|
158
|
+
onError: error => {
|
|
159
|
+
console.log(error);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
const isLoading = status === 'pending';
|
|
164
|
+
return { mutateAsync, isLoading };
|
|
165
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import CaseLayout from './_layout/CaseLayout';
|
|
4
|
+
import SubColor1Button from './_button/SubColor1Button';
|
|
5
|
+
import CaseTable from './_table/CaseTable';
|
|
6
|
+
import EmptyTable from './_empty/EmptyTable';
|
|
7
|
+
import { useRouter } from 'next/router';
|
|
8
|
+
import Loading from './_loading/Loading';
|
|
9
|
+
import { useGetCaseList } from '../_actions/action';
|
|
10
|
+
import CaseTabSwiper from './_table/CaseTabSwiper';
|
|
11
|
+
import CaseTableMoPage from './_table/CaseTableMoPage';
|
|
12
|
+
// import { useCompatibleRouter } from '../../../lib/router/useCompatibleRouter';
|
|
13
|
+
const CaseTap = ({ title, type, tap, setTap }) => {
|
|
14
|
+
return (<button onClick={() => {
|
|
15
|
+
if (setTap) {
|
|
16
|
+
setTap(type);
|
|
17
|
+
}
|
|
18
|
+
}} className={`items-top sm-top:h-[40px] flex h-[29px] w-full justify-center border-b-[2px] border-solid transition-colors duration-300 lg:h-[45px] ${tap === type ? 'border-black text-black' : 'border-grayScale4 text-grayScale4'}`}>
|
|
19
|
+
<p className={'body_large1_mo sm-top:body_large1_tb lg:body_large1'}>{title}</p>
|
|
20
|
+
</button>);
|
|
21
|
+
};
|
|
22
|
+
const CaseContainer = () => {
|
|
23
|
+
// const { router, searchParams } = useCompatibleRouter();
|
|
24
|
+
const router = useRouter();
|
|
25
|
+
const { page, tap, subTap } = router.query;
|
|
26
|
+
// const searchParams = useSearchParams();
|
|
27
|
+
// const searchParams = useSearchParams();
|
|
28
|
+
// const { page, tap, subTap } = searchParams ? Object.fromEntries(searchParams.entries()) : {};
|
|
29
|
+
const tapState = tap ? tap : 'ongoing';
|
|
30
|
+
const subTapState = subTap ? subTap : tap ? tap : 'ongoing';
|
|
31
|
+
const [pageSize, setPageSize] = useState(6);
|
|
32
|
+
// const [isLoading, setIsLoading] = useState(true);
|
|
33
|
+
const pageNumber = page ? Number(page) : 1;
|
|
34
|
+
const handleOnChange = (pageNum) => {
|
|
35
|
+
router.push({
|
|
36
|
+
pathname: '/mycase',
|
|
37
|
+
query: { page: pageNum, tap, subTap }
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
const handleOnTap = (tap) => {
|
|
41
|
+
router.push({
|
|
42
|
+
pathname: '/mycase',
|
|
43
|
+
query: { page, tap, subTap: tap === 'ongoing' ? 'ongoing' : 'closed' }
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
const handleOnSubTap = (subTap) => {
|
|
47
|
+
router.push({
|
|
48
|
+
pathname: '/mycase',
|
|
49
|
+
query: { page: 1, tap, subTap }
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const { data, isLoading } = useGetCaseList({
|
|
53
|
+
tapState,
|
|
54
|
+
subTapState,
|
|
55
|
+
pageNumber,
|
|
56
|
+
pageSize
|
|
57
|
+
});
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
const handleResize = () => {
|
|
60
|
+
setPageSize(window.innerWidth < 721 ? 3 : 6);
|
|
61
|
+
}; // 300ms 딜레이
|
|
62
|
+
window.addEventListener('resize', handleResize);
|
|
63
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
64
|
+
}, []);
|
|
65
|
+
return (<CaseLayout outerClassName="mt-[230px] sm-top:mt-[310px] lg:mt-[294px] " innerClassName={'py-[40px] sm-top:py-[52px] lg:py-[60px]'} isMobilePadding={false}>
|
|
66
|
+
<div className={''}>
|
|
67
|
+
<div className="sm-top:px-[50px] flex flex-row items-center px-[20px] 2sm:px-[40px] lg:px-[60px]">
|
|
68
|
+
<CaseTap title="진행중인 사건" type="ongoing" tap={tapState} setTap={handleOnTap}/>
|
|
69
|
+
<CaseTap title="종결된 사건" type="closed" tap={tapState} setTap={handleOnTap}/>
|
|
70
|
+
</div>
|
|
71
|
+
<div className={'sm-top:px-[50px] sm-top:py-[16px] py-[22px] lg:my-[20px] lg:px-[60px]'}>
|
|
72
|
+
{tapState === 'ongoing' ? (<>
|
|
73
|
+
<div className="max-sm-top:hidden sm-top:gap-[12px] flex flex-row md2:gap-[20px] lg:gap-[28px] ">
|
|
74
|
+
<SubColor1Button title="전체" onClick={() => handleOnSubTap('ongoing')} isSelected={subTapState === 'ongoing'}/>
|
|
75
|
+
|
|
76
|
+
<SubColor1Button title="사건접수" onClick={() => handleOnSubTap('사건접수')} isSelected={subTapState === '사건접수'}/>
|
|
77
|
+
<SubColor1Button title="사건검토" onClick={() => handleOnSubTap('사건검토')} isSelected={subTapState === '사건검토'}/>
|
|
78
|
+
<SubColor1Button title="변호사상담" onClick={() => handleOnSubTap('변호사상담')} isSelected={subTapState === '변호사상담'}/>
|
|
79
|
+
|
|
80
|
+
<SubColor1Button title="소송준비" onClick={() => handleOnSubTap('소송준비')} isSelected={subTapState === '소송준비'}/>
|
|
81
|
+
<SubColor1Button title="소송진행" onClick={() => handleOnSubTap('소송진행')} isSelected={subTapState === '소송진행'}/>
|
|
82
|
+
</div>
|
|
83
|
+
<div className="sm-top:hidden">
|
|
84
|
+
<CaseTabSwiper id="case-tab-swiper" scrollClassName="max-[585px]:!block">
|
|
85
|
+
<SubColor1Button title="전체" onClick={() => handleOnSubTap('ongoing')} isSelected={subTapState === 'ongoing'} outerClassName="ml-[20px] 2sm:ml-[40px]"/>
|
|
86
|
+
|
|
87
|
+
<SubColor1Button title="사건접수" onClick={() => handleOnSubTap('사건접수')} isSelected={subTapState === '사건접수'}/>
|
|
88
|
+
<SubColor1Button title="사건검토" onClick={() => handleOnSubTap('사건검토')} isSelected={subTapState === '사건검토'}/>
|
|
89
|
+
<SubColor1Button title="변호사상담" onClick={() => handleOnSubTap('변호사상담')} isSelected={subTapState === '변호사상담'}/>
|
|
90
|
+
|
|
91
|
+
<SubColor1Button title="소송준비" onClick={() => handleOnSubTap('소송준비')} isSelected={subTapState === '소송준비'}/>
|
|
92
|
+
<SubColor1Button title="소송진행" onClick={() => handleOnSubTap('소송진행')} isSelected={subTapState === '소송진행'}/>
|
|
93
|
+
</CaseTabSwiper>
|
|
94
|
+
</div>
|
|
95
|
+
</>) : (<>
|
|
96
|
+
<div className="max-sm-top:hidden sm-top:gap-[12px] flex flex-row md2:gap-[20px] lg:gap-[28px] ">
|
|
97
|
+
<SubColor1Button title="전체" onClick={() => handleOnSubTap('closed')} isSelected={subTapState === 'closed'}/>
|
|
98
|
+
<SubColor1Button title="사건종결" onClick={() => handleOnSubTap('사건종결')} isSelected={subTapState === '사건종결'}/>
|
|
99
|
+
<SubColor1Button title="환불" onClick={() => handleOnSubTap('환불')} isSelected={subTapState === '환불'}/>
|
|
100
|
+
</div>
|
|
101
|
+
<div className="sm-top:hidden">
|
|
102
|
+
<CaseTabSwiper id="case-tab-swiper">
|
|
103
|
+
<SubColor1Button title="전체" onClick={() => handleOnSubTap('closed')} isSelected={subTapState === 'closed'} outerClassName="ml-[20px] 2sm:ml-[40px]"/>
|
|
104
|
+
<SubColor1Button title="사건종결" onClick={() => handleOnSubTap('사건종결')} isSelected={subTapState === '사건종결'}/>
|
|
105
|
+
<SubColor1Button title="환불" onClick={() => handleOnSubTap('환불')} isSelected={subTapState === '환불'}/>
|
|
106
|
+
</CaseTabSwiper>
|
|
107
|
+
</div>
|
|
108
|
+
</>)}
|
|
109
|
+
</div>
|
|
110
|
+
{isLoading ? (<Loading />) : (data === null || data === void 0 ? void 0 : data.list.length) > 0 ? (<>
|
|
111
|
+
<CaseTable list={data === null || data === void 0 ? void 0 : data.list} totalLength={data === null || data === void 0 ? void 0 : data.totalLength} pageSize={pageSize} pageNumber={pageNumber} onChange={handleOnChange}/>
|
|
112
|
+
<CaseTableMoPage list={data === null || data === void 0 ? void 0 : data.list} totalLength={data === null || data === void 0 ? void 0 : data.totalLength} pageSize={pageSize} pageNumber={pageNumber} onChange={handleOnChange}/>
|
|
113
|
+
</>) : (<EmptyTable tap={tapState} subTap={subTapState === 'ongoing' || subTapState === 'closed' ? 0 : 1}/>)}
|
|
114
|
+
</div>
|
|
115
|
+
</CaseLayout>);
|
|
116
|
+
};
|
|
117
|
+
export default CaseContainer;
|