@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.
Files changed (135) hide show
  1. package/dist/asset/images/myCase/icon/check_box.webp +0 -0
  2. package/dist/asset/images/myCase/icon/check_box_gray.webp +0 -0
  3. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  4. package/dist/components/ViewMoreSection/ViewMoreSection.jsx +1 -1
  5. package/dist/components/ViewMoreSection/ViewMoreSection.tsx +1 -1
  6. package/dist/components/banner/TopBanner.stories.jsx +8 -4
  7. package/dist/components/banner/TopBanner.stories.tsx +8 -4
  8. package/dist/components/page/MyCase/MyCasePage.d.ts +3 -0
  9. package/dist/components/page/MyCase/MyCasePage.jsx +21 -0
  10. package/dist/components/page/MyCase/MyCasePage.tsx +33 -0
  11. package/dist/components/page/MyCase/[id]/MyCaseDetailPage.d.ts +3 -0
  12. package/dist/components/page/MyCase/[id]/MyCaseDetailPage.jsx +78 -0
  13. package/dist/components/page/MyCase/[id]/MyCaseDetailPage.tsx +156 -0
  14. package/dist/components/page/MyCase/[id]/_component/ContactInfo.d.ts +2 -0
  15. package/dist/components/page/MyCase/[id]/_component/ContactInfo.jsx +89 -0
  16. package/dist/components/page/MyCase/[id]/_component/ContactInfo.tsx +115 -0
  17. package/dist/components/page/MyCase/[id]/_component/DetailInfo.d.ts +6 -0
  18. package/dist/components/page/MyCase/[id]/_component/DetailInfo.jsx +44 -0
  19. package/dist/components/page/MyCase/[id]/_component/DetailInfo.tsx +93 -0
  20. package/dist/components/page/MyCase/[id]/_component/TimeLine.d.ts +6 -0
  21. package/dist/components/page/MyCase/[id]/_component/TimeLine.jsx +46 -0
  22. package/dist/components/page/MyCase/[id]/_component/TimeLine.tsx +73 -0
  23. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.d.ts +11 -0
  24. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.jsx +80 -0
  25. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.tsx +187 -0
  26. package/dist/components/page/MyCase/[id]/_component/_document/Document.d.ts +6 -0
  27. package/dist/components/page/MyCase/[id]/_component/_document/Document.jsx +31 -0
  28. package/dist/components/page/MyCase/[id]/_component/_document/Document.tsx +53 -0
  29. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.d.ts +6 -0
  30. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.jsx +44 -0
  31. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.tsx +61 -0
  32. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryAddModal.d.ts +7 -0
  33. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryAddModal.jsx +107 -0
  34. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryAddModal.tsx +150 -0
  35. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryConfirmModal.d.ts +7 -0
  36. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryConfirmModal.jsx +24 -0
  37. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryConfirmModal.tsx +57 -0
  38. package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.d.ts +5 -0
  39. package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.jsx +37 -0
  40. package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.tsx +59 -0
  41. package/dist/components/page/MyCase/[id]/_component/_modal/ModalCotainer.d.ts +7 -0
  42. package/dist/components/page/MyCase/[id]/_component/_modal/ModalCotainer.jsx +26 -0
  43. package/dist/components/page/MyCase/[id]/_component/_modal/ModalCotainer.tsx +39 -0
  44. package/dist/components/page/MyCase/[id]/_component/_textarea/TextArea.d.ts +7 -0
  45. package/dist/components/page/MyCase/[id]/_component/_textarea/TextArea.jsx +4 -0
  46. package/dist/components/page/MyCase/[id]/_component/_textarea/TextArea.tsx +24 -0
  47. package/dist/components/page/MyCase/_actions/action.d.ts +34 -0
  48. package/dist/components/page/MyCase/_actions/action.js +143 -0
  49. package/dist/components/page/MyCase/_actions/action.ts +163 -0
  50. package/dist/components/page/MyCase/_component/CaseContainer.d.ts +2 -0
  51. package/dist/components/page/MyCase/_component/CaseContainer.jsx +194 -0
  52. package/dist/components/page/MyCase/_component/CaseContainer.tsx +242 -0
  53. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenu.d.ts +8 -0
  54. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenu.jsx +43 -0
  55. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenu.tsx +73 -0
  56. package/dist/components/page/MyCase/_component/_button/Badge.d.ts +14 -0
  57. package/dist/components/page/MyCase/_component/_button/Badge.jsx +16 -0
  58. package/dist/components/page/MyCase/_component/_button/Badge.tsx +22 -0
  59. package/dist/components/page/MyCase/_component/_button/SubColor1Button.d.ts +7 -0
  60. package/dist/components/page/MyCase/_component/_button/SubColor1Button.jsx +9 -0
  61. package/dist/components/page/MyCase/_component/_button/SubColor1Button.tsx +33 -0
  62. package/dist/components/page/MyCase/_component/_button/SubMenuButton.d.ts +7 -0
  63. package/dist/components/page/MyCase/_component/_button/SubMenuButton.jsx +9 -0
  64. package/dist/components/page/MyCase/_component/_button/SubMenuButton.tsx +31 -0
  65. package/dist/components/page/MyCase/_component/_empty/EmptyTable.d.ts +6 -0
  66. package/dist/components/page/MyCase/_component/_empty/EmptyTable.jsx +75 -0
  67. package/dist/components/page/MyCase/_component/_empty/EmptyTable.tsx +86 -0
  68. package/dist/components/page/MyCase/_component/_layout/CaseLayout.d.ts +7 -0
  69. package/dist/components/page/MyCase/_component/_layout/CaseLayout.jsx +11 -0
  70. package/dist/components/page/MyCase/_component/_layout/CaseLayout.tsx +29 -0
  71. package/dist/components/page/MyCase/_component/_layout/CaseWrapper.d.ts +12 -0
  72. package/dist/components/page/MyCase/_component/_layout/CaseWrapper.jsx +25 -0
  73. package/dist/components/page/MyCase/_component/_layout/CaseWrapper.tsx +41 -0
  74. package/dist/components/page/MyCase/_component/_layout/HeaderLayout.d.ts +4 -0
  75. package/dist/components/page/MyCase/_component/_layout/HeaderLayout.jsx +4 -0
  76. package/dist/components/page/MyCase/_component/_layout/HeaderLayout.tsx +5 -0
  77. package/dist/components/page/MyCase/_component/_layout/IntroWrapper.d.ts +9 -0
  78. package/dist/components/page/MyCase/_component/_layout/IntroWrapper.jsx +30 -0
  79. package/dist/components/page/MyCase/_component/_layout/IntroWrapper.tsx +71 -0
  80. package/dist/components/page/MyCase/_component/_loading/Loading.d.ts +2 -0
  81. package/dist/components/page/MyCase/_component/_loading/Loading.jsx +89 -0
  82. package/dist/components/page/MyCase/_component/_loading/Loading.tsx +92 -0
  83. package/dist/components/page/MyCase/_component/_pagination/PaginationComponent.d.ts +10 -0
  84. package/dist/components/page/MyCase/_component/_pagination/PaginationComponent.jsx +80 -0
  85. package/dist/components/page/MyCase/_component/_pagination/PaginationComponent.tsx +133 -0
  86. package/dist/components/page/MyCase/_component/_table/CaseLine.d.ts +5 -0
  87. package/dist/components/page/MyCase/_component/_table/CaseLine.jsx +66 -0
  88. package/dist/components/page/MyCase/_component/_table/CaseLine.tsx +139 -0
  89. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.d.ts +9 -0
  90. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.jsx +65 -0
  91. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.tsx +79 -0
  92. package/dist/components/page/MyCase/_component/_table/CaseTable.d.ts +9 -0
  93. package/dist/components/page/MyCase/_component/_table/CaseTable.jsx +62 -0
  94. package/dist/components/page/MyCase/_component/_table/CaseTable.tsx +93 -0
  95. package/dist/components/page/MyCase/_component/_table/CaseTableMo.d.ts +9 -0
  96. package/dist/components/page/MyCase/_component/_table/CaseTableMo.jsx +11 -0
  97. package/dist/components/page/MyCase/_component/_table/CaseTableMo.tsx +28 -0
  98. package/dist/components/page/MyCase/_component/_table/CaseTableMoBox.d.ts +5 -0
  99. package/dist/components/page/MyCase/_component/_table/CaseTableMoBox.jsx +39 -0
  100. package/dist/components/page/MyCase/_component/_table/CaseTableMoBox.tsx +55 -0
  101. package/dist/components/page/MyCase/_fetchers/addMyCaseQuestion.d.ts +6 -0
  102. package/dist/components/page/MyCase/_fetchers/addMyCaseQuestion.js +31 -0
  103. package/dist/components/page/MyCase/_fetchers/addMyCaseQuestion.ts +22 -0
  104. package/dist/components/page/MyCase/_fetchers/getCase.d.ts +5 -0
  105. package/dist/components/page/MyCase/_fetchers/getCase.js +30 -0
  106. package/dist/components/page/MyCase/_fetchers/getCase.ts +21 -0
  107. package/dist/components/page/MyCase/_fetchers/getCaseList.d.ts +6 -0
  108. package/dist/components/page/MyCase/_fetchers/getCaseList.js +30 -0
  109. package/dist/components/page/MyCase/_fetchers/getCaseList.ts +21 -0
  110. package/dist/components/page/MyCase/_fetchers/getCourtFileList.d.ts +5 -0
  111. package/dist/components/page/MyCase/_fetchers/getCourtFileList.js +30 -0
  112. package/dist/components/page/MyCase/_fetchers/getCourtFileList.ts +21 -0
  113. package/dist/components/page/MyCase/_fetchers/getMyCaseQuestion.d.ts +7 -0
  114. package/dist/components/page/MyCase/_fetchers/getMyCaseQuestion.js +30 -0
  115. package/dist/components/page/MyCase/_fetchers/getMyCaseQuestion.ts +24 -0
  116. package/dist/components/page/MyCase/_fetchers/getMyFileList.d.ts +5 -0
  117. package/dist/components/page/MyCase/_fetchers/getMyFileList.js +30 -0
  118. package/dist/components/page/MyCase/_fetchers/getMyFileList.ts +21 -0
  119. package/dist/components/page/MyCase/_fetchers/getTimeLine.d.ts +5 -0
  120. package/dist/components/page/MyCase/_fetchers/getTimeLine.js +30 -0
  121. package/dist/components/page/MyCase/_fetchers/getTimeLine.ts +21 -0
  122. package/dist/components/page/MyCase/_lib/catagoryMenuName.d.ts +8 -0
  123. package/dist/components/page/MyCase/_lib/catagoryMenuName.js +8 -0
  124. package/dist/components/page/MyCase/_lib/catagoryMenuName.ts +11 -0
  125. package/dist/components/page/MyCase/_lib/pagination/locale/ko_KR.d.ts +15 -0
  126. package/dist/components/page/MyCase/_lib/pagination/locale/ko_KR.js +21 -0
  127. package/dist/components/page/MyCase/_type/type.d.ts +73 -0
  128. package/dist/components/page/MyCase/_type/type.js +1 -0
  129. package/dist/components/page/MyCase/_type/type.ts +81 -0
  130. package/dist/components/page/index.d.ts +1 -0
  131. package/dist/components/page/index.js +1 -1
  132. package/dist/components/page/index.ts +1 -1
  133. package/dist/styles/globals.css +2332 -235
  134. package/dist/tsconfig.tsbuildinfo +1 -1
  135. package/package.json +1 -1
