@daeryun/dr_components 0.4.55 → 0.4.57

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 (35) hide show
  1. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  2. package/dist/components/common/integrate/index.d.ts +1 -1
  3. package/dist/components/page/Integrate/Broadcast.d.ts +1 -0
  4. package/dist/components/page/Integrate/Broadcast.jsx +81 -48
  5. package/dist/components/page/Integrate/Broadcast.tsx +153 -114
  6. package/dist/components/page/Integrate/Field.d.ts +1 -0
  7. package/dist/components/page/Integrate/Field.jsx +40 -16
  8. package/dist/components/page/Integrate/Field.tsx +66 -32
  9. package/dist/components/page/Integrate/LawInfo.d.ts +1 -0
  10. package/dist/components/page/Integrate/LawInfo.jsx +37 -4
  11. package/dist/components/page/Integrate/LawInfo.tsx +51 -5
  12. package/dist/components/page/Integrate/Lawyer.d.ts +1 -0
  13. package/dist/components/page/Integrate/Lawyer.jsx +38 -14
  14. package/dist/components/page/Integrate/Lawyer.tsx +62 -30
  15. package/dist/components/page/Integrate/Map.d.ts +1 -0
  16. package/dist/components/page/Integrate/Map.jsx +45 -31
  17. package/dist/components/page/Integrate/Map.tsx +57 -42
  18. package/dist/components/page/Integrate/Reply.d.ts +1 -0
  19. package/dist/components/page/Integrate/Reply.jsx +55 -22
  20. package/dist/components/page/Integrate/Reply.tsx +102 -60
  21. package/dist/components/page/Integrate/SearchData.jsx +29 -12
  22. package/dist/components/page/Integrate/SearchData.tsx +30 -5
  23. package/dist/components/page/Integrate/Success.d.ts +1 -0
  24. package/dist/components/page/Integrate/Success.jsx +61 -28
  25. package/dist/components/page/Integrate/Success.tsx +106 -62
  26. package/dist/components/page/Integrate/Title.jsx +7 -3
  27. package/dist/components/page/Integrate/Title.tsx +8 -3
  28. package/dist/components/page/Integrate/ViewMore.d.ts +1 -1
  29. package/dist/components/page/Integrate/ViewMore.jsx +13 -13
  30. package/dist/components/page/Integrate/ViewMore.tsx +38 -41
  31. package/dist/components/page/MyCase/_fetchers/addMyFileUpload.js +2 -2
  32. package/dist/components/page/MyCase/_fetchers/addMyFileUpload.ts +2 -2
  33. package/dist/styles/globals.css +182 -177
  34. package/dist/tsconfig.tsbuildinfo +1 -1
  35. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  import React, { useState, useEffect } from 'react';
4
4
  import { NoResult } from './NoResult';
5
5
  import { IListPagesType, IListTypes, searchInit } from './integrateType';
6
- import { useRouter } from 'next/router';
6
+ import { useRouter, useSearchParams } from 'next/navigation';
7
7
  import Field from './Field';
8
8
  import Success from './Success';
9
9
  import LawInfo from './LawInfo';
@@ -11,6 +11,7 @@ import Broadcast from './Broadcast';
11
11
  import Reply from './Reply';
12
12
  import Map from './Map';
13
13
  import Lawyer from './Lawyer';
14
+ import useBrowser from '../../hook/useBrowser';
14
15
 
