@daeryun/dr_components 0.2.96 → 0.2.98

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 (152) hide show
  1. package/dist/components/page/index.d.ts +0 -4
  2. package/dist/components/page/index.js +0 -4
  3. package/dist/components/page/index.ts +0 -4
  4. package/dist/styles/globals.css +115 -2077
  5. package/dist/tsconfig.tsbuildinfo +1 -1
  6. package/package.json +1 -1
  7. package/dist/components/page/MyCase/MyCase.stories.d.ts +0 -6
  8. package/dist/components/page/MyCase/MyCase.stories.jsx +0 -17
  9. package/dist/components/page/MyCase/MyCase.stories.tsx +0 -25
  10. package/dist/components/page/MyCase/MyCaseApp.d.ts +0 -2
  11. package/dist/components/page/MyCase/MyCaseApp.jsx +0 -19
  12. package/dist/components/page/MyCase/MyCaseApp.tsx +0 -32
  13. package/dist/components/page/MyCase/MyCasePage.d.ts +0 -3
  14. package/dist/components/page/MyCase/MyCasePage.jsx +0 -21
  15. package/dist/components/page/MyCase/MyCasePage.tsx +0 -32
  16. package/dist/components/page/MyCase/[id]/MyCaseDetail.stories.d.ts +0 -6
  17. package/dist/components/page/MyCase/[id]/MyCaseDetail.stories.jsx +0 -17
  18. package/dist/components/page/MyCase/[id]/MyCaseDetail.stories.tsx +0 -25
  19. package/dist/components/page/MyCase/[id]/MyCaseDetailApp.d.ts +0 -3
  20. package/dist/components/page/MyCase/[id]/MyCaseDetailApp.jsx +0 -66
  21. package/dist/components/page/MyCase/[id]/MyCaseDetailApp.tsx +0 -159
  22. package/dist/components/page/MyCase/[id]/MyCaseDetailPage.d.ts +0 -3
  23. package/dist/components/page/MyCase/[id]/MyCaseDetailPage.jsx +0 -65
  24. package/dist/components/page/MyCase/[id]/MyCaseDetailPage.tsx +0 -157
  25. package/dist/components/page/MyCase/[id]/_component/ContactInfo.d.ts +0 -2
  26. package/dist/components/page/MyCase/[id]/_component/ContactInfo.jsx +0 -79
  27. package/dist/components/page/MyCase/[id]/_component/ContactInfo.tsx +0 -102
  28. package/dist/components/page/MyCase/[id]/_component/DetailInfo.d.ts +0 -6
  29. package/dist/components/page/MyCase/[id]/_component/DetailInfo.jsx +0 -44
  30. package/dist/components/page/MyCase/[id]/_component/DetailInfo.tsx +0 -94
  31. package/dist/components/page/MyCase/[id]/_component/TimeLine.d.ts +0 -6
  32. package/dist/components/page/MyCase/[id]/_component/TimeLine.jsx +0 -46
  33. package/dist/components/page/MyCase/[id]/_component/TimeLine.tsx +0 -72
  34. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.d.ts +0 -11
  35. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.jsx +0 -80
  36. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.tsx +0 -188
  37. package/dist/components/page/MyCase/[id]/_component/_document/Document.d.ts +0 -6
  38. package/dist/components/page/MyCase/[id]/_component/_document/Document.jsx +0 -35
  39. package/dist/components/page/MyCase/[id]/_component/_document/Document.tsx +0 -59
  40. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.d.ts +0 -6
  41. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.jsx +0 -76
  42. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.tsx +0 -94
  43. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryAddModal.d.ts +0 -7
  44. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryAddModal.jsx +0 -107
  45. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryAddModal.tsx +0 -150
  46. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryConfirmModal.d.ts +0 -7
  47. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryConfirmModal.jsx +0 -25
  48. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryConfirmModal.tsx +0 -55
  49. package/dist/components/page/MyCase/[id]/_component/_modal/ModalCotainer.d.ts +0 -7
  50. package/dist/components/page/MyCase/[id]/_component/_modal/ModalCotainer.jsx +0 -26
  51. package/dist/components/page/MyCase/[id]/_component/_modal/ModalCotainer.tsx +0 -39
  52. package/dist/components/page/MyCase/[id]/_component/_textarea/TextArea.d.ts +0 -7
  53. package/dist/components/page/MyCase/[id]/_component/_textarea/TextArea.jsx +0 -4
  54. package/dist/components/page/MyCase/[id]/_component/_textarea/TextArea.tsx +0 -24
  55. package/dist/components/page/MyCase/_actions/action.d.ts +0 -35
  56. package/dist/components/page/MyCase/_actions/action.js +0 -145
  57. package/dist/components/page/MyCase/_actions/action.ts +0 -165
  58. package/dist/components/page/MyCase/_component/CaseAppContainer.d.ts +0 -2
  59. package/dist/components/page/MyCase/_component/CaseAppContainer.jsx +0 -117
  60. package/dist/components/page/MyCase/_component/CaseAppContainer.tsx +0 -255
  61. package/dist/components/page/MyCase/_component/CasePageContainer.d.ts +0 -2
  62. package/dist/components/page/MyCase/_component/CasePageContainer.jsx +0 -106
  63. package/dist/components/page/MyCase/_component/CasePageContainer.tsx +0 -244
  64. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuApp.d.ts +0 -7
  65. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuApp.jsx +0 -47
  66. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuApp.tsx +0 -77
  67. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuPage.d.ts +0 -8
  68. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuPage.jsx +0 -47
  69. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuPage.tsx +0 -77
  70. package/dist/components/page/MyCase/_component/_button/Badge.d.ts +0 -14
  71. package/dist/components/page/MyCase/_component/_button/Badge.jsx +0 -16
  72. package/dist/components/page/MyCase/_component/_button/Badge.tsx +0 -22
  73. package/dist/components/page/MyCase/_component/_button/SubColor1Button.d.ts +0 -7
  74. package/dist/components/page/MyCase/_component/_button/SubColor1Button.jsx +0 -9
  75. package/dist/components/page/MyCase/_component/_button/SubColor1Button.tsx +0 -33
  76. package/dist/components/page/MyCase/_component/_button/SubMenuButton.d.ts +0 -7
  77. package/dist/components/page/MyCase/_component/_button/SubMenuButton.jsx +0 -9
  78. package/dist/components/page/MyCase/_component/_button/SubMenuButton.tsx +0 -31
  79. package/dist/components/page/MyCase/_component/_empty/EmptyTable.d.ts +0 -6
  80. package/dist/components/page/MyCase/_component/_empty/EmptyTable.jsx +0 -75
  81. package/dist/components/page/MyCase/_component/_empty/EmptyTable.tsx +0 -85
  82. package/dist/components/page/MyCase/_component/_layout/CaseLayout.d.ts +0 -7
  83. package/dist/components/page/MyCase/_component/_layout/CaseLayout.jsx +0 -11
  84. package/dist/components/page/MyCase/_component/_layout/CaseLayout.tsx +0 -29
  85. package/dist/components/page/MyCase/_component/_layout/CaseWrapper.d.ts +0 -12
  86. package/dist/components/page/MyCase/_component/_layout/CaseWrapper.jsx +0 -25
  87. package/dist/components/page/MyCase/_component/_layout/CaseWrapper.tsx +0 -41
  88. package/dist/components/page/MyCase/_component/_layout/HeaderLayout.d.ts +0 -4
  89. package/dist/components/page/MyCase/_component/_layout/HeaderLayout.jsx +0 -4
  90. package/dist/components/page/MyCase/_component/_layout/HeaderLayout.tsx +0 -5
  91. package/dist/components/page/MyCase/_component/_layout/IntroAppWrapper.d.ts +0 -10
  92. package/dist/components/page/MyCase/_component/_layout/IntroAppWrapper.jsx +0 -29
  93. package/dist/components/page/MyCase/_component/_layout/IntroAppWrapper.tsx +0 -80
  94. package/dist/components/page/MyCase/_component/_layout/IntroPageWrapper.d.ts +0 -10
  95. package/dist/components/page/MyCase/_component/_layout/IntroPageWrapper.jsx +0 -31
  96. package/dist/components/page/MyCase/_component/_layout/IntroPageWrapper.tsx +0 -81
  97. package/dist/components/page/MyCase/_component/_loading/Loading.d.ts +0 -2
  98. package/dist/components/page/MyCase/_component/_loading/Loading.jsx +0 -89
  99. package/dist/components/page/MyCase/_component/_loading/Loading.tsx +0 -92
  100. package/dist/components/page/MyCase/_component/_pagination/PaginationComponentApp.d.ts +0 -10
  101. package/dist/components/page/MyCase/_component/_pagination/PaginationComponentApp.jsx +0 -82
  102. package/dist/components/page/MyCase/_component/_pagination/PaginationComponentApp.tsx +0 -137
  103. package/dist/components/page/MyCase/_component/_pagination/PaginationComponentPage.d.ts +0 -10
  104. package/dist/components/page/MyCase/_component/_pagination/PaginationComponentPage.jsx +0 -81
  105. package/dist/components/page/MyCase/_component/_pagination/PaginationComponentPage.tsx +0 -135
  106. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.d.ts +0 -9
  107. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.jsx +0 -65
  108. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.tsx +0 -79
  109. package/dist/components/page/MyCase/_component/_table/CaseTable.d.ts +0 -9
  110. package/dist/components/page/MyCase/_component/_table/CaseTable.jsx +0 -63
  111. package/dist/components/page/MyCase/_component/_table/CaseTable.tsx +0 -94
  112. package/dist/components/page/MyCase/_component/_table/CaseTableMo.d.ts +0 -9
  113. package/dist/components/page/MyCase/_component/_table/CaseTableMo.jsx +0 -11
  114. package/dist/components/page/MyCase/_component/_table/CaseTableMo.tsx +0 -28
  115. package/dist/components/page/MyCase/_component/_table/CaseTableMoBox.d.ts +0 -5
  116. package/dist/components/page/MyCase/_component/_table/CaseTableMoBox.jsx +0 -35
  117. package/dist/components/page/MyCase/_component/_table/CaseTableMoBox.tsx +0 -43
  118. package/dist/components/page/MyCase/_component/_table/CaseTableMoPage.d.ts +0 -9
  119. package/dist/components/page/MyCase/_component/_table/CaseTableMoPage.jsx +0 -11
  120. package/dist/components/page/MyCase/_component/_table/CaseTableMoPage.tsx +0 -28
  121. package/dist/components/page/MyCase/_fetchers/addMyCaseQuestion.d.ts +0 -6
  122. package/dist/components/page/MyCase/_fetchers/addMyCaseQuestion.js +0 -31
  123. package/dist/components/page/MyCase/_fetchers/addMyCaseQuestion.ts +0 -22
  124. package/dist/components/page/MyCase/_fetchers/getCase.d.ts +0 -5
  125. package/dist/components/page/MyCase/_fetchers/getCase.js +0 -30
  126. package/dist/components/page/MyCase/_fetchers/getCase.ts +0 -21
  127. package/dist/components/page/MyCase/_fetchers/getCaseList.d.ts +0 -7
  128. package/dist/components/page/MyCase/_fetchers/getCaseList.js +0 -30
  129. package/dist/components/page/MyCase/_fetchers/getCaseList.ts +0 -24
  130. package/dist/components/page/MyCase/_fetchers/getCourtFileList.d.ts +0 -5
  131. package/dist/components/page/MyCase/_fetchers/getCourtFileList.js +0 -30
  132. package/dist/components/page/MyCase/_fetchers/getCourtFileList.ts +0 -21
  133. package/dist/components/page/MyCase/_fetchers/getMyCaseQuestion.d.ts +0 -7
  134. package/dist/components/page/MyCase/_fetchers/getMyCaseQuestion.js +0 -30
  135. package/dist/components/page/MyCase/_fetchers/getMyCaseQuestion.ts +0 -24
  136. package/dist/components/page/MyCase/_fetchers/getMyFileList.d.ts +0 -5
  137. package/dist/components/page/MyCase/_fetchers/getMyFileList.js +0 -30
  138. package/dist/components/page/MyCase/_fetchers/getMyFileList.ts +0 -21
  139. package/dist/components/page/MyCase/_fetchers/getTimeLine.d.ts +0 -5
  140. package/dist/components/page/MyCase/_fetchers/getTimeLine.js +0 -30
  141. package/dist/components/page/MyCase/_fetchers/getTimeLine.ts +0 -21
  142. package/dist/components/page/MyCase/_lib/catagoryMenuName.d.ts +0 -8
  143. package/dist/components/page/MyCase/_lib/catagoryMenuName.js +0 -8
  144. package/dist/components/page/MyCase/_lib/catagoryMenuName.ts +0 -11
  145. package/dist/components/page/MyCase/_lib/catagoryMenuNameApp.d.ts +0 -7
  146. package/dist/components/page/MyCase/_lib/catagoryMenuNameApp.js +0 -8
  147. package/dist/components/page/MyCase/_lib/catagoryMenuNameApp.ts +0 -11
  148. package/dist/components/page/MyCase/_lib/pagination/locale/ko_KR.d.ts +0 -15
  149. package/dist/components/page/MyCase/_lib/pagination/locale/ko_KR.js +0 -21
  150. package/dist/components/page/MyCase/_type/type.d.ts +0 -73
  151. package/dist/components/page/MyCase/_type/type.js +0 -1
  152. package/dist/components/page/MyCase/_type/type.ts +0 -81