@@ -0,0 +1,163 @@
1
+ import { useMutation, useQuery } from '@tanstack/react-query';
2
+ import { FetchType, DetailList, TimeLineType, FileList, Question } from '../_type/type';
3
+ import getCase from '../_fetchers/getCase';
4
+ import getTimeLine from '../_fetchers/getTimeLine';
5
+
6
+ import getCourtFileList from '../_fetchers/getCourtFileList';
7
+ import getMyFileList from '../_fetchers/getMyFileList';
8
+ import getMyCaseQuestion from '../_fetchers/getMyCaseQuestion';
9
+ import addMyCaseQuestion from '../_fetchers/addMyCaseQuestion';
10
+ import getCaseList from '../_fetchers/getCaseList';
11
+
12
+ const jwt =
13
+ 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjIsImlhdCI6MTc0MDAxNDYzOCwiZXhwIjoxNzcxNTcyMjM4fQ.11ra7DkzlOVmBqDjo8SJTQnZDZdRHXjjU3ujK8G3OOY';
14
+ // 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjMsImVtYWlsIjoiNjAzMDgwNEBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzQwNDQ2Nzg1LCJleHAiOjE3NDA0ODI3ODV9.v_d7htci4fjLA5MqBXWxUqyNjsAm2GEcdRBO5se-DB8'; //빈거
15
+
16
+ export const actionGetCaseList = ({
17
+ tapState,
18
+
19
+ pageNumber,
20
+ pageSize
21
+ }: {
22
+ tapState: string;
23
+
24
+ pageNumber: number;
25
+ pageSize: number;
26
+ }) => {
27
+ const { data, isLoading } = useQuery({
28
+ queryKey: ['case', tapState, pageNumber, pageSize],
29
+ queryFn: () =>
30
+ getCaseList({
31
+ jwt: jwt,
32
+ size: pageSize,
33
+ page: pageNumber
34
+ }),
35
+ //브라우저 화면을 focus할 때 새로 api를 호출할 건지 설정하는 옵션
36
+ refetchOnWindowFocus: false,
37
+
38
+ //기본설정 cacheTime:5분, staleTime:0초, 값을 Infinity로 설정할 경우 api return 값이 바뀌지 않는 이상 서버에 새로 요청하지 않고 캐싱된 데이터를 영구적으로 사용하여 api 호출 최적화
39
+ // cacheTime: 0,
40
+ gcTime: 0,
41
+ staleTime: 0
42
+ });
43
+ return { data, isLoading };
44
+ };
45
+
46
+ export const actionGetDetailList = (id: string) => {
47
+ const { data, isLoading } = useQuery<FetchType<DetailList>>({
48
+ queryKey: ['case', id],
49
+ queryFn: () =>
50
+ getCase({
51
+ jwt: jwt,
52
+ id: id as string
53
+ }),
54
+ //브라우저 화면을 focus할 때 새로 api를 호출할 건지 설정하는 옵션
55
+ refetchOnWindowFocus: false,
56
+ //기본설정 cacheTime:5분, staleTime:0초, 값을 Infinity로 설정할 경우 api return 값이 바뀌지 않는 이상 서버에 새로 요청하지 않고 캐싱된 데이터를 영구적으로 사용하여 api 호출 최적화
57
+ gcTime: 0,
58
+ staleTime: 0,
59
+ enabled: !!id
60
+ // onSuccess: res => {},
61
+ // onError: error => {
62
+ // console.log(error);
63
+ // }
64
+ });
65
+ return { data, isLoading };
66
+ };
67
+
68
+ export const actionGetTimeLine = (id: string) => {
69
+ const { data, isLoading } = useQuery<FetchType<TimeLineType>>({
70
+ queryKey: ['case', 'timeline', id],
71
+ queryFn: () =>
72
+ getTimeLine({
73
+ jwt: jwt,
74
+ id: id as string
75
+ }),
76
+ gcTime: 0,
77
+ staleTime: 0,
78
+ enabled: !!id
79
+ // onSuccess: res => {},
80
+ // onError: error => {
81
+ // console.log(error);
82
+ // }
83
+ });
84
+ return { data, isLoading };
85
+ };
86
+
87
+ export const actionGetCourtFileList = (id: string) => {
88
+ const { data, isLoading } = useQuery<FetchType<FileList[]>>({
89
+ queryKey: ['case', 'courtFileList', id],
90
+ queryFn: () =>
91
+ getCourtFileList({
92
+ jwt: jwt,
93
+ id: id as string
94
+ }),
95
+ gcTime: 0,
96
+ staleTime: 0,
97
+ enabled: !!id
98
+ // onSuccess: res => {},
99
+ // onError: error => {
100
+ // console.log(error);
101
+ // }
102
+ });
103
+ return { data, isLoading };
104
+ };
105
+
106
+ export const actionGetMyFileList = (id: string) => {
107
+ const { data, isLoading } = useQuery<FetchType<FileList[]>>({
108
+ queryKey: ['case', 'myFileList', id],
109
+ queryFn: () =>
110
+ getMyFileList({
111
+ jwt: jwt,
112
+ id: id as string
113
+ }),
114
+ gcTime: 0,
115
+ staleTime: 0,
116
+ enabled: !!id
117
+ // onSuccess: res => {},
118
+ // onError: error => {
119
+ // console.log(error);
120
+ // }
121
+ });
122
+ return { data, isLoading };
123
+ };
124
+
125
+ export const actionGetMyCaseQuestion = (id: string, page: number, pageSize: number) => {
126
+ const { data, isLoading, refetch } = useQuery<FetchType<Question[]>>({
127
+ queryKey: ['case', 'myCaseQuestion', id, page, pageSize],
128
+ queryFn: () =>
129
+ getMyCaseQuestion({
130
+ jwt: jwt,
131
+ id: id as string,
132
+ page: page,
133
+ size: pageSize
134
+ }),
135
+ gcTime: 0,
136
+ staleTime: 0,
137
+ enabled: !!id
138
+ // onSuccess: res => {},
139
+ // onError: error => {
140
+ // console.log(error);
141
+ // }
142
+ });
143
+ return { data, isLoading, refetch };
144
+ };
145
+
146
+ export const actionPostMyCaseQuestion = (id: string, content: string) => {
147
+ const { mutateAsync, status } = useMutation<FetchType<Question[]>>({
148
+ mutationFn: async () =>
149
+ await addMyCaseQuestion({
150
+ jwt: jwt,
151
+ id: id as string,
152
+ content: content as string
153
+ }),
154
+
155
+ onSuccess: res => {},
156
+ onError: error => {
157
+ console.log(error);
158
+ }
159
+ });
160
+
161
+ const isLoading = status === 'pending';
162
+ return { mutateAsync, isLoading };
163
+ };
@@ -0,0 +1,2 @@
1
+ declare const CaseContainer: () => import("react").JSX.Element;
2
+ export default CaseContainer;
@@ -0,0 +1,194 @@
1
+ import { useState } from 'react';
2
+ import CaseLayout from './_layout/CaseLayout';
3
+ import EmptyTable from './_empty/EmptyTable';
4
+ import { useRouter, useSearchParams } from 'next/navigation';
5
+ import Loading from './_loading/Loading';
6
+ import { actionGetCaseList } from '../_actions/action';
7
+ import CaseTableMo from './_table/CaseTableMo';
8
+ const CaseTap = ({ title, type, tap, setTap }) => {
9
+ return (<button onClick={() => {
10
+ if (setTap) {
11
+ setTap(type);
12
+ }
13
+ }} className={`items-top flex h-[29px] w-full justify-center border-b-[2px] border-solid transition-colors duration-300 sm-top:h-[40px] lg:h-[45px] ${tap === type ? 'border-black text-black' : 'border-grayScale4 text-grayScale4'}`}>
14
+ <p className={'body_large1_mo sm-top:body_large1_tb lg:body_large1'}>{title}</p>
15
+ </button>);
16
+ };
17
+ const CaseContainer = () => {
18
+ const router = useRouter();
19
+ const searchParams = useSearchParams();
20
+ const { page, tap, subTap } = Object.fromEntries(searchParams.entries());
21
+ const tapState = tap ? tap : 'ongoing';
22
+ // const subTapState = subTap ? (subTap as string) : tap ? (tap as string) : 'ongoing';
23
+ const [pageSize, setPageSize] = useState(4);
24
+ const [caseList, setCaseList] = useState([]);
25
+ const [totalLength, setTotalLength] = useState(0);
26
+ // const [isLoading, setIsLoading] = useState(true);
27
+ const pageNumber = page ? Number(page) : 1;
28
+ const handleOnChange = (pageNum) => {
29
+ router.push(`/mycase?page=${pageNum}&tap=${tap}&subTap=${subTap}`);
30
+ };
31
+ const handleOnTap = (tap) => {
32
+ router.push(`/mycase?page=${page}&tap=${tap}&subTap=${tap === 'ongoing' ? 'ongoing' : 'closed'}`);
33
+ };
34
+ // const handleOnSubTap = (subTap: string) => {
35
+ // router.push(`/mycase?page=1&tap=${tapState}&subTap=${subTap}`);
36
+ // };
37
+ const { data, isLoading } = actionGetCaseList({
38
+ tapState,
39
+ pageNumber,
40
+ pageSize
41
+ });
42
+ // useEffect(() => {
43
+ // const handleResize = () => {
44
+ // setPageSize(window.innerWidth < 721 ? 3 : 6);
45
+ // }; // 300ms 딜레이
46
+ // window.addEventListener('resize', handleResize);
47
+ // return () => window.removeEventListener('resize', handleResize);
48
+ // }, []);
49
+ return (<CaseLayout outerClassName="mt-[230px] sm-top:mt-[310px] lg:mt-[294px] " innerClassName={'py-[40px] sm-top:py-[52px] lg:py-[60px]'} isMobilePadding={false}>
50
+ <div className={''}>
51
+ <div className="flex flex-row items-center px-[20px] 2sm:px-[40px] sm-top:px-[50px] lg:px-[60px]">
52
+ <CaseTap title="진행중인 사건" type="ongoing" tap={tapState} setTap={handleOnTap}/>
53
+ <CaseTap title="종결된 사건" type="closed" tap={tapState} setTap={handleOnTap}/>
54
+ </div>
55
+ {/* <div className={'py-[22px] sm-top:px-[50px] sm-top:py-[16px] lg:my-[20px] lg:px-[60px]'}>
56
+ {tapState === 'ongoing' ? (
57
+ <>
58
+ <div className="flex flex-row max-sm-top:hidden sm-top:gap-[12px] md2:gap-[20px] lg:gap-[28px] ">
59
+ <SubColor1Button
60
+ title="전체"
61
+ onClick={() => handleOnSubTap('ongoing')}
62
+ isSelected={subTapState === 'ongoing'}
63
+ />
64
+
65
+ <SubColor1Button
66
+ title="사건접수"
67
+ onClick={() => handleOnSubTap('사건접수')}
68
+ isSelected={subTapState === '사건접수'}
69
+ />
70
+ <SubColor1Button
71
+ title="사건검토"
72
+ onClick={() => handleOnSubTap('사건검토')}
73
+ isSelected={subTapState === '사건검토'}
74
+ />
75
+ <SubColor1Button
76
+ title="변호사상담"
77
+ onClick={() => handleOnSubTap('변호사상담')}
78
+ isSelected={subTapState === '변호사상담'}
79
+ />
80
+
81
+ <SubColor1Button
82
+ title="소송준비"
83
+ onClick={() => handleOnSubTap('소송준비')}
84
+ isSelected={subTapState === '소송준비'}
85
+ />
86
+ <SubColor1Button
87
+ title="소송진행"
88
+ onClick={() => handleOnSubTap('소송진행')}
89
+ isSelected={subTapState === '소송진행'}
90
+ />
91
+ </div>
92
+ <div className="sm-top:hidden">
93
+ <CaseTabSwiper
94
+ id="case-tab-swiper"
95
+ scrollClassName="max-[585px]:!block"
96
+ // handleOnSubTap={handleOnSubTap}
97
+ // subTapState={subTapState}
98
+ >
99
+ <SubColor1Button
100
+ title="전체"
101
+ onClick={() => handleOnSubTap('ongoing')}
102
+ isSelected={subTapState === 'ongoing'}
103
+ outerClassName="ml-[20px] 2sm:ml-[40px]"
104
+ />
105
+
106
+ <SubColor1Button
107
+ title="사건접수"
108
+ onClick={() => handleOnSubTap('사건접수')}
109
+ isSelected={subTapState === '사건접수'}
110
+ />
111
+ <SubColor1Button
112
+ title="사건검토"
113
+ onClick={() => handleOnSubTap('사건검토')}
114
+ isSelected={subTapState === '사건검토'}
115
+ />
116
+ <SubColor1Button
117
+ title="변호사상담"
118
+ onClick={() => handleOnSubTap('변호사상담')}
119
+ isSelected={subTapState === '변호사상담'}
120
+ />
121
+
122
+ <SubColor1Button
123
+ title="소송준비"
124
+ onClick={() => handleOnSubTap('소송준비')}
125
+ isSelected={subTapState === '소송준비'}
126
+ />
127
+ <SubColor1Button
128
+ title="소송진행"
129
+ onClick={() => handleOnSubTap('소송진행')}
130
+ isSelected={subTapState === '소송진행'}
131
+ />
132
+ </CaseTabSwiper>
133
+ </div>
134
+ </>
135
+ ) : (
136
+ <>
137
+ <div className="flex flex-row max-sm-top:hidden sm-top:gap-[12px] md2:gap-[20px] lg:gap-[28px] ">
138
+ <SubColor1Button
139
+ title="전체"
140
+ onClick={() => handleOnSubTap('closed')}
141
+ isSelected={subTapState === 'closed'}
142
+ />
143
+ <SubColor1Button
144
+ title="사건종결"
145
+ onClick={() => handleOnSubTap('사건종결')}
146
+ isSelected={subTapState === '사건종결'}
147
+ />
148
+ <SubColor1Button
149
+ title="환불"
150
+ onClick={() => handleOnSubTap('환불')}
151
+ isSelected={subTapState === '환불'}
152
+ />
153
+ </div>
154
+ <div className="sm-top:hidden">
155
+ <CaseTabSwiper
156
+ id="case-tab-swiper"
157
+ // handleOnSubTap={handleOnSubTap}
158
+ // subTapState={subTapState}
159
+ >
160
+ <SubColor1Button
161
+ title="전체"
162
+ onClick={() => handleOnSubTap('closed')}
163
+ isSelected={subTapState === 'closed'}
164
+ outerClassName="ml-[20px] 2sm:ml-[40px]"
165
+ />
166
+ <SubColor1Button
167
+ title="사건종결"
168
+ onClick={() => handleOnSubTap('사건종결')}
169
+ isSelected={subTapState === '사건종결'}
170
+ />
171
+ <SubColor1Button
172
+ title="환불"
173
+ onClick={() => handleOnSubTap('환불')}
174
+ isSelected={subTapState === '환불'}
175
+ />
176
+ </CaseTabSwiper>
177
+ </div>
178
+ </>
179
+ )}
180
+ </div> */}
181
+ {isLoading ? (<Loading />) : (data === null || data === void 0 ? void 0 : data.list.length) > 0 ? (<>
182
+ {/* <CaseTable
183
+ list={data?.list}
184
+ totalLength={data?.totalLength}
185
+ pageSize={pageSize}
186
+ pageNumber={pageNumber}
187
+ onChange={handleOnChange}
188
+ /> */}
189
+ <CaseTableMo 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}/>
190
+ </>) : (<EmptyTable tap={tapState} subTap={0}/>)}
191
+ </div>
192
+ </CaseLayout>);
193
+ };
194
+ export default CaseContainer;
@@ -0,0 +1,242 @@
1
+ import { useEffect, useState } from 'react';
2
+ import CaseLayout from './_layout/CaseLayout';
3
+ import SubColor1Button from './_button/SubColor1Button';
4
+ import { useQuery } from 'react-query';
5
+ import getCaseList from '../_fetchers/getCaseList';
6
+ import CaseTable from './_table/CaseTable';
7
+ import { Case } from '../_type/type';
8
+ import EmptyTable from './_empty/EmptyTable';
9
+ import { useRouter, useSearchParams } from 'next/navigation';
10
+ import Loading from './_loading/Loading';
11
+ import { actionGetCaseList } from '../_actions/action';
12
+ import CaseTabSwiper from './_table/CaseTabSwiper';
13
+ import CaseTableMo from './_table/CaseTableMo';
14
+
15
+ const CaseTap = ({
16
+ title,
17
+ type,
18
+ tap,
19
+ setTap
20
+ }: {
21
+ title: string;
22
+ type: string;
23
+ tap: string;
24
+ setTap: (tap: string) => void;
25
+ }) => {
26
+ return (
27
+ <button
28
+ onClick={() => {
29
+ if (setTap) {
30
+ setTap(type);
31
+ }
32
+ }}
33
+ className={`items-top flex h-[29px] w-full justify-center border-b-[2px] border-solid transition-colors duration-300 sm-top:h-[40px] lg:h-[45px] ${tap === type ? 'border-black text-black' : 'border-grayScale4 text-grayScale4'}`}
34
+ >
35
+ <p className={'body_large1_mo sm-top:body_large1_tb lg:body_large1'}>{title}</p>
36
+ </button>
37
+ );
38
+ };
39
+
40
+ const CaseContainer = () => {
41
+ const router = useRouter();
42
+ const searchParams = useSearchParams();
43
+ const { page, tap, subTap } = Object.fromEntries(searchParams.entries());
44
+ const tapState = tap ? (tap as string) : 'ongoing';
45
+ // const subTapState = subTap ? (subTap as string) : tap ? (tap as string) : 'ongoing';
46
+ const [pageSize, setPageSize] = useState(4);
47
+
48
+ const [caseList, setCaseList] = useState<Case[]>([]);
49
+ const [totalLength, setTotalLength] = useState(0);
50
+ // const [isLoading, setIsLoading] = useState(true);
51
+ const pageNumber = page ? Number(page) : 1;
52
+
53
+ const handleOnChange = (pageNum: number) => {
54
+ router.push(`/mycase?page=${pageNum}&tap=${tap}&subTap=${subTap}`);
55
+ };
56
+ const handleOnTap = (tap: string) => {
57
+ router.push(`/mycase?page=${page}&tap=${tap}&subTap=${tap === 'ongoing' ? 'ongoing' : 'closed'}`);
58
+ };
59
+ // const handleOnSubTap = (subTap: string) => {
60
+ // router.push(`/mycase?page=1&tap=${tapState}&subTap=${subTap}`);
61
+ // };
62
+
63
+ const { data, isLoading } = actionGetCaseList({
64
+ tapState,
65
+
66
+ pageNumber,
67
+ pageSize
68
+ });
69
+ // useEffect(() => {
70
+ // const handleResize = () => {
71
+ // setPageSize(window.innerWidth < 721 ? 3 : 6);
72
+ // }; // 300ms 딜레이
73
+
74
+ // window.addEventListener('resize', handleResize);
75
+ // return () => window.removeEventListener('resize', handleResize);
76
+ // }, []);
77
+
78
+ return (
79
+ <CaseLayout
80
+ outerClassName="mt-[230px] sm-top:mt-[310px] lg:mt-[294px] "
81
+ innerClassName={'py-[40px] sm-top:py-[52px] lg:py-[60px]'}
82
+ isMobilePadding={false}
83
+ >
84
+ <div className={''}>
85
+ <div className="flex flex-row items-center px-[20px] 2sm:px-[40px] sm-top:px-[50px] lg:px-[60px]">
86
+ <CaseTap title="진행중인 사건" type="ongoing" tap={tapState} setTap={handleOnTap} />
87
+ <CaseTap title="종결된 사건" type="closed" tap={tapState} setTap={handleOnTap} />
88
+ </div>
89
+ {/* <div className={'py-[22px] sm-top:px-[50px] sm-top:py-[16px] lg:my-[20px] lg:px-[60px]'}>
90
+ {tapState === 'ongoing' ? (
91
+ <>
92
+ <div className="flex flex-row max-sm-top:hidden sm-top:gap-[12px] md2:gap-[20px] lg:gap-[28px] ">
93
+ <SubColor1Button
94
+ title="전체"
95
+ onClick={() => handleOnSubTap('ongoing')}
96
+ isSelected={subTapState === 'ongoing'}
97
+ />
98
+
99
+ <SubColor1Button
100
+ title="사건접수"
101
+ onClick={() => handleOnSubTap('사건접수')}
102
+ isSelected={subTapState === '사건접수'}
103
+ />
104
+ <SubColor1Button
105
+ title="사건검토"
106
+ onClick={() => handleOnSubTap('사건검토')}
107
+ isSelected={subTapState === '사건검토'}
108
+ />
109
+ <SubColor1Button
110
+ title="변호사상담"
111
+ onClick={() => handleOnSubTap('변호사상담')}
112
+ isSelected={subTapState === '변호사상담'}
113
+ />
114
+
115
+ <SubColor1Button
116
+ title="소송준비"
117
+ onClick={() => handleOnSubTap('소송준비')}
118
+ isSelected={subTapState === '소송준비'}
119
+ />
120
+ <SubColor1Button
121
+ title="소송진행"
122
+ onClick={() => handleOnSubTap('소송진행')}
123
+ isSelected={subTapState === '소송진행'}
124
+ />
125
+ </div>
126
+ <div className="sm-top:hidden">
127
+ <CaseTabSwiper
128
+ id="case-tab-swiper"
129
+ scrollClassName="max-[585px]:!block"
130
+ // handleOnSubTap={handleOnSubTap}
131
+ // subTapState={subTapState}
132
+ >
133
+ <SubColor1Button
134
+ title="전체"
135
+ onClick={() => handleOnSubTap('ongoing')}
136
+ isSelected={subTapState === 'ongoing'}
137
+ outerClassName="ml-[20px] 2sm:ml-[40px]"
138
+ />
139
+
140
+ <SubColor1Button
141
+ title="사건접수"
142
+ onClick={() => handleOnSubTap('사건접수')}
143
+ isSelected={subTapState === '사건접수'}
144
+ />
145
+ <SubColor1Button
146
+ title="사건검토"
147
+ onClick={() => handleOnSubTap('사건검토')}
148
+ isSelected={subTapState === '사건검토'}
149
+ />
150
+ <SubColor1Button
151
+ title="변호사상담"
152
+ onClick={() => handleOnSubTap('변호사상담')}
153
+ isSelected={subTapState === '변호사상담'}
154
+ />
155
+
156
+ <SubColor1Button
157
+ title="소송준비"
158
+ onClick={() => handleOnSubTap('소송준비')}
159
+ isSelected={subTapState === '소송준비'}
160
+ />
161
+ <SubColor1Button
162
+ title="소송진행"
163
+ onClick={() => handleOnSubTap('소송진행')}
164
+ isSelected={subTapState === '소송진행'}
165
+ />
166
+ </CaseTabSwiper>
167
+ </div>
168
+ </>
169
+ ) : (
170
+ <>
171
+ <div className="flex flex-row max-sm-top:hidden sm-top:gap-[12px] md2:gap-[20px] lg:gap-[28px] ">
172
+ <SubColor1Button
173
+ title="전체"
174
+ onClick={() => handleOnSubTap('closed')}
175
+ isSelected={subTapState === 'closed'}
176
+ />
177
+ <SubColor1Button
178
+ title="사건종결"
179
+ onClick={() => handleOnSubTap('사건종결')}
180
+ isSelected={subTapState === '사건종결'}
181
+ />
182
+ <SubColor1Button
183
+ title="환불"
184
+ onClick={() => handleOnSubTap('환불')}
185
+ isSelected={subTapState === '환불'}
186
+ />
187
+ </div>
188
+ <div className="sm-top:hidden">
189
+ <CaseTabSwiper
190
+ id="case-tab-swiper"
191
+ // handleOnSubTap={handleOnSubTap}
192
+ // subTapState={subTapState}
193
+ >
194
+ <SubColor1Button
195
+ title="전체"
196
+ onClick={() => handleOnSubTap('closed')}
197
+ isSelected={subTapState === 'closed'}
198
+ outerClassName="ml-[20px] 2sm:ml-[40px]"
199
+ />
200
+ <SubColor1Button
201
+ title="사건종결"
202
+ onClick={() => handleOnSubTap('사건종결')}
203
+ isSelected={subTapState === '사건종결'}
204
+ />
205
+ <SubColor1Button
206
+ title="환불"
207
+ onClick={() => handleOnSubTap('환불')}
208
+ isSelected={subTapState === '환불'}
209
+ />
210
+ </CaseTabSwiper>
211
+ </div>
212
+ </>
213
+ )}
214
+ </div> */}
215
+ {isLoading ? (
216
+ <Loading />
217
+ ) : data?.list.length > 0 ? (
218
+ <>
219
+ {/* <CaseTable
220
+ list={data?.list}
221
+ totalLength={data?.totalLength}
222
+ pageSize={pageSize}
223
+ pageNumber={pageNumber}
224
+ onChange={handleOnChange}
225
+ /> */}
226
+ <CaseTableMo
227
+ list={data?.list}
228
+ totalLength={data?.totalLength}
229
+ pageSize={pageSize}
230
+ pageNumber={pageNumber}
231
+ onChange={handleOnChange}
232
+ />
233
+ </>
234
+ ) : (
235
+ <EmptyTable tap={tapState} subTap={0} />
236
+ )}
237
+ </div>
238
+ </CaseLayout>
239
+ );
240
+ };
241
+
242
+ export default CaseContainer;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type CategoryMenuType = {
3
+ t: (key: string) => string;
4
+ isMargin?: boolean;
5
+ isWhite?: boolean;
6
+ };
7
+ declare const CategoryMenu: (props: CategoryMenuType) => React.JSX.Element;
8
+ export default CategoryMenu;
@@ -0,0 +1,43 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { catagoryMenuName } from '../../_lib/catagoryMenuName';
3
+ import { usePathname, useRouter } from 'next/navigation';
4
+ import Image from 'next/image';
5
+ import Link from 'next/link';
6
+ const CategoryMenu = (props) => {
7
+ const { t, isMargin = true, isWhite = false } = props;
8
+ const router = useRouter();
9
+ const pathname = usePathname();
10
+ const [menu, setMenu] = useState({ title: '', subTitle: '', address: '' });
11
+ //페이지 내부에서 쿼리 파라미터 없이 루트 경로로 돌아갈 때 새로고침
12
+ const reloadUrl = (url) => {
13
+ if (pathname === url) {
14
+ router.push(url);
15
+ router.refresh();
16
+ }
17
+ };
18
+ useEffect(() => {
19
+ setMenu(catagoryMenuName({ url: pathname, t }));
20
+ }, [pathname, t]);
21
+ const imagePath = isWhite ? '/images/mycase/home.svg' : '/images/mycase/home.webp';
22
+ const arrowImage = isWhite ? '/images/mycase/nav_arr.webp' : '/images/mycase/arrow_2.webp';
23
+ const textColor = isWhite ? 'text-[#fff]' : 'text-[#333333]';
24
+ return (<div className={(isMargin ? 'mb-[70px] mr-0 mt-8 lg:mb-[45px] lg:mt-[47px] ' : '') +
25
+ 'relative z-10 flex flex-row font-normal leading-[1] tracking-[-0.32px] ' +
26
+ 'text-[13px] xs:text-[14px] sm:text-[15px] lg:text-[16px] ' +
27
+ 'min-w-[320px] items-center justify-end gap-[10px] lg:w-[100%]'}>
28
+ <Link href="/">
29
+ <Image src={imagePath} alt={'집'} width={15} height={15} className={'mb-[1px] h-auto sm:w-[17px] lg:w-[18px]'}/>
30
+ </Link>
31
+ <Image src={arrowImage} alt={'화살표_1'} width={8} height={13} className={'h-[13px] w-[8px]'}/>
32
+ {menu.title === menu.subTitle ? (<Link href={`/${menu.address}`} onClick={() => reloadUrl(`/${menu.address}`)}>
33
+ <div className={textColor}>{menu === null || menu === void 0 ? void 0 : menu.title}</div>
34
+ </Link>) : (<>
35
+ <div className={textColor}>{menu === null || menu === void 0 ? void 0 : menu.title}</div>
36
+ <Image src={arrowImage} alt={'화살표_2'} width={8} height={13} className={'h-[13px] w-[8px]'}/>
37
+ <Link href={`/${menu.address}`} onClick={() => reloadUrl(`/${menu.address}`)}>
38
+ <div className={textColor}>{menu === null || menu === void 0 ? void 0 : menu.subTitle}</div>
39
+ </Link>
40
+ </>)}
41
+ </div>);
42
+ };
43
+ export default CategoryMenu;