15
16
  const SearchData = ({
16
17
  list: propsList,
@@ -33,12 +34,17 @@ const SearchData = ({
33
34
  map: number;
34
35
  };
35
36
  }) => {
37
+ const { width } = useBrowser(true);
36
38
  const router = useRouter();
37
39
  const [tab, setTab] = useState<string>('');
38
40
  const [search, setSearch] = useState<string>('');
39
41
  const [list, setList] = useState<IListTypes>(searchInit.list);
40
42
  const [pages, setPages] = useState<IListPagesType>(searchInit.pages);
43
+ const [isMobileSize, setIsMobileSize] = useState<boolean | null>(null);
41
44
 
45
+ const searchParams = useSearchParams();
46
+ const querySearch = searchParams.get('search');
47
+ const queryTab = searchParams.get('tab');
42
48
  const handleMoreView = (key: string, data: any[]) => {
43
49
  // @ts-ignore
44
50
  setPages({ ...pages, [key]: pages[key] + 1 });
@@ -47,7 +53,7 @@ const SearchData = ({
47
53
  };
48
54
 
49
55
  const handleMoreViewText = async (tab: any) => {
50
- await router.push(`/integrate?search=${router.query.search}&tab=${tab}`);
56
+ await router.push(`/integrate?search=${querySearch}&tab=${tab}`);
51
57
  };
52
58
 
53
59
  useEffect(() => {
@@ -55,10 +61,22 @@ const SearchData = ({
55
61
  }, [propsList]);
56
62
 
57
63
  useEffect(() => {
58
- setSearch(String(router.query.search));
59
- setTab(String(router.query.tab));
64
+ setSearch(String(querySearch));
65
+ setTab(String(queryTab));
60
66
  // setPages(searchInit.pages)
61
- }, [router.query]);
67
+ }, [searchParams]);
68
+
69
+ //브라우저 체크
70
+ useEffect(() => {
71
+ if (width != 0 && width < 641 && isMobileSize != true) {
72
+ setIsMobileSize(true);
73
+ return;
74
+ }
75
+ if (width != 0 && width > 640 && isMobileSize != false) {
76
+ setIsMobileSize(false);
77
+ return;
78
+ }
79
+ }, [width, isMobileSize]);
62
80
 
63
81
  return (
64
82
  <span id={'integrate-result'}>
@@ -67,6 +85,7 @@ const SearchData = ({
67
85
  ) : (
68
86
  <>
69
87
  <Success
88
+ isMobileSize={isMobileSize}
70
89
  center_code={center_code}
71
90
  tab={tab}
72
91
  list={list}
@@ -92,6 +111,7 @@ const SearchData = ({
92
111
  />
93
112
 
94
113
  <Reply
114
+ isMobileSize={isMobileSize}
95
115
  crime_code={crime_code}
96
116
  tab={tab}
97
117
  list={list}
@@ -117,6 +137,7 @@ const SearchData = ({
117
137
  />
118
138
 
119
139
  <LawInfo
140
+ isMobileSize={isMobileSize}
120
141
  center_code={center_code}
121
142
  tab={tab}
122
143
  list={list}
@@ -142,6 +163,7 @@ const SearchData = ({
142
163
  />
143
164
 
144
165
  <Lawyer
166
+ isMobileSize={isMobileSize}
145
167
  tab={tab}
146
168
  listCount={listCount}
147
169
  list={list}
@@ -166,6 +188,7 @@ const SearchData = ({
166
188
  />
167
189
 
168
190
  <Broadcast
191
+ isMobileSize={isMobileSize}
169
192
  listCount={listCount}
170
193
  tab={tab}
171
194
  list={list}
@@ -190,6 +213,7 @@ const SearchData = ({
190
213
  />
191
214
 
192
215
  <Field
216
+ isMobileSize={isMobileSize}
193
217
  listCount={listCount}
194
218
  center_code={center_code}
195
219
  tab={tab}
@@ -216,6 +240,7 @@ const SearchData = ({
216
240
  />
217
241
 
218
242
  <Map
243
+ isMobileSize={isMobileSize}
219
244
  listCount={listCount}
220
245
  tab={tab}
221
246
  list={list}
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { IListPagesType, IListTypes } from './integrateType';
3
3
  declare const Success: (props: {
4
+ isMobileSize: boolean | null;
4
5
  tab: string;
5
6
  onMoreViewText: (str: string) => void;
6
7
  onMoreView: () => void;
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useEffect, useState } from 'react';
2
2
  import Link from 'next/link';
3
3
  import { NoResult } from './NoResult';
4
4
  import { Title } from './Title';
@@ -6,52 +6,85 @@ import { ViewMore } from './ViewMore';
6
6
  import { searchColorText } from '../../common/integrate';
7
7
  const Success = (props) => {
8
8
  var _a;
9
- const { tab, onMoreViewText, list, pages, onMoreView, search, listCount } = props;
9
+ const { tab, onMoreViewText, list, pages, onMoreView, search, listCount, isMobileSize } = props;
10
10
  const [loading, setLoading] = useState(false);
11
+ const [allTabPage, setAllTabPage] = useState(0);
12
+ const [allTabList, setAllTabList] = useState([]);
13
+ const getAllPage = () => {
14
+ const itemsToAdd = 4;
15
+ // successList에서 잘라낼 시작 인덱스 계산
16
+ const startIndex = 2 + allTabPage * 4;
17
+ const endIndex = startIndex + itemsToAdd;
18
+ const newItems = list.successList.slice(startIndex, endIndex);
19
+ const updatedList = [...allTabList, ...newItems];
20
+ setAllTabList(updatedList);
21
+ // 다음 호출 후 예상 총 개수
22
+ const nextTotalCount = updatedList.length + itemsToAdd;
23
+ // 현재 successList의 길이
24
+ const currentListLength = list.successList.length;
25
+ // 다음 총 개수가 successList 길이를 초과하면 api 호출
26
+ // 예: successList가 24일 때, 22 -> 26이 되면 호출
27
+ if (nextTotalCount > currentListLength) {
28
+ onMoreView();
29
+ }
30
+ // 페이지 상태 증가
31
+ setAllTabPage(allTabPage + 1);
32
+ };
33
+ useEffect(() => {
34
+ if (allTabList.length === 0) {
35
+ setAllTabList(list.successList.slice(0, 2));
36
+ }
37
+ }, [list.successList]);
11
38
  return (<>
12
39
  {tab === '전체' || tab === 'success' ? (tab === 'success' && listCount.success < 1 ? (<NoResult />) : (<>
13
40
  {listCount.success > 0 ? (<div className={'mb-[180px] max-sm:mb-[100px] max-xs:mb-[50px]'}>
14
41
  <Title title={'업무사례'} tab={tab} type={'success'} onClick={str => onMoreViewText(str)} count={listCount.success}/>
15
-
16
42
  {((_a = list.successList) === null || _a === void 0 ? void 0 : _a.length) !== 0 && (<div className={'mb-9 mt-9 grid gap-[30px] sm:grid-cols-2'}>
17
- {(tab === '전체' ? list.successList.slice(0, 4) : list.successList).map((item, index) => {
43
+ {(tab === '전체'
44
+ ? isMobileSize === true
45
+ ? allTabList
46
+ : list.successList.slice(0, 4)
47
+ : list.successList).map((item, index) => {
18
48
  var _a, _b;
19
49
  return (<Link href={!item.center_code.includes('OF')
20
50
  ? item.pathname + 'success_new/' + item.id
21
51
  : `https://${item.office_pathname}/success_new/${item.id}`} target={item.center_code === props.center_code ? '' : '_blank'} className={' overflow-hidden border-[2px] border-solid border-[#ebebebcc]'} key={item.id + item.center_code}>
22
- <p className={`ml-8 inline-block w-auto max-w-[70%] bg-[#2960A7] p-2 px-7 text-center text-[18px] font-[800] text-[#fff] max-lg:text-[16px] max-sm:text-[15px] max-2xs:text-[14px]`}>
23
- <span className={'line-clamp-1'}>{item.sub}</span>
24
- </p>
25
- <div className={'flex flex-col gap-4 p-8 max-sm:pt-6'}>
26
- <div className={'block flex-col items-center gap-[10px] sm:flex sm:flex-row'}>
27
- <div className={'max-sm:mb-4'}>
28
- <p className={` mb-3 flex h-[35px] w-[100px] flex-col items-center justify-center overflow-hidden rounded-[30px] bg-[#F2F6FA] text-center text-[16px] font-[800] leading-[18px] text-[#285FA7] max-sm:hidden max-sm:text-[15px] max-2xs:text-[14px] sm:mb-0 sm:h-[80px] sm:w-[80px] sm:rounded-full`}>
29
- <span className={'line-clamp-2 break-keep px-3 text-center'}>
30
- {item.result}
31
- </span>
32
- </p>
33
-
34
- <data className={'mt-3 block text-[#666666] max-sm:hidden max-sm:text-[14px]'}>
35
- {(_a = item.created_at) === null || _a === void 0 ? void 0 : _a.split('T')[0].replaceAll('-', '.')}
36
- </data>
37
- </div>
38
-
39
- <p className={'mb-8 ml-1 text-[20px] max-xl:mb-4 max-lg:mb-2 max-lg:text-[18px] max-md:text-[15px] max-sm:mb-0 max-sm:text-[17px] sm:ml-4 '}>
40
- {searchColorText(item.title, search)}
41
- </p>
42
- <p className={'mt-6 text-[#666666] max-sm:text-[14px] sm:hidden'}>
43
- {(_b = item.created_at) === null || _b === void 0 ? void 0 : _b.split('T')[0].replaceAll('-', '.')}
52
+ <p className={`ml-8 inline-block w-auto max-w-[70%] bg-[#2960A7] p-2 px-7 text-center text-[18px] font-[800] text-[#fff] max-lg:text-[16px] max-sm:text-[15px] max-2xs:text-[14px]`}>
53
+ <span className={'line-clamp-1'}>{item.sub}</span>
54
+ </p>
55
+ <div className={'flex flex-col gap-4 p-8 max-sm:pt-6'}>
56
+ <div className={'block flex-col items-center gap-[10px] sm:flex sm:flex-row'}>
57
+ <div className={'max-sm:mb-4'}>
58
+ <p className={` mb-3 flex h-[35px] w-[100px] flex-col items-center justify-center overflow-hidden rounded-[30px] bg-[#F2F6FA] text-center text-[16px] font-[800] leading-[18px] text-[#285FA7] max-sm:hidden max-sm:text-[15px] max-2xs:text-[14px] sm:mb-0 sm:h-[80px] sm:w-[80px] sm:rounded-full`}>
59
+ <span className={'line-clamp-2 break-keep px-3 text-center'}>
60
+ {item.result}
61
+ </span>
44
62
  </p>
63
+
64
+ <data className={'mt-3 block text-[#666666] max-sm:hidden max-sm:text-[14px]'}>
65
+ {(_a = item.created_at) === null || _a === void 0 ? void 0 : _a.split('T')[0].replaceAll('-', '.')}
66
+ </data>
45
67
  </div>
68
+
69
+ <p className={'mb-8 ml-1 text-[20px] max-xl:mb-4 max-lg:mb-2 max-lg:text-[18px] max-md:text-[15px] max-sm:mb-0 max-sm:text-[17px] sm:ml-4 '}>
70
+ {searchColorText(item.title, search)}
71
+ </p>
72
+ <p className={'mt-6 text-[#666666] max-sm:text-[14px] sm:hidden'}>
73
+ {(_b = item.created_at) === null || _b === void 0 ? void 0 : _b.split('T')[0].replaceAll('-', '.')}
74
+ </p>
46
75
  </div>
47
- </Link>);
76
+ </div>
77
+ </Link>);
48
78
  })}
49
79
  </div>)}
50
80
  {tab != '전체' && (<ViewMore flag={list.successList.length != listCount.success} loading={loading} totalPage={Math.ceil(listCount.success / 12)} nowPage={pages.successList} func={() => {
51
81
  setLoading(true);
52
82
  onMoreView();
53
83
  setLoading(false);
54
- }}/>)}
84
+ }}/>)}{' '}
85
+ {tab === '전체' && isMobileSize === true && (<ViewMore flag={allTabList.length != listCount.success} func={() => {
86
+ getAllPage();
87
+ }} loading={loading}/>)}
55
88
  </div>) : (<></>)}
56
89
  </>)) : null}
57
90
  </>);
@@ -1,14 +1,15 @@
1
- import React, { useRef, useState } from 'react';
1
+ import React, { useEffect, useRef, useState } from 'react';
2
2
  import Link from 'next/link';
3
3
  import { NoResult } from './NoResult';
4
4
  import uuid from 'react-uuid';
5
- import { IListPagesType, IListTypes } from './integrateType';
5
+ import { IListPagesType, IListTypes, ISuccessTypes } from './integrateType';
6
6
  import { Title } from './Title';
7
7
  import { ViewMore } from './ViewMore';
8
8
  import { useTranslation } from 'next-i18next';
9
9
  import { searchColorText } from '../../common/integrate';
10
10
 
11
11
  const Success = (props: {
12
+ isMobileSize: boolean | null;
12
13
  tab: string;
13
14
  onMoreViewText: (str: string) => void;
14
15
  onMoreView: () => void;
@@ -26,10 +27,44 @@ const Success = (props: {
26
27
  map: number;
27
28
  };
28
29
  }) => {
29
- const { tab, onMoreViewText, list, pages, onMoreView, search, listCount } = props;
30
+ const { tab, onMoreViewText, list, pages, onMoreView, search, listCount, isMobileSize } = props;
30
31
 
31
32
  const [loading, setLoading] = useState<boolean>(false);
32
33
 
34
+ const [allTabPage, setAllTabPage] = useState<number>(0);
35
+ const [allTabList, setAllTabList] = useState<ISuccessTypes[]>([]);
36
+
37
+ const getAllPage = () => {
38
+ const itemsToAdd = 4;
39
+
40
+ // successList에서 잘라낼 시작 인덱스 계산
41
+ const startIndex = 2 + allTabPage * 4;
42
+ const endIndex = startIndex + itemsToAdd;
43
+ const newItems = list.successList.slice(startIndex, endIndex);
44
+ const updatedList = [...allTabList, ...newItems];
45
+ setAllTabList(updatedList);
46
+
47
+ // 다음 호출 후 예상 총 개수
48
+ const nextTotalCount = updatedList.length + itemsToAdd;
49
+ // 현재 successList의 길이
50
+ const currentListLength = list.successList.length;
51
+
52
+ // 다음 총 개수가 successList 길이를 초과하면 api 호출
53
+ // 예: successList가 24일 때, 22 -> 26이 되면 호출
54
+ if (nextTotalCount > currentListLength) {
55
+ onMoreView();
56
+ }
57
+
58
+ // 페이지 상태 증가
59
+ setAllTabPage(allTabPage + 1);
60
+ };
61
+
62
+ useEffect(() => {
63
+ if (allTabList.length === 0) {
64
+ setAllTabList(list.successList.slice(0, 2));
65
+ }
66
+ }, [list.successList]);
67
+
33
68
  return (
34
69
  <>
35
70
  {tab === '전체' || tab === 'success' ? (
@@ -46,81 +81,81 @@ const Success = (props: {
46
81
  onClick={str => onMoreViewText(str)}
47
82
  count={listCount.success}
48
83
  />
49
-
50
84
  {list.successList?.length !== 0 && (
51
85
  <div className={'mb-9 mt-9 grid gap-[30px] sm:grid-cols-2'}>
52
- {(tab === '전체' ? list.successList.slice(0, 4) : list.successList).map(
53
- (item, index) => {
54
- return (
55
- <Link
56
- href={
57
- !item.center_code.includes('OF')
58
- ? item.pathname + 'success_new/' + item.id
59
- : `https://${item.office_pathname}/success_new/${item.id}`
60
- }
61
- target={item.center_code === props.center_code ? '' : '_blank'}
62
- className={
63
- ' overflow-hidden border-[2px] border-solid border-[#ebebebcc]'
64
- }
65
- key={item.id + item.center_code}
86
+ {(tab === '전체'
87
+ ? isMobileSize === true
88
+ ? allTabList
89
+ : list.successList.slice(0, 4)
90
+ : list.successList
91
+ ).map((item, index) => {
92
+ return (
93
+ <Link
94
+ href={
95
+ !item.center_code.includes('OF')
96
+ ? item.pathname + 'success_new/' + item.id
97
+ : `https://${item.office_pathname}/success_new/${item.id}`
98
+ }
99
+ target={item.center_code === props.center_code ? '' : '_blank'}
100
+ className={
101
+ ' overflow-hidden border-[2px] border-solid border-[#ebebebcc]'
102
+ }
103
+ key={item.id + item.center_code}
104
+ >
105
+ <p
106
+ className={`ml-8 inline-block w-auto max-w-[70%] bg-[#2960A7] p-2 px-7 text-center text-[18px] font-[800] text-[#fff] max-lg:text-[16px] max-sm:text-[15px] max-2xs:text-[14px]`}
66
107
  >
67
- <p
68
- className={`ml-8 inline-block w-auto max-w-[70%] bg-[#2960A7] p-2 px-7 text-center text-[18px] font-[800] text-[#fff] max-lg:text-[16px] max-sm:text-[15px] max-2xs:text-[14px]`}
108
+ <span className={'line-clamp-1'}>{item.sub}</span>
109
+ </p>
110
+ <div className={'flex flex-col gap-4 p-8 max-sm:pt-6'}>
111
+ <div
112
+ className={
113
+ 'block flex-col items-center gap-[10px] sm:flex sm:flex-row'
114
+ }
69
115
  >
70
- <span className={'line-clamp-1'}>{item.sub}</span>
71
- </p>
72
- <div className={'flex flex-col gap-4 p-8 max-sm:pt-6'}>
73
- <div
74
- className={
75
- 'block flex-col items-center gap-[10px] sm:flex sm:flex-row'
76
- }
77
- >
78
- <div className={'max-sm:mb-4'}>
79
- <p
80
- className={` mb-3 flex h-[35px] w-[100px] flex-col items-center justify-center overflow-hidden rounded-[30px] bg-[#F2F6FA] text-center text-[16px] font-[800] leading-[18px] text-[#285FA7] max-sm:hidden max-sm:text-[15px] max-2xs:text-[14px] sm:mb-0 sm:h-[80px] sm:w-[80px] sm:rounded-full`}
81
- >
82
- <span
83
- className={
84
- 'line-clamp-2 break-keep px-3 text-center'
85
- }
86
- >
87
- {item.result}
88
- </span>
89
- </p>
90
-
91
- <data
116
+ <div className={'max-sm:mb-4'}>
117
+ <p
118
+ className={` mb-3 flex h-[35px] w-[100px] flex-col items-center justify-center overflow-hidden rounded-[30px] bg-[#F2F6FA] text-center text-[16px] font-[800] leading-[18px] text-[#285FA7] max-sm:hidden max-sm:text-[15px] max-2xs:text-[14px] sm:mb-0 sm:h-[80px] sm:w-[80px] sm:rounded-full`}
119
+ >
120
+ <span
92
121
  className={
93
- 'mt-3 block text-[#666666] max-sm:hidden max-sm:text-[14px]'
122
+ 'line-clamp-2 break-keep px-3 text-center'
94
123
  }
95
124
  >
96
- {item.created_at
97
- ?.split('T')[0]
98
- .replaceAll('-', '.')}
99
- </data>
100
- </div>
101
-
102
- <p
103
- className={
104
- 'mb-8 ml-1 text-[20px] max-xl:mb-4 max-lg:mb-2 max-lg:text-[18px] max-md:text-[15px] max-sm:mb-0 max-sm:text-[17px] sm:ml-4 '
105
- }
106
- >
107
- {searchColorText(item.title, search)}
125
+ {item.result}
126
+ </span>
108
127
  </p>
109
- <p
128
+
129
+ <data
110
130
  className={
111
- 'mt-6 text-[#666666] max-sm:text-[14px] sm:hidden'
131
+ 'mt-3 block text-[#666666] max-sm:hidden max-sm:text-[14px]'
112
132
  }
113
133
  >
114
134
  {item.created_at
115
135
  ?.split('T')[0]
116
136
  .replaceAll('-', '.')}
117
- </p>
137
+ </data>
118
138
  </div>
139
+
140
+ <p
141
+ className={
142
+ 'mb-8 ml-1 text-[20px] max-xl:mb-4 max-lg:mb-2 max-lg:text-[18px] max-md:text-[15px] max-sm:mb-0 max-sm:text-[17px] sm:ml-4 '
143
+ }
144
+ >
145
+ {searchColorText(item.title, search)}
146
+ </p>
147
+ <p
148
+ className={
149
+ 'mt-6 text-[#666666] max-sm:text-[14px] sm:hidden'
150
+ }
151
+ >
152
+ {item.created_at?.split('T')[0].replaceAll('-', '.')}
153
+ </p>
119
154
  </div>
120
- </Link>
121
- );
122
- }
123
- )}
155
+ </div>
156
+ </Link>
157
+ );
158
+ })}
124
159
  </div>
125
160
  )}
126
161
  {tab != '전체' && (
@@ -135,6 +170,15 @@ const Success = (props: {
135
170
  setLoading(false);
136
171
  }}
137
172
  />
173
+ )}{' '}
174
+ {tab === '전체' && isMobileSize === true && (
175
+ <ViewMore
176
+ flag={allTabList.length != listCount.success}
177
+ func={() => {
178
+ getAllPage();
179
+ }}
180
+ loading={loading}
181
+ />
138
182
  )}
139
183
  </div>
140
184
  ) : (
@@ -1,6 +1,10 @@
1
1
  import Image from 'next/image';
2
2
  import React from 'react';
3
+ import Link from 'next/link';
4
+ import { useSearchParams } from 'next/navigation';
3
5
  export const Title = (props) => {
6
+ const searchParams = useSearchParams();
7
+ const querySearch = searchParams.get('search');
4
8
  return (<div className={`mb-6 w-full font-semibold`}>
5
9
  <div className={'mb-[18px] flex items-center justify-between'}>
6
10
  <p className={'text-[36px] max-lg:text-[30px] max-sm:text-[26px]'}>
@@ -10,16 +14,16 @@ export const Title = (props) => {
10
14
  ({props.count.toLocaleString()})
11
15
  </span>)}
12
16
  </p>
13
- {props.tab === '전체' && !props.noMoreView && (<button tabIndex={0} className={'flex cursor-pointer items-center justify-between text-black sm:mt-3 lg:mt-6 xl:mt-7 '} onClick={() => {
17
+ {props.tab === '전체' && !props.noMoreView && (<Link href={`/integrate?search=${querySearch}&tab=${props.type}`} tabIndex={0} className={'flex cursor-pointer items-center justify-between text-black sm:mt-3 lg:mt-6 xl:mt-7 '} onClick={() => {
14
18
  props.onClick(props.type);
15
19
  }} onKeyDown={(e) => {
16
20
  if (e.key === 'Enter') {
17
21
  props.onClick(props.type);
18
22
  }
19
- }} aria-label={`${props.title === '오시는길' ? '오시는길 페이지로 이동' : props.title + ' 더보기'}`}>
23
+ }}>
20
24
  <span className={'mt-[1px] max-sm:hidden'}>더보기</span>
21
25
  <Image src={'/images/integrate/right.webp'} alt={''} title={''} width={30} height={30} className={'ml-3 h-[14px] w-[22px]'}/>
22
- </button>)}
26
+ </Link>)}
23
27
  </div>
24
28
  <div className={'border-b-[2px] border-solid border-[#B5B5B5] ' + `${props.noUnderBorder ? 'hidden' : ''}`}></div>
25
29
  </div>);
@@ -1,5 +1,7 @@
1
1
  import Image from 'next/image';
2
2
  import React from 'react';
3
+ import Link from 'next/link';
4
+ import { useSearchParams } from 'next/navigation';
3
5
 
4
6
  export const Title = (props: {
5
7
  title: string;
@@ -10,6 +12,9 @@ export const Title = (props: {
10
12
  noUnderBorder?: boolean; //밑줄삭제
11
13
  noMoreView?: boolean; //더보기버튼 삭제
12
14
  }) => {
15
+ const searchParams = useSearchParams();
16
+ const querySearch = searchParams.get('search');
17
+
13
18
  return (
14
19
  <div className={`mb-6 w-full font-semibold`}>
15
20
  <div className={'mb-[18px] flex items-center justify-between'}>
@@ -25,7 +30,8 @@ export const Title = (props: {
25
30
  )}
26
31
  </p>
27
32
  {props.tab === '전체' && !props.noMoreView && (
28
- <button
33
+ <Link
34
+ href={`/integrate?search=${querySearch}&tab=${props.type}`}
29
35
  tabIndex={0}
30
36
  className={
31
37
  'flex cursor-pointer items-center justify-between text-black sm:mt-3 lg:mt-6 xl:mt-7 '
@@ -38,7 +44,6 @@ export const Title = (props: {
38
44
  props.onClick(props.type);
39
45
  }
40
46
  }}
41
- aria-label={`${props.title === '오시는길' ? '오시는길 페이지로 이동' : props.title + ' 더보기'}`}
42
47
  >
43
48
  <span className={'mt-[1px] max-sm:hidden'}>더보기</span>
44
49
  <Image
@@ -49,7 +54,7 @@ export const Title = (props: {
49
54
  height={30}
50
55
  className={'ml-3 h-[14px] w-[22px]'}
51
56
  />
52
- </button>
57
+ </Link>
53
58
  )}
54
59
  </div>
55
60
  <div
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export declare const ViewMore: (props: {
3
3
  func: () => void;
4
- loading: boolean;
4
+ loading?: boolean;
5
5
  flag: boolean;
6
6
  totalPage?: number;
7
7
  nowPage?: number;
@@ -3,26 +3,26 @@ import React from 'react';
3
3
  import Loader from '../../Loader/Loader';
4
4
  export const ViewMore = (props) => {
5
5
  const { func, loading, flag, totalPage, nowPage, label = '' } = props;
6
- const isNotLastPage = nowPage && totalPage ? nowPage - 1 !== totalPage : false;
7
6
  const labelTxt = `${label} 글 더보기${nowPage && totalPage ? ` ${totalPage}페이지 중 ${nowPage - 1}페이지` : ''}`;
8
7
  return (<>
9
- {loading ? (<b className={'mb-20 text-center'}>
10
- <Loader />
11
- </b>) : (<button aria-label={labelTxt} className={'relative m-auto mb-20 mt-20 flex w-[10em] cursor-pointer items-center border-[1px] border-solid border-[#707070] px-5 py-4 text-[#666666] ' +
12
- (isNotLastPage ? 'justify-between ' : 'pointer-events-none justify-center')} onKeyDown={(e) => {
8
+ {flag ? (loading ? (<b className={'mb-20 text-center'}>
9
+ <Loader />
10
+ </b>) : (<button aria-label={labelTxt} className={(nowPage && totalPage ? ' px-5 ' : ' px-10 ') +
11
+ 'relative m-auto mb-20 mt-20 flex w-[10em] cursor-pointer items-center justify-between border-[1px] border-solid border-[#707070] py-4 text-[#666666] '} onKeyDown={(e) => {
13
12
  if (e.key === 'Enter') {
14
13
  func();
15
14
  }
16
15
  }} onClick={() => {
17
16
  func();
18
17
  }}>
19
- <span className={'pt-[2px] leading-[15px] text-[#666666] '}>
20
- 더보기{' '}
21
- {nowPage && totalPage ? (<>
22
- {nowPage - 1}/{totalPage}{' '}
23
- </>) : (<></>)}
24
- </span>
25
- {isNotLastPage ? (<Image src={'/images/plus_g.webp'} alt={''} width={30} height={30} className={'aspect-square w-[18px] max-lg:w-[16px] max-sm:w-[15px] max-2xs:w-[13px]'}/>) : (<></>)}
26
- </button>)}
18
+ <p className={'pt-[2px] leading-[15px] text-[#666666] '}>
19
+ 더보기
20
+ {nowPage && totalPage ? (<span>
21
+ {nowPage - 1}/{totalPage}{' '}
22
+ </span>) : (<></>)}
23
+ </p>
24
+
25
+ <Image src={'/images/plus_g.webp'} alt={''} width={44} height={44} className={'h-auto w-[18px] max-lg:w-[16px] max-sm:w-[15px] max-2xs:w-[13px]'}/>
26
+ </button>)) : null}
27
27
  </>);
28
28
  };