@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.
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/components/page/Integrate/Broadcast.d.ts +1 -0
- package/dist/components/page/Integrate/Broadcast.jsx +81 -48
- package/dist/components/page/Integrate/Broadcast.tsx +153 -114
- package/dist/components/page/Integrate/Field.d.ts +1 -0
- package/dist/components/page/Integrate/Field.jsx +40 -16
- package/dist/components/page/Integrate/Field.tsx +66 -32
- package/dist/components/page/Integrate/LawInfo.d.ts +1 -0
- package/dist/components/page/Integrate/LawInfo.jsx +37 -4
- package/dist/components/page/Integrate/LawInfo.tsx +51 -5
- package/dist/components/page/Integrate/Lawyer.d.ts +1 -0
- package/dist/components/page/Integrate/Lawyer.jsx +38 -14
- package/dist/components/page/Integrate/Lawyer.tsx +62 -30
- package/dist/components/page/Integrate/Map.d.ts +1 -0
- package/dist/components/page/Integrate/Map.jsx +45 -31
- package/dist/components/page/Integrate/Map.tsx +57 -42
- package/dist/components/page/Integrate/Reply.d.ts +1 -0
- package/dist/components/page/Integrate/Reply.jsx +55 -22
- package/dist/components/page/Integrate/Reply.tsx +102 -60
- package/dist/components/page/Integrate/SearchData.jsx +29 -12
- package/dist/components/page/Integrate/SearchData.tsx +30 -5
- package/dist/components/page/Integrate/Success.d.ts +1 -0
- package/dist/components/page/Integrate/Success.jsx +61 -28
- package/dist/components/page/Integrate/Success.tsx +106 -62
- package/dist/components/page/Integrate/Title.jsx +7 -3
- package/dist/components/page/Integrate/Title.tsx +8 -3
- package/dist/components/page/Integrate/ViewMore.d.ts +1 -1
- package/dist/components/page/Integrate/ViewMore.jsx +13 -13
- package/dist/components/page/Integrate/ViewMore.tsx +38 -41
- package/dist/components/page/MyCase/_fetchers/addMyFileUpload.js +2 -2
- package/dist/components/page/MyCase/_fetchers/addMyFileUpload.ts +2 -2
- package/dist/styles/globals.css +182 -177
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { IListPagesType, IListTypes } from './integrateType';
|
|
2
|
-
import React, { useRef, useState } from 'react';
|
|
1
|
+
import { IListPagesType, IListTypes, IMapTypes } from './integrateType';
|
|
2
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import Image from 'next/image';
|
|
4
4
|
import { useTranslation } from 'next-i18next';
|
|
5
5
|
import { NoResult } from './NoResult';
|
|
6
6
|
import { Title } from './Title';
|
|
7
7
|
import { ViewMore } from './ViewMore';
|
|
8
|
-
import { useRouter } from 'next/
|
|
8
|
+
import { useRouter } from 'next/navigation';
|
|
9
9
|
import { searchColorText } from '../../common/integrate';
|
|
10
10
|
|
|
11
11
|
const Map = (props: {
|
|
12
|
+
isMobileSize: boolean | null;
|
|
12
13
|
tab: string;
|
|
13
14
|
onMoreViewText: (str: string) => void;
|
|
14
15
|
onMoreView: () => void;
|
|
@@ -26,9 +27,42 @@ const Map = (props: {
|
|
|
26
27
|
};
|
|
27
28
|
}) => {
|
|
28
29
|
const router = useRouter();
|
|
29
|
-
const { tab, onMoreViewText, list, pages } = props;
|
|
30
|
+
const { tab, onMoreViewText, list, isMobileSize, pages } = props;
|
|
30
31
|
|
|
31
32
|
const [loading, setLoading] = useState<boolean>(false);
|
|
33
|
+
const [allTabPage, setAllTabPage] = useState<number>(0);
|
|
34
|
+
const [allTabList, setAllTabList] = useState<IMapTypes[]>([]);
|
|
35
|
+
|
|
36
|
+
const getAllPage = () => {
|
|
37
|
+
const itemsToAdd = 5;
|
|
38
|
+
|
|
39
|
+
// imapList에서 잘라낼 시작 인덱스 계산
|
|
40
|
+
const startIndex = 5 + allTabPage * 5;
|
|
41
|
+
const endIndex = startIndex + itemsToAdd;
|
|
42
|
+
const newItems = list.mapList.slice(startIndex, endIndex);
|
|
43
|
+
const updatedList = [...allTabList, ...newItems];
|
|
44
|
+
setAllTabList(updatedList);
|
|
45
|
+
|
|
46
|
+
// 다음 호출 후 예상 총 개수
|
|
47
|
+
const nextTotalCount = updatedList.length + itemsToAdd;
|
|
48
|
+
// 현재 successList의 길이
|
|
49
|
+
const currentListLength = list.mapList.length;
|
|
50
|
+
|
|
51
|
+
// 다음 총 개수가 mapList 길이를 초과하면 api 호출
|
|
52
|
+
// 예: mapList가 24일 때, 22 -> 26이 되면 호출
|
|
53
|
+
if (nextTotalCount > currentListLength) {
|
|
54
|
+
props.onMoreView();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 페이지 상태 증가
|
|
58
|
+
setAllTabPage(allTabPage + 1);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (allTabList.length === 0) {
|
|
63
|
+
setAllTabList(list.mapList.slice(0, 5));
|
|
64
|
+
}
|
|
65
|
+
}, [list.mapList]);
|
|
32
66
|
|
|
33
67
|
return props.tab === '전체' || props.tab === 'map' ? (
|
|
34
68
|
//구성원 탭에서는 결과 없음
|
|
@@ -44,21 +78,18 @@ const Map = (props: {
|
|
|
44
78
|
tab={tab}
|
|
45
79
|
type={'map'}
|
|
46
80
|
count={props.listCount.map}
|
|
47
|
-
onClick={
|
|
48
|
-
await router.push('/map');
|
|
49
|
-
}}
|
|
81
|
+
onClick={str => onMoreViewText(str)}
|
|
50
82
|
/>
|
|
51
|
-
|
|
52
83
|
<div className={'mt-[-1.5rem] w-full'}>
|
|
53
|
-
{(tab === '전체'
|
|
54
|
-
?
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
84
|
+
{(tab === '전체'
|
|
85
|
+
? isMobileSize === true
|
|
86
|
+
? allTabList
|
|
87
|
+
: list.mapList.slice(0, 5)
|
|
88
|
+
: list.mapList
|
|
58
89
|
).map((item, index: number) => {
|
|
59
90
|
return (
|
|
60
91
|
<div
|
|
61
|
-
key={'
|
|
92
|
+
key={'integrate_map' + item.key}
|
|
62
93
|
className={
|
|
63
94
|
'group/mapBox flex gap-[60px] border-b-[1px] border-solid border-[#DDDDDD] hover:bg-[#FCFCFC] ' +
|
|
64
95
|
//1280px
|
|
@@ -144,7 +175,7 @@ const Map = (props: {
|
|
|
144
175
|
}
|
|
145
176
|
>
|
|
146
177
|
<MapInfoCon
|
|
147
|
-
locale={
|
|
178
|
+
locale={'ko'}
|
|
148
179
|
title={'주소'}
|
|
149
180
|
text={
|
|
150
181
|
<>
|
|
@@ -155,7 +186,7 @@ const Map = (props: {
|
|
|
155
186
|
}
|
|
156
187
|
/>
|
|
157
188
|
<MapInfoCon
|
|
158
|
-
locale={
|
|
189
|
+
locale={'ko'}
|
|
159
190
|
title={'업무시간'}
|
|
160
191
|
text={
|
|
161
192
|
<>
|
|
@@ -170,17 +201,13 @@ const Map = (props: {
|
|
|
170
201
|
</>
|
|
171
202
|
}
|
|
172
203
|
/>
|
|
173
|
-
<MapInfoCon
|
|
174
|
-
locale={router.locale ?? ''}
|
|
175
|
-
title={'대표번호'}
|
|
176
|
-
text={<>{item.tel}</>}
|
|
177
|
-
/>
|
|
204
|
+
<MapInfoCon locale={'ko'} title={'대표번호'} text={<>{item.tel}</>} />
|
|
178
205
|
</span>
|
|
179
206
|
</div>
|
|
180
207
|
);
|
|
181
208
|
})}
|
|
182
209
|
</div>
|
|
183
|
-
{tab != '전체'
|
|
210
|
+
{tab != '전체' && (
|
|
184
211
|
<ViewMore
|
|
185
212
|
flag={list.mapList.length != props.listCount.map}
|
|
186
213
|
func={() => {
|
|
@@ -192,26 +219,14 @@ const Map = (props: {
|
|
|
192
219
|
totalPage={Math.ceil(props.listCount.map / 12)}
|
|
193
220
|
nowPage={pages.mapList}
|
|
194
221
|
/>
|
|
195
|
-
)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
<span className={'pt-[2px] leading-[15px] text-[#666666] '}>더보기</span>
|
|
204
|
-
<Image
|
|
205
|
-
src={'/images/plus_g.webp'}
|
|
206
|
-
alt={'+'}
|
|
207
|
-
title={'+'}
|
|
208
|
-
width={30}
|
|
209
|
-
height={30}
|
|
210
|
-
className={
|
|
211
|
-
'aspect-square w-[18px] max-lg:w-[16px] max-sm:w-[15px] max-2xs:w-[13px]'
|
|
212
|
-
}
|
|
213
|
-
/>
|
|
214
|
-
</button>
|
|
222
|
+
)}
|
|
223
|
+
{tab === '전체' && isMobileSize === true && (
|
|
224
|
+
<ViewMore
|
|
225
|
+
flag={allTabList.length != props.listCount.map}
|
|
226
|
+
func={() => {
|
|
227
|
+
getAllPage();
|
|
228
|
+
}}
|
|
229
|
+
/>
|
|
215
230
|
)}
|
|
216
231
|
</div>
|
|
217
232
|
) : (
|
|
@@ -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 dayjs from 'dayjs';
|
|
@@ -6,47 +6,80 @@ import { Title } from './Title';
|
|
|
6
6
|
import { ViewMore } from './ViewMore';
|
|
7
7
|
import { searchColorText } from '../../common/integrate';
|
|
8
8
|
const Reply = (props) => {
|
|
9
|
-
const { tab, onMoreViewText, list, pages, onMoreView, search, listCount } = props;
|
|
9
|
+
const { tab, onMoreViewText, list, pages, isMobileSize, onMoreView, search, listCount } = 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
|
+
// replyList에서 잘라낼 시작 인덱스 계산
|
|
16
|
+
const startIndex = 2 + allTabPage * 4;
|
|
17
|
+
const endIndex = startIndex + itemsToAdd;
|
|
18
|
+
const newItems = list.replyList.slice(startIndex, endIndex);
|
|
19
|
+
const updatedList = [...allTabList, ...newItems];
|
|
20
|
+
setAllTabList(updatedList);
|
|
21
|
+
// 다음 호출 후 예상 총 개수
|
|
22
|
+
const nextTotalCount = updatedList.length + itemsToAdd;
|
|
23
|
+
// 현재 replyList의 길이
|
|
24
|
+
const currentListLength = list.replyList.length;
|
|
25
|
+
// 다음 총 개수가 replyList 길이를 초과하면 api 호출
|
|
26
|
+
// 예: replyList가 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.replyList.slice(0, 2));
|
|
36
|
+
}
|
|
37
|
+
}, [list.replyList]);
|
|
11
38
|
return (<>
|
|
12
39
|
{tab === '전체' || tab === 'reply' ? (tab === 'reply' && listCount.reply < 1 ? (<NoResult />) : (<>
|
|
13
40
|
{listCount.reply > 0 ? (<div className={'mb-[180px] max-sm:mb-[100px] max-xs:mb-[50px]'}>
|
|
14
41
|
<Title title={'고객후기'} tab={tab} type={'reply'} onClick={str => onMoreViewText(str)} count={listCount.reply}/>
|
|
15
|
-
|
|
16
42
|
<div className={'mb-9 mt-8 grid gap-[18px] sm:grid-cols-2'}>
|
|
17
|
-
{(tab === '전체'
|
|
18
|
-
|
|
19
|
-
|
|
43
|
+
{(tab === '전체'
|
|
44
|
+
? isMobileSize === true
|
|
45
|
+
? allTabList
|
|
46
|
+
: list.replyList.slice(0, 4)
|
|
47
|
+
: list.replyList).map((item, index) => {
|
|
48
|
+
return (<div key={'reply' + item.id} className={'h-[280px] border-[5px] border-solid border-[#EAEAEA] p-7 max-xs:h-[190px] max-xs:p-4 sm:p-8 '}>
|
|
49
|
+
<Link href={(item.crime_code != props.crime_code
|
|
20
50
|
? 'https://www.daeryunlaw.com'
|
|
21
51
|
: '') +
|
|
22
52
|
'/reply/' +
|
|
23
53
|
item.id} target={item.crime_code === props.crime_code ? '' : '_blank'}>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
54
|
+
<div className={'flex flex-col'}>
|
|
55
|
+
<p className={'h-[70px] text-[20px] font-[800] max-xs:h-[60px] max-xs:text-[18px] sm:text-[22px]'}>
|
|
56
|
+
<span className={'text-[#285FA7]'}>{item.etc4} </span>
|
|
57
|
+
<br className={'block sm:hidden'}/>
|
|
58
|
+
{item.etc5}
|
|
59
|
+
</p>
|
|
60
|
+
<p className={'mb-[20px] mt-[10px] line-clamp-2 h-[50px] text-[18px] text-[#555555] max-sm:mb-[40px] max-sm:mt-[20px] max-sm:text-[16px] max-xs:mb-0 max-xs:mt-[5px] max-xs:h-[40px] max-xs:text-[15px]'}>
|
|
61
|
+
{searchColorText(item.summary
|
|
32
62
|
.replaceAll(/<(\/)?[a-zA-Z0-9]*(\s[a-zA-Z]*=[^>]*)?(\s)*(\/)?>/gi, '')
|
|
33
63
|
.replaceAll(' ', ' '), search)}
|
|
64
|
+
</p>
|
|
65
|
+
<div className={'mt-6 flex items-center text-[#666666] sm:mt-8'}>
|
|
66
|
+
<p className={'w-[20%] text-[17px] max-xl:w-[35%] max-md:w-[50%] max-sm:w-[30%] max-sm:text-[15px]'}>
|
|
67
|
+
{dayjs(item.timestamp).format('YYYY.MM.DD')}
|
|
34
68
|
</p>
|
|
35
|
-
<div className={'
|
|
36
|
-
<p className={'w-[20%] text-[17px] max-xl:w-[35%] max-md:w-[50%] max-sm:w-[30%] max-sm:text-[15px]'}>
|
|
37
|
-
{dayjs(item.timestamp).format('YYYY.MM.DD')}
|
|
38
|
-
</p>
|
|
39
|
-
<div className={'h-[2px] w-[80%] bg-[#D8D8D8] max-xl:w-[65%] max-md:w-[50%] max-sm:w-[70%]'}></div>
|
|
40
|
-
</div>
|
|
69
|
+
<div className={'h-[2px] w-[80%] bg-[#D8D8D8] max-xl:w-[65%] max-md:w-[50%] max-sm:w-[70%]'}></div>
|
|
41
70
|
</div>
|
|
42
|
-
</
|
|
43
|
-
</
|
|
71
|
+
</div>
|
|
72
|
+
</Link>
|
|
73
|
+
</div>);
|
|
44
74
|
})}
|
|
45
75
|
</div>
|
|
46
76
|
{tab != '전체' && (<ViewMore flag={list.replyList.length != listCount.reply} loading={loading} totalPage={Math.ceil(listCount.reply / 12)} nowPage={pages.replyList} func={() => {
|
|
47
77
|
setLoading(true);
|
|
48
78
|
onMoreView();
|
|
49
79
|
setLoading(false);
|
|
80
|
+
}}/>)}{' '}
|
|
81
|
+
{tab === '전체' && isMobileSize === true && (<ViewMore loading={loading} flag={allTabList.length != listCount.reply} func={() => {
|
|
82
|
+
getAllPage();
|
|
50
83
|
}}/>)}
|
|
51
84
|
</div>) : (<></>)}
|
|
52
85
|
</>)) : null}
|
|
@@ -3,13 +3,14 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
3
3
|
import Link from 'next/link';
|
|
4
4
|
import { NoResult } from './NoResult';
|
|
5
5
|
import dayjs from 'dayjs';
|
|
6
|
-
import { IListPagesType, IListTypes } from './integrateType';
|
|
6
|
+
import { IListPagesType, IListTypes, IReplyTypes } from './integrateType';
|
|
7
7
|
import { Title } from './Title';
|
|
8
8
|
import { ViewMore } from './ViewMore';
|
|
9
9
|
import { useTranslation } from 'next-i18next';
|
|
10
10
|
import { searchColorText } from '../../common/integrate';
|
|
11
11
|
|
|
12
12
|
const Reply = (props: {
|
|
13
|
+
isMobileSize: boolean | null;
|
|
13
14
|
tab: string;
|
|
14
15
|
onMoreViewText: (str: string) => void;
|
|
15
16
|
onMoreView: () => void;
|
|
@@ -27,10 +28,42 @@ const Reply = (props: {
|
|
|
27
28
|
map: number;
|
|
28
29
|
};
|
|
29
30
|
}) => {
|
|
30
|
-
const { tab, onMoreViewText, list, pages, onMoreView, search, listCount } = props;
|
|
31
|
+
const { tab, onMoreViewText, list, pages, isMobileSize, onMoreView, search, listCount } = props;
|
|
31
32
|
|
|
32
33
|
const [loading, setLoading] = useState<boolean>(false);
|
|
34
|
+
const [allTabPage, setAllTabPage] = useState<number>(0);
|
|
35
|
+
const [allTabList, setAllTabList] = useState<IReplyTypes[]>([]);
|
|
33
36
|
|
|
37
|
+
const getAllPage = () => {
|
|
38
|
+
const itemsToAdd = 4;
|
|
39
|
+
|
|
40
|
+
// replyList에서 잘라낼 시작 인덱스 계산
|
|
41
|
+
const startIndex = 2 + allTabPage * 4;
|
|
42
|
+
const endIndex = startIndex + itemsToAdd;
|
|
43
|
+
const newItems = list.replyList.slice(startIndex, endIndex);
|
|
44
|
+
const updatedList = [...allTabList, ...newItems];
|
|
45
|
+
setAllTabList(updatedList);
|
|
46
|
+
|
|
47
|
+
// 다음 호출 후 예상 총 개수
|
|
48
|
+
const nextTotalCount = updatedList.length + itemsToAdd;
|
|
49
|
+
// 현재 replyList의 길이
|
|
50
|
+
const currentListLength = list.replyList.length;
|
|
51
|
+
|
|
52
|
+
// 다음 총 개수가 replyList 길이를 초과하면 api 호출
|
|
53
|
+
// 예: replyList가 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.replyList.slice(0, 2));
|
|
65
|
+
}
|
|
66
|
+
}, [list.replyList]);
|
|
34
67
|
return (
|
|
35
68
|
<>
|
|
36
69
|
{tab === '전체' || tab === 'reply' ? (
|
|
@@ -47,76 +80,76 @@ const Reply = (props: {
|
|
|
47
80
|
onClick={str => onMoreViewText(str)}
|
|
48
81
|
count={listCount.reply}
|
|
49
82
|
/>
|
|
50
|
-
|
|
51
83
|
<div className={'mb-9 mt-8 grid gap-[18px] sm:grid-cols-2'}>
|
|
52
|
-
{(tab === '전체'
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
84
|
+
{(tab === '전체'
|
|
85
|
+
? isMobileSize === true
|
|
86
|
+
? allTabList
|
|
87
|
+
: list.replyList.slice(0, 4)
|
|
88
|
+
: list.replyList
|
|
89
|
+
).map((item, index) => {
|
|
90
|
+
return (
|
|
91
|
+
<div
|
|
92
|
+
key={'reply' + item.id}
|
|
93
|
+
className={
|
|
94
|
+
'h-[280px] border-[5px] border-solid border-[#EAEAEA] p-7 max-xs:h-[190px] max-xs:p-4 sm:p-8 '
|
|
95
|
+
}
|
|
96
|
+
>
|
|
97
|
+
<Link
|
|
98
|
+
href={
|
|
99
|
+
(item.crime_code != props.crime_code
|
|
100
|
+
? 'https://www.daeryunlaw.com'
|
|
101
|
+
: '') +
|
|
102
|
+
'/reply/' +
|
|
103
|
+
item.id
|
|
59
104
|
}
|
|
105
|
+
target={item.crime_code === props.crime_code ? '' : '_blank'}
|
|
60
106
|
>
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
item.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
107
|
+
<div className={'flex flex-col'}>
|
|
108
|
+
<p
|
|
109
|
+
className={
|
|
110
|
+
'h-[70px] text-[20px] font-[800] max-xs:h-[60px] max-xs:text-[18px] sm:text-[22px]'
|
|
111
|
+
}
|
|
112
|
+
>
|
|
113
|
+
<span className={'text-[#285FA7]'}>{item.etc4} </span>
|
|
114
|
+
<br className={'block sm:hidden'} />
|
|
115
|
+
{item.etc5}
|
|
116
|
+
</p>
|
|
117
|
+
<p
|
|
118
|
+
className={
|
|
119
|
+
'mb-[20px] mt-[10px] line-clamp-2 h-[50px] text-[18px] text-[#555555] max-sm:mb-[40px] max-sm:mt-[20px] max-sm:text-[16px] max-xs:mb-0 max-xs:mt-[5px] max-xs:h-[40px] max-xs:text-[15px]'
|
|
120
|
+
}
|
|
121
|
+
>
|
|
122
|
+
{searchColorText(
|
|
123
|
+
item.summary
|
|
124
|
+
.replaceAll(
|
|
125
|
+
/<(\/)?[a-zA-Z0-9]*(\s[a-zA-Z]*=[^>]*)?(\s)*(\/)?>/gi,
|
|
126
|
+
''
|
|
127
|
+
)
|
|
128
|
+
.replaceAll(' ', ' '),
|
|
129
|
+
search
|
|
130
|
+
)}
|
|
131
|
+
</p>
|
|
132
|
+
<div
|
|
133
|
+
className={'mt-6 flex items-center text-[#666666] sm:mt-8'}
|
|
134
|
+
>
|
|
81
135
|
<p
|
|
82
136
|
className={
|
|
83
|
-
'
|
|
137
|
+
'w-[20%] text-[17px] max-xl:w-[35%] max-md:w-[50%] max-sm:w-[30%] max-sm:text-[15px]'
|
|
84
138
|
}
|
|
85
139
|
>
|
|
86
|
-
{
|
|
87
|
-
item.summary
|
|
88
|
-
.replaceAll(
|
|
89
|
-
/<(\/)?[a-zA-Z0-9]*(\s[a-zA-Z]*=[^>]*)?(\s)*(\/)?>/gi,
|
|
90
|
-
''
|
|
91
|
-
)
|
|
92
|
-
.replaceAll(' ', ' '),
|
|
93
|
-
search
|
|
94
|
-
)}
|
|
140
|
+
{dayjs(item.timestamp).format('YYYY.MM.DD')}
|
|
95
141
|
</p>
|
|
96
142
|
<div
|
|
97
143
|
className={
|
|
98
|
-
'
|
|
144
|
+
'h-[2px] w-[80%] bg-[#D8D8D8] max-xl:w-[65%] max-md:w-[50%] max-sm:w-[70%]'
|
|
99
145
|
}
|
|
100
|
-
>
|
|
101
|
-
<p
|
|
102
|
-
className={
|
|
103
|
-
'w-[20%] text-[17px] max-xl:w-[35%] max-md:w-[50%] max-sm:w-[30%] max-sm:text-[15px]'
|
|
104
|
-
}
|
|
105
|
-
>
|
|
106
|
-
{dayjs(item.timestamp).format('YYYY.MM.DD')}
|
|
107
|
-
</p>
|
|
108
|
-
<div
|
|
109
|
-
className={
|
|
110
|
-
'h-[2px] w-[80%] bg-[#D8D8D8] max-xl:w-[65%] max-md:w-[50%] max-sm:w-[70%]'
|
|
111
|
-
}
|
|
112
|
-
></div>
|
|
113
|
-
</div>
|
|
146
|
+
></div>
|
|
114
147
|
</div>
|
|
115
|
-
</
|
|
116
|
-
</
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
)}
|
|
148
|
+
</div>
|
|
149
|
+
</Link>
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
})}
|
|
120
153
|
</div>
|
|
121
154
|
{tab != '전체' && (
|
|
122
155
|
<ViewMore
|
|
@@ -130,6 +163,15 @@ const Reply = (props: {
|
|
|
130
163
|
setLoading(false);
|
|
131
164
|
}}
|
|
132
165
|
/>
|
|
166
|
+
)}{' '}
|
|
167
|
+
{tab === '전체' && isMobileSize === true && (
|
|
168
|
+
<ViewMore
|
|
169
|
+
loading={loading}
|
|
170
|
+
flag={allTabList.length != listCount.reply}
|
|
171
|
+
func={() => {
|
|
172
|
+
getAllPage();
|
|
173
|
+
}}
|
|
174
|
+
/>
|
|
133
175
|
)}
|
|
134
176
|
</div>
|
|
135
177
|
) : (
|
|
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
import React, { useState, useEffect } from 'react';
|
|
12
12
|
import { NoResult } from './NoResult';
|
|
13
13
|
import { searchInit } from './integrateType';
|
|
14
|
-
import { useRouter } from 'next/
|
|
14
|
+
import { useRouter, useSearchParams } from 'next/navigation';
|
|
15
15
|
import Field from './Field';
|
|
16
16
|
import Success from './Success';
|
|
17
17
|
import LawInfo from './LawInfo';
|
|
@@ -19,12 +19,18 @@ import Broadcast from './Broadcast';
|
|
|
19
19
|
import Reply from './Reply';
|
|
20
20
|
import Map from './Map';
|
|
21
21
|
import Lawyer from './Lawyer';
|
|
22
|
+
import useBrowser from '../../hook/useBrowser';
|
|
22
23
|
const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime_code }) => {
|
|
24
|
+
const { width } = useBrowser(true);
|
|
23
25
|
const router = useRouter();
|
|
24
26
|
const [tab, setTab] = useState('');
|
|
25
27
|
const [search, setSearch] = useState('');
|
|
26
28
|
const [list, setList] = useState(searchInit.list);
|
|
27
29
|
const [pages, setPages] = useState(searchInit.pages);
|
|
30
|
+
const [isMobileSize, setIsMobileSize] = useState(null);
|
|
31
|
+
const searchParams = useSearchParams();
|
|
32
|
+
const querySearch = searchParams.get('search');
|
|
33
|
+
const queryTab = searchParams.get('tab');
|
|
28
34
|
const handleMoreView = (key, data) => {
|
|
29
35
|
// @ts-ignore
|
|
30
36
|
setPages(Object.assign(Object.assign({}, pages), { [key]: pages[key] + 1 }));
|
|
@@ -32,19 +38,30 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
|
|
|
32
38
|
setList(Object.assign(Object.assign({}, list), { [key]: [...list[key], ...data] }));
|
|
33
39
|
};
|
|
34
40
|
const handleMoreViewText = (tab) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
-
yield router.push(`/integrate?search=${
|
|
41
|
+
yield router.push(`/integrate?search=${querySearch}&tab=${tab}`);
|
|
36
42
|
});
|
|
37
43
|
useEffect(() => {
|
|
38
44
|
setList(propsList);
|
|
39
45
|
}, [propsList]);
|
|
40
46
|
useEffect(() => {
|
|
41
|
-
setSearch(String(
|
|
42
|
-
setTab(String(
|
|
47
|
+
setSearch(String(querySearch));
|
|
48
|
+
setTab(String(queryTab));
|
|
43
49
|
// setPages(searchInit.pages)
|
|
44
|
-
}, [
|
|
50
|
+
}, [searchParams]);
|
|
51
|
+
//브라우저 체크
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (width != 0 && width < 641 && isMobileSize != true) {
|
|
54
|
+
setIsMobileSize(true);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (width != 0 && width > 640 && isMobileSize != false) {
|
|
58
|
+
setIsMobileSize(false);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}, [width, isMobileSize]);
|
|
45
62
|
return (<span id={'integrate-result'}>
|
|
46
63
|
{tab === '전체' && totalCount < 1 ? (<NoResult />) : (<>
|
|
47
|
-
<Success center_code={center_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
64
|
+
<Success isMobileSize={isMobileSize} center_code={center_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
48
65
|
paramFetch('/api/integrate/list', {
|
|
49
66
|
page: pages.successList,
|
|
50
67
|
type: 'success',
|
|
@@ -56,7 +73,7 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
|
|
|
56
73
|
});
|
|
57
74
|
}} search={search} listCount={listCount}/>
|
|
58
75
|
|
|
59
|
-
<Reply crime_code={crime_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
76
|
+
<Reply isMobileSize={isMobileSize} crime_code={crime_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
60
77
|
paramFetch('/api/integrate/list', {
|
|
61
78
|
page: pages.replyList,
|
|
62
79
|
type: 'reply',
|
|
@@ -68,7 +85,7 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
|
|
|
68
85
|
});
|
|
69
86
|
}} listCount={listCount} search={search}/>
|
|
70
87
|
|
|
71
|
-
<LawInfo center_code={center_code} tab={tab} list={list} pages={pages} listCount={listCount} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
88
|
+
<LawInfo isMobileSize={isMobileSize} center_code={center_code} tab={tab} list={list} pages={pages} listCount={listCount} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
72
89
|
paramFetch('/api/integrate/list', {
|
|
73
90
|
page: pages.infoList,
|
|
74
91
|
type: 'info',
|
|
@@ -80,7 +97,7 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
|
|
|
80
97
|
});
|
|
81
98
|
}} search={search}/>
|
|
82
99
|
|
|
83
|
-
<Lawyer tab={tab} listCount={listCount} list={list} pages={pages} center_code={center_code} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
100
|
+
<Lawyer isMobileSize={isMobileSize} tab={tab} listCount={listCount} list={list} pages={pages} center_code={center_code} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
84
101
|
paramFetch(`api/integrate/list`, {
|
|
85
102
|
page: pages.lawyerList,
|
|
86
103
|
type: 'lawyer',
|
|
@@ -92,7 +109,7 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
|
|
|
92
109
|
});
|
|
93
110
|
}}/>
|
|
94
111
|
|
|
95
|
-
<Broadcast listCount={listCount} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
112
|
+
<Broadcast isMobileSize={isMobileSize} listCount={listCount} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
96
113
|
paramFetch('/api/integrate/list', {
|
|
97
114
|
page: pages.broadcastList,
|
|
98
115
|
type: 'broadcast',
|
|
@@ -104,7 +121,7 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
|
|
|
104
121
|
});
|
|
105
122
|
}} search={search}/>
|
|
106
123
|
|
|
107
|
-
<Field listCount={listCount} center_code={center_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
124
|
+
<Field isMobileSize={isMobileSize} listCount={listCount} center_code={center_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
108
125
|
paramFetch(`/api/integrate/list`, {
|
|
109
126
|
page: pages.fieldList,
|
|
110
127
|
type: 'field',
|
|
@@ -116,7 +133,7 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
|
|
|
116
133
|
});
|
|
117
134
|
}} search={search}/>
|
|
118
135
|
|
|
119
|
-
<Map listCount={listCount} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} search={search} onMoreView={() => {
|
|
136
|
+
<Map isMobileSize={isMobileSize} listCount={listCount} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} search={search} onMoreView={() => {
|
|
120
137
|
paramFetch('/api/integrate/list', {
|
|
121
138
|
page: pages.mapList,
|
|
122
139
|
type: 'map',
|