@@ -1,165 +0,0 @@
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
- };
@@ -1,2 +0,0 @@
1
- declare const CaseContainer: () => import("react").JSX.Element;
2
- export default CaseContainer;
@@ -1,117 +0,0 @@
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;
@@ -1,255 +0,0 @@
1
- 'use client';
2
-
3
- import { useEffect, useState } from 'react';
4
- import CaseLayout from './_layout/CaseLayout';
5
- import SubColor1Button from './_button/SubColor1Button';
6
- import CaseTable from './_table/CaseTable';
7
- import EmptyTable from './_empty/EmptyTable';
8
- import { useRouter } from 'next/router';
9
- import Loading from './_loading/Loading';
10
- import { useGetCaseList } from '../_actions/action';
11
- import CaseTabSwiper from './_table/CaseTabSwiper';
12
-
13
- import CaseTableMoPage from './_table/CaseTableMoPage';
14
- // import { useCompatibleRouter } from '../../../lib/router/useCompatibleRouter';
15
-
16
- const CaseTap = ({
17
- title,
18
- type,
19
- tap,
20
- setTap
21
- }: {
22
- title: string;
23
- type: string;
24
- tap: string;
25
- setTap: (tap: string) => void;
26
- }) => {
27
- return (
28
- <button
29
- onClick={() => {
30
- if (setTap) {
31
- setTap(type);
32
- }
33
- }}
34
- 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] ${
35
- tap === type ? 'border-black text-black' : 'border-grayScale4 text-grayScale4'
36
- }`}
37
- >
38
- <p className={'body_large1_mo sm-top:body_large1_tb lg:body_large1'}>{title}</p>
39
- </button>
40
- );
41
- };
42
-
43
- const CaseContainer = () => {
44
- // const { router, searchParams } = useCompatibleRouter();
45
- const router = useRouter();
46
- const { page, tap, subTap } = router.query;
47
- // const searchParams = useSearchParams();
48
- // const searchParams = useSearchParams();
49
- // const { page, tap, subTap } = searchParams ? Object.fromEntries(searchParams.entries()) : {};
50
- const tapState = tap ? (tap as string) : 'ongoing';
51
- const subTapState = subTap ? (subTap as string) : tap ? (tap as string) : 'ongoing';
52
- const [pageSize, setPageSize] = useState(6);
53
-
54
- // const [isLoading, setIsLoading] = useState(true);
55
- const pageNumber = page ? Number(page) : 1;
56
-
57
- const handleOnChange = (pageNum: number) => {
58
- router.push({
59
- pathname: '/mycase',
60
- query: { page: pageNum, tap, subTap }
61
- });
62
- };
63
- const handleOnTap = (tap: string) => {
64
- router.push({
65
- pathname: '/mycase',
66
- query: { page, tap, subTap: tap === 'ongoing' ? 'ongoing' : 'closed' }
67
- });
68
- };
69
- const handleOnSubTap = (subTap: string) => {
70
- router.push({
71
- pathname: '/mycase',
72
- query: { page: 1, tap, subTap }
73
- });
74
- };
75
-
76
- const { data, isLoading } = useGetCaseList({
77
- tapState,
78
- subTapState,
79
- pageNumber,
80
- pageSize
81
- });
82
- useEffect(() => {
83
- const handleResize = () => {
84
- setPageSize(window.innerWidth < 721 ? 3 : 6);
85
- }; // 300ms 딜레이
86
-
87
- window.addEventListener('resize', handleResize);
88
- return () => window.removeEventListener('resize', handleResize);
89
- }, []);
90
-
91
- return (
92
- <CaseLayout
93
- outerClassName="mt-[230px] sm-top:mt-[310px] lg:mt-[294px] "
94
- innerClassName={'py-[40px] sm-top:py-[52px] lg:py-[60px]'}
95
- isMobilePadding={false}
96
- >
97
- <div className={''}>
98
- <div className="sm-top:px-[50px] flex flex-row items-center px-[20px] 2sm:px-[40px] lg:px-[60px]">
99
- <CaseTap title="진행중인 사건" type="ongoing" tap={tapState} setTap={handleOnTap} />
100
- <CaseTap title="종결된 사건" type="closed" tap={tapState} setTap={handleOnTap} />
101
- </div>
102
- <div className={'sm-top:px-[50px] sm-top:py-[16px] py-[22px] lg:my-[20px] lg:px-[60px]'}>
103
- {tapState === 'ongoing' ? (
104
- <>
105
- <div className="max-sm-top:hidden sm-top:gap-[12px] flex flex-row md2:gap-[20px] lg:gap-[28px] ">
106
- <SubColor1Button
107
- title="전체"
108
- onClick={() => handleOnSubTap('ongoing')}
109
- isSelected={subTapState === 'ongoing'}
110
- />
111
-
112
- <SubColor1Button
113
- title="사건접수"
114
- onClick={() => handleOnSubTap('사건접수')}
115
- isSelected={subTapState === '사건접수'}
116
- />
117
- <SubColor1Button
118
- title="사건검토"
119
- onClick={() => handleOnSubTap('사건검토')}
120
- isSelected={subTapState === '사건검토'}
121
- />
122
- <SubColor1Button
123
- title="변호사상담"
124
- onClick={() => handleOnSubTap('변호사상담')}
125
- isSelected={subTapState === '변호사상담'}
126
- />
127
-
128
- <SubColor1Button
129
- title="소송준비"
130
- onClick={() => handleOnSubTap('소송준비')}
131
- isSelected={subTapState === '소송준비'}
132
- />
133
- <SubColor1Button
134
- title="소송진행"
135
- onClick={() => handleOnSubTap('소송진행')}
136
- isSelected={subTapState === '소송진행'}
137
- />
138
- </div>
139
- <div className="sm-top:hidden">
140
- <CaseTabSwiper
141
- id="case-tab-swiper"
142
- scrollClassName="max-[585px]:!block"
143
- // handleOnSubTap={handleOnSubTap}
144
- // subTapState={subTapState}
145
- >
146
- <SubColor1Button
147
- title="전체"
148
- onClick={() => handleOnSubTap('ongoing')}
149
- isSelected={subTapState === 'ongoing'}
150
- outerClassName="ml-[20px] 2sm:ml-[40px]"
151
- />
152
-
153
- <SubColor1Button
154
- title="사건접수"
155
- onClick={() => handleOnSubTap('사건접수')}
156
- isSelected={subTapState === '사건접수'}
157
- />
158
- <SubColor1Button
159
- title="사건검토"
160
- onClick={() => handleOnSubTap('사건검토')}
161
- isSelected={subTapState === '사건검토'}
162
- />
163
- <SubColor1Button
164
- title="변호사상담"
165
- onClick={() => handleOnSubTap('변호사상담')}
166
- isSelected={subTapState === '변호사상담'}
167
- />
168
-
169
- <SubColor1Button
170
- title="소송준비"
171
- onClick={() => handleOnSubTap('소송준비')}
172
- isSelected={subTapState === '소송준비'}
173
- />
174
- <SubColor1Button
175
- title="소송진행"
176
- onClick={() => handleOnSubTap('소송진행')}
177
- isSelected={subTapState === '소송진행'}
178
- />
179
- </CaseTabSwiper>
180
- </div>
181
- </>
182
- ) : (
183
- <>
184
- <div className="max-sm-top:hidden sm-top:gap-[12px] flex flex-row md2:gap-[20px] lg:gap-[28px] ">
185
- <SubColor1Button
186
- title="전체"
187
- onClick={() => handleOnSubTap('closed')}
188
- isSelected={subTapState === 'closed'}
189
- />
190
- <SubColor1Button
191
- title="사건종결"
192
- onClick={() => handleOnSubTap('사건종결')}
193
- isSelected={subTapState === '사건종결'}
194
- />
195
- <SubColor1Button
196
- title="환불"
197
- onClick={() => handleOnSubTap('환불')}
198
- isSelected={subTapState === '환불'}
199
- />
200
- </div>
201
- <div className="sm-top:hidden">
202
- <CaseTabSwiper
203
- id="case-tab-swiper"
204
- // handleOnSubTap={handleOnSubTap}
205
- // subTapState={subTapState}
206
- >
207
- <SubColor1Button
208
- title="전체"
209
- onClick={() => handleOnSubTap('closed')}
210
- isSelected={subTapState === 'closed'}
211
- outerClassName="ml-[20px] 2sm:ml-[40px]"
212
- />
213
- <SubColor1Button
214
- title="사건종결"
215
- onClick={() => handleOnSubTap('사건종결')}
216
- isSelected={subTapState === '사건종결'}
217
- />
218
- <SubColor1Button
219
- title="환불"
220
- onClick={() => handleOnSubTap('환불')}
221
- isSelected={subTapState === '환불'}
222
- />
223
- </CaseTabSwiper>
224
- </div>
225
- </>
226
- )}
227
- </div>
228
- {isLoading ? (
229
- <Loading />
230
- ) : data?.list.length > 0 ? (
231
- <>
232
- <CaseTable
233
- list={data?.list}
234
- totalLength={data?.totalLength}
235
- pageSize={pageSize}
236
- pageNumber={pageNumber}
237
- onChange={handleOnChange}
238
- />
239
- <CaseTableMoPage
240
- list={data?.list}
241
- totalLength={data?.totalLength}
242
- pageSize={pageSize}
243
- pageNumber={pageNumber}
244
- onChange={handleOnChange}
245
- />
246
- </>
247
- ) : (
248
- <EmptyTable tap={tapState} subTap={subTapState === 'ongoing' || subTapState === 'closed' ? 0 : 1} />
249
- )}
250
- </div>
251
- </CaseLayout>
252
- );
253
- };
254
-
255
- export default CaseContainer;
@@ -1,2 +0,0 @@
1
- declare const CaseContainer: () => import("react").JSX.Element;
2
- export default CaseContainer;
@@ -1,106 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import CaseLayout from './_layout/CaseLayout';
3
- import SubColor1Button from './_button/SubColor1Button';
4
- import CaseTable from './_table/CaseTable';
5
- import EmptyTable from './_empty/EmptyTable';
6
- import { useRouter, useSearchParams } from 'next/navigation';
7
- import Loading from './_loading/Loading';
8
- import { useGetCaseList } from '../_actions/action';
9
- import CaseTabSwiper from './_table/CaseTabSwiper';
10
- import CaseTableMo from './_table/CaseTableMo';
11
- const CaseTap = ({ title, type, tap, setTap }) => {
12
- return (<button onClick={() => {
13
- if (setTap) {
14
- setTap(type);
15
- }
16
- }} 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'}`}>
17
- <p className={'body_large1_mo sm-top:body_large1_tb lg:body_large1'}>{title}</p>
18
- </button>);
19
- };
20
- const CaseContainer = () => {
21
- var _a, _b, _c, _d, _e;
22
- const router = useRouter();
23
- const searchParams = useSearchParams();
24
- const { page, tap, subTap } = searchParams ? Object.fromEntries(searchParams.entries()) : {};
25
- const tapState = tap ? tap : 'ongoing';
26
- const subTapState = subTap ? subTap : tap ? tap : 'ongoing';
27
- const [pageSize, setPageSize] = useState(6);
28
- const [caseList, setCaseList] = useState([]);
29
- const [totalLength, setTotalLength] = useState(0);
30
- // const [isLoading, setIsLoading] = useState(true);
31
- const pageNumber = page ? Number(page) : 1;
32
- const handleOnChange = (pageNum) => {
33
- router.push(`/mycase?page=${pageNum}&tap=${tap}&subTap=${subTap}`);
34
- };
35
- const handleOnTap = (tap) => {
36
- router.push(`/mycase?page=${page}&tap=${tap}&subTap=${tap === 'ongoing' ? 'ongoing' : 'closed'}`);
37
- };
38
- const handleOnSubTap = (subTap) => {
39
- router.push(`/mycase?page=1&tap=${tap}&subTap=${subTap}`);
40
- };
41
- const { data, isLoading } = useGetCaseList({
42
- tapState,
43
- subTapState,
44
- pageNumber,
45
- pageSize
46
- });
47
- useEffect(() => {
48
- const handleResize = () => {
49
- setPageSize(window.innerWidth < 721 ? 3 : 6);
50
- }; // 300ms 딜레이
51
- window.addEventListener('resize', handleResize);
52
- return () => window.removeEventListener('resize', handleResize);
53
- }, []);
54
- return (<CaseLayout outerClassName="mt-[230px] sm-top:mt-[310px] lg:mt-[294px] " innerClassName={'py-[40px] sm-top:py-[52px] lg:py-[60px]'} isMobilePadding={false}>
55
- <div className={''}>
56
- <div className="sm-top:px-[50px] flex flex-row items-center px-[20px] 2sm:px-[40px] lg:px-[60px]">
57
- <CaseTap title="진행중인 사건" type="ongoing" tap={tapState} setTap={handleOnTap}/>
58
- <CaseTap title="종결된 사건" type="closed" tap={tapState} setTap={handleOnTap}/>
59
- </div>
60
- <div className={'sm-top:px-[50px] sm-top:py-[16px] py-[22px] lg:my-[20px] lg:px-[60px]'}>
61
- {tapState === 'ongoing' ? (<>
62
- <div className="max-sm-top:hidden sm-top:gap-[12px] flex flex-row md2:gap-[20px] lg:gap-[28px] ">
63
- <SubColor1Button title="전체" onClick={() => handleOnSubTap('ongoing')} isSelected={subTapState === 'ongoing'}/>
64
-
65
- <SubColor1Button title="사건접수" onClick={() => handleOnSubTap('사건접수')} isSelected={subTapState === '사건접수'}/>
66
- <SubColor1Button title="사건검토" onClick={() => handleOnSubTap('사건검토')} isSelected={subTapState === '사건검토'}/>
67
- <SubColor1Button title="변호사상담" onClick={() => handleOnSubTap('변호사상담')} isSelected={subTapState === '변호사상담'}/>
68
-
69
- <SubColor1Button title="소송준비" onClick={() => handleOnSubTap('소송준비')} isSelected={subTapState === '소송준비'}/>
70
- <SubColor1Button title="소송진행" onClick={() => handleOnSubTap('소송진행')} isSelected={subTapState === '소송진행'}/>
71
- </div>
72
- <div className="sm-top:hidden">
73
- <CaseTabSwiper id="case-tab-swiper" scrollClassName="max-[585px]:!block">
74
- <SubColor1Button title="전체" onClick={() => handleOnSubTap('ongoing')} isSelected={subTapState === 'ongoing'} outerClassName="ml-[20px] 2sm:ml-[40px]"/>
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
- </CaseTabSwiper>
83
- </div>
84
- </>) : (<>
85
- <div className="max-sm-top:hidden sm-top:gap-[12px] flex flex-row md2:gap-[20px] lg:gap-[28px] ">
86
- <SubColor1Button title="전체" onClick={() => handleOnSubTap('closed')} isSelected={subTapState === 'closed'}/>
87
- <SubColor1Button title="사건종결" onClick={() => handleOnSubTap('사건종결')} isSelected={subTapState === '사건종결'}/>
88
- <SubColor1Button title="환불" onClick={() => handleOnSubTap('환불')} isSelected={subTapState === '환불'}/>
89
- </div>
90
- <div className="sm-top:hidden">
91
- <CaseTabSwiper id="case-tab-swiper">
92
- <SubColor1Button title="전체" onClick={() => handleOnSubTap('closed')} isSelected={subTapState === 'closed'} outerClassName="ml-[20px] 2sm:ml-[40px]"/>
93
- <SubColor1Button title="사건종결" onClick={() => handleOnSubTap('사건종결')} isSelected={subTapState === '사건종결'}/>
94
- <SubColor1Button title="환불" onClick={() => handleOnSubTap('환불')} isSelected={subTapState === '환불'}/>
95
- </CaseTabSwiper>
96
- </div>
97
- </>)}
98
- </div>
99
- {isLoading ? (<Loading />) : ((_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.list.length) > 0 ? (<>
100
- <CaseTable list={(_b = data === null || data === void 0 ? void 0 : data.data) === null || _b === void 0 ? void 0 : _b.list} totalLength={(_c = data === null || data === void 0 ? void 0 : data.data) === null || _c === void 0 ? void 0 : _c.totalLength} pageSize={pageSize} pageNumber={pageNumber} onChange={handleOnChange}/>
101
- <CaseTableMo list={(_d = data === null || data === void 0 ? void 0 : data.data) === null || _d === void 0 ? void 0 : _d.list} totalLength={(_e = data === null || data === void 0 ? void 0 : data.data) === null || _e === void 0 ? void 0 : _e.totalLength} pageSize={pageSize} pageNumber={pageNumber} onChange={handleOnChange}/>
102
- </>) : (<EmptyTable tap={tapState} subTap={subTapState === 'ongoing' || subTapState === 'closed' ? 0 : 1}/>)}
103
- </div>
104
- </CaseLayout>);
105
- };
106
- export default CaseContainer;