@daeryun/dr_components 0.4.74 → 0.4.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Footer/index.jsx +2 -2
- package/dist/components/Footer/index.tsx +2 -2
- package/dist/components/common/integrate/index.d.ts +1 -0
- package/dist/components/common/integrate/index.jsx +12 -0
- package/dist/components/common/integrate/index.tsx +21 -0
- package/dist/components/page/Integrate/Lawyer.jsx +35 -17
- package/dist/components/page/Integrate/Lawyer.tsx +41 -19
- package/dist/components/page/Integrate/MenuTab.jsx +14 -73
- package/dist/components/page/Integrate/MenuTab.tsx +28 -119
- package/dist/styles/globals.css +50 -89
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -345,7 +345,7 @@ const FooterSelectBox = (props) => {
|
|
|
345
345
|
{childGroup.code_name} 센터
|
|
346
346
|
</Link>
|
|
347
347
|
</li>
|
|
348
|
-
{childGroup.code === '
|
|
348
|
+
{childGroup.code === 'ICT0005' ? (<li value={'기업인수·합병(M&A)'} className="cursor-pointer px-9 py-[5px] text-[15px] font-[500] duration-150 hover:bg-gray-100">
|
|
349
349
|
<Link href={'https://www.daeryunlaw-mergers.com/'} target="_blank" title={'기업인수·합병(M&A)'} onClick={() => {
|
|
350
350
|
setIsOpen(!isOpen);
|
|
351
351
|
}}>
|
|
@@ -380,7 +380,7 @@ const FooterSelectBox = (props) => {
|
|
|
380
380
|
{childGroup.code_name} 센터
|
|
381
381
|
</Link>
|
|
382
382
|
</li>
|
|
383
|
-
{childGroup.code === '
|
|
383
|
+
{childGroup.code === 'ICT0005' ? (<li value={'기업인수·합병(M&A)'} className="cursor-pointer px-9 py-[5px] text-[15px] font-[500] duration-150 hover:bg-gray-100">
|
|
384
384
|
<Link href={'https://www.daeryunlaw-mergers.com/'} target="_blank" title={'기업인수·합병(M&A)'} onClick={() => {
|
|
385
385
|
setIsOpen(!isOpen);
|
|
386
386
|
}}>
|
|
@@ -593,7 +593,7 @@ const FooterSelectBox = (props: {
|
|
|
593
593
|
{childGroup.code_name} 센터
|
|
594
594
|
</Link>
|
|
595
595
|
</li>
|
|
596
|
-
{childGroup.code === '
|
|
596
|
+
{childGroup.code === 'ICT0005' ? (
|
|
597
597
|
<li
|
|
598
598
|
value={'기업인수·합병(M&A)'}
|
|
599
599
|
className="cursor-pointer px-9 py-[5px] text-[15px] font-[500] duration-150 hover:bg-gray-100"
|
|
@@ -664,7 +664,7 @@ const FooterSelectBox = (props: {
|
|
|
664
664
|
{childGroup.code_name} 센터
|
|
665
665
|
</Link>
|
|
666
666
|
</li>
|
|
667
|
-
{childGroup.code === '
|
|
667
|
+
{childGroup.code === 'ICT0005' ? (
|
|
668
668
|
<li
|
|
669
669
|
value={'기업인수·합병(M&A)'}
|
|
670
670
|
className="cursor-pointer px-9 py-[5px] text-[15px] font-[500] duration-150 hover:bg-gray-100"
|
|
@@ -10,3 +10,4 @@ export declare const tabTypes: {
|
|
|
10
10
|
value: string;
|
|
11
11
|
}[];
|
|
12
12
|
export declare const searchColorText: (title: string, search: string) => string | (string | import("react").JSX.Element)[];
|
|
13
|
+
export declare const searchColorLawyerText: (title: string | null, search: string) => string | (string | import("react").JSX.Element)[] | null;
|
|
@@ -73,3 +73,15 @@ export const searchColorText = (title, search) => {
|
|
|
73
73
|
{part}
|
|
74
74
|
</span>) : (part));
|
|
75
75
|
};
|
|
76
|
+
export const searchColorLawyerText = (title, search) => {
|
|
77
|
+
if (search.trim() === '' || title === null)
|
|
78
|
+
return title;
|
|
79
|
+
const keywords = search.split(/\s+/).filter(Boolean); // 띄어쓰기로 분리 후 빈 값 제거
|
|
80
|
+
const joinedKeyword = keywords.join(''); // 띄어쓰기 없는 버전
|
|
81
|
+
// 정규식 패턴 생성 (띄어쓰기 있는 버전 + 없는 버전)
|
|
82
|
+
const regex = new RegExp(`(${keywords.join('\\s*')}|${joinedKeyword})`, 'gi');
|
|
83
|
+
const parts = title.split(regex);
|
|
84
|
+
return parts.map((part, index) => part.match(regex) ? (<span key={index} className="bg-[#FFF3C4]">
|
|
85
|
+
{part}
|
|
86
|
+
</span>) : (part));
|
|
87
|
+
};
|
|
@@ -84,3 +84,24 @@ export const searchColorText = (title: string, search: string) => {
|
|
|
84
84
|
)
|
|
85
85
|
);
|
|
86
86
|
};
|
|
87
|
+
|
|
88
|
+
export const searchColorLawyerText = (title: string | null, search: string) => {
|
|
89
|
+
if (search.trim() === '' || title === null) return title;
|
|
90
|
+
|
|
91
|
+
const keywords = search.split(/\s+/).filter(Boolean); // 띄어쓰기로 분리 후 빈 값 제거
|
|
92
|
+
const joinedKeyword = keywords.join(''); // 띄어쓰기 없는 버전
|
|
93
|
+
|
|
94
|
+
// 정규식 패턴 생성 (띄어쓰기 있는 버전 + 없는 버전)
|
|
95
|
+
const regex = new RegExp(`(${keywords.join('\\s*')}|${joinedKeyword})`, 'gi');
|
|
96
|
+
|
|
97
|
+
const parts = title.split(regex);
|
|
98
|
+
return parts.map((part, index) =>
|
|
99
|
+
part.match(regex) ? (
|
|
100
|
+
<span key={index} className="bg-[#FFF3C4]">
|
|
101
|
+
{part}
|
|
102
|
+
</span>
|
|
103
|
+
) : (
|
|
104
|
+
part
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
};
|
|
@@ -3,11 +3,12 @@ import { NoResult } from './NoResult';
|
|
|
3
3
|
import { Title } from './Title';
|
|
4
4
|
import { ViewMore } from './ViewMore';
|
|
5
5
|
import mobile from 'is-mobile';
|
|
6
|
-
import {
|
|
6
|
+
import { useSearchParams } from 'next/navigation';
|
|
7
7
|
import Link from 'next/link';
|
|
8
8
|
import Image from 'next/image';
|
|
9
9
|
import style from './index.module.css';
|
|
10
10
|
import Mark from '../../Mark/Mark';
|
|
11
|
+
import { searchColorLawyerText } from '../../common/integrate';
|
|
11
12
|
const Lawyer = (props) => {
|
|
12
13
|
const { tab, onMoreViewText, list, pages, listCount, isMobileSize } = props;
|
|
13
14
|
const [loading, setLoading] = useState(false);
|
|
@@ -75,12 +76,18 @@ export default Lawyer;
|
|
|
75
76
|
const LawyerContainer = (props) => {
|
|
76
77
|
var _a;
|
|
77
78
|
const { item, lawyerImagePath, selectedFilter = '', onClickTel, isPro = false } = props;
|
|
78
|
-
const
|
|
79
|
+
const searchParams = useSearchParams();
|
|
80
|
+
const [search, setSearch] = useState('');
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
const searchQuery = searchParams.get('search');
|
|
83
|
+
setSearch(searchQuery ? String(searchQuery) : '');
|
|
84
|
+
}, [searchParams]);
|
|
79
85
|
if (!isPro) {
|
|
80
86
|
return (<span className={'relative flex justify-center'}>
|
|
81
87
|
<div className={'flex w-[95%] flex-col sm:w-[80%]'}>
|
|
82
88
|
<Link href={{
|
|
83
|
-
pathname: '/lawyer/' + item.id
|
|
89
|
+
pathname: '/lawyer/' + item.id,
|
|
90
|
+
query: search != '' ? { integrate_search: search } : {}
|
|
84
91
|
}} tabIndex={-1}>
|
|
85
92
|
<div className={'relative flex items-center justify-center bg-[#F8F8F8]'}>
|
|
86
93
|
<Image loading={'lazy'} src={lawyerImagePath + '/' + item.nukki} alt={item.careers &&
|
|
@@ -97,22 +104,23 @@ const LawyerContainer = (props) => {
|
|
|
97
104
|
</Link>
|
|
98
105
|
<div className={'m-3 flex h-full flex-col justify-between'}>
|
|
99
106
|
<Link href={{
|
|
100
|
-
pathname: '/lawyer/' + item.id
|
|
107
|
+
pathname: '/lawyer/' + item.id,
|
|
108
|
+
query: search != '' ? { integrate_search: search } : {}
|
|
101
109
|
}}>
|
|
102
110
|
<span>
|
|
103
111
|
<div className={'flex items-center justify-between'}>
|
|
104
112
|
<p className={'my-2 text-[20px] font-[700] tracking-[-1.6px] sm:text-[25px] lg:text-[32px]'}>
|
|
105
|
-
{item.name}
|
|
113
|
+
{searchColorLawyerText(item.name, search)}
|
|
106
114
|
</p>
|
|
107
115
|
<Image draggable={'false'} alt="" src={`/images/lawyer/arr_bl.webp`} className={'h-auto w-[15px] sm:h-auto sm:w-[20px]'} width={34} height={40}/>
|
|
108
116
|
</div>
|
|
109
117
|
|
|
110
118
|
<p className={'text-[16px] font-[600] tracking-[-1px] text-[#454545] lg:text-[22px]'}>
|
|
111
|
-
{item.code}
|
|
119
|
+
{searchColorLawyerText(item.code, search)}
|
|
112
120
|
</p>
|
|
113
121
|
|
|
114
122
|
{item.position ? (<p className={' bg-[#F7FBFF] py-1 text-[14px] font-[600] tracking-[-1px] text-[#454545] lg:text-[18px]'}>
|
|
115
|
-
{item.position}
|
|
123
|
+
{searchColorLawyerText(item.position, search)}
|
|
116
124
|
</p>) : (<div className={'h-[35px] max-lg:hidden'}></div>)}
|
|
117
125
|
</span>
|
|
118
126
|
</Link>
|
|
@@ -121,22 +129,29 @@ const LawyerContainer = (props) => {
|
|
|
121
129
|
((_a = item.exist_l_sort_center) === null || _a === void 0 ? void 0 : _a.includes(props.center_code)) ? (<p className={'mt-[11px] whitespace-pre-wrap text-[14px] font-[800] leading-tight tracking-[-1px] text-[#285FA7] lg:text-[18px] ' +
|
|
122
130
|
(item.group_career.length > 32 ? 'break-all' : '')}>
|
|
123
131
|
{item.group_career.length > 32
|
|
124
|
-
? item.group_career.replace(',', ', ')
|
|
125
|
-
: item.group_career.replace(',', '\n')}
|
|
132
|
+
? searchColorLawyerText(item.group_career.replace(',', ', '), search)
|
|
133
|
+
: searchColorLawyerText(item.group_career.replace(',', '\n'), search)}
|
|
126
134
|
</p>) : (<p className={`
|
|
127
135
|
${item.ability.length > 29 ? '' : 'break-keep '}
|
|
128
136
|
${item.ability.length > 29
|
|
129
137
|
? 'text-[13px] lg:text-[16px] '
|
|
130
138
|
: 'text-[14px] lg:text-[18px] '}whitespace-pre-wrap mt-[11px] font-medium leading-tight tracking-[-1px] text-[#143F79] max-lg:mb-[5px]`}>
|
|
131
|
-
<span className="font-[800] max-sm:hidden">
|
|
139
|
+
<span className="font-[800] max-sm:hidden">
|
|
140
|
+
{searchColorLawyerText(item.ability, search)}
|
|
141
|
+
</span>
|
|
132
142
|
<span className="font-[800] sm:hidden">
|
|
133
|
-
{item.ability.length > 29
|
|
143
|
+
{item.ability.length > 29
|
|
144
|
+
? searchColorLawyerText(item.ability.split('\n').join(', '), search)
|
|
145
|
+
: searchColorLawyerText(item.ability, search)}
|
|
134
146
|
</span>
|
|
135
147
|
</p>)}
|
|
136
148
|
<span className={'relative mb-[10px] mt-[5px] max-lg:my-[2px] '}>
|
|
137
149
|
{item.tel ? (<Link onClick={onClickTel} href={'tel:' + item.tel} className={'block w-fit'} aria-label={item.name + '변호사에게 전화하기 ' + item.tel}>
|
|
138
150
|
<p className={'text-[14px] font-[600] max-xs:text-[12px] lg:text-[18px]'}>
|
|
139
|
-
T.
|
|
151
|
+
T.{' '}
|
|
152
|
+
<span className={'font-[800] text-[#6e6e6e] underline'}>
|
|
153
|
+
{searchColorLawyerText(item.tel, search)}
|
|
154
|
+
</span>
|
|
140
155
|
</p>
|
|
141
156
|
</Link>) : (<div className={'h-[21px] lg:h-[27px]'}></div>)}
|
|
142
157
|
{/*이메일*/}
|
|
@@ -146,10 +161,10 @@ const LawyerContainer = (props) => {
|
|
|
146
161
|
</span>
|
|
147
162
|
{item.careers && item.careers != '' ? (<div className={'relative mt-2 border-t border-solid border-[#D0D0D0]'}>
|
|
148
163
|
<p className={'mt-3 line-clamp-1 text-ellipsis text-[14px] font-medium text-[#6e6e6e] lg:text-[18px]'}>
|
|
149
|
-
{item.careers
|
|
164
|
+
{searchColorLawyerText(item.careers
|
|
150
165
|
.replaceAll(',', '')
|
|
151
166
|
.replace('일반소송', '민사')
|
|
152
|
-
.replace('중재', '손해배상')}
|
|
167
|
+
.replace('중재', '손해배상'), search)}
|
|
153
168
|
전문
|
|
154
169
|
</p>
|
|
155
170
|
</div>) : (<></>)}
|
|
@@ -159,7 +174,8 @@ const LawyerContainer = (props) => {
|
|
|
159
174
|
}
|
|
160
175
|
else {
|
|
161
176
|
return (<Link href={{
|
|
162
|
-
pathname: '/lawyer/' + item.id
|
|
177
|
+
pathname: '/lawyer/' + item.id,
|
|
178
|
+
query: search != '' ? { integrate_search: search } : {}
|
|
163
179
|
}} key={item.id} className={'flex justify-center'} aria-label={`${item.name} ${item.code}`}>
|
|
164
180
|
<div className={'w-[90%] sm:w-[80%]'}>
|
|
165
181
|
<div className={'relative flex items-center justify-center bg-[#F8F8F8]'}>
|
|
@@ -169,11 +185,13 @@ const LawyerContainer = (props) => {
|
|
|
169
185
|
<div className={'m-3'}>
|
|
170
186
|
<div className={'flex items-center justify-between'}>
|
|
171
187
|
<p className={'my-2 text-[20px] font-[800] tracking-[-1.6px] sm:text-[28px]'}>
|
|
172
|
-
{item.name}
|
|
188
|
+
{searchColorLawyerText(item.name, search)}
|
|
173
189
|
</p>
|
|
174
190
|
<Image draggable={'false'} alt="" src={`/images/profile.webp`} className={'h-[16px] w-[13px] sm:h-[20px] sm:w-[16px]'} width={34} height={40}/>
|
|
175
191
|
</div>
|
|
176
|
-
<p className={'text-lg font-[600] tracking-[-1.1px] text-[#454545]'}>
|
|
192
|
+
<p className={'text-lg font-[600] tracking-[-1.1px] text-[#454545]'}>
|
|
193
|
+
{searchColorLawyerText(item.code, search)}
|
|
194
|
+
</p>
|
|
177
195
|
</div>
|
|
178
196
|
</div>
|
|
179
197
|
</div>
|
|
@@ -4,11 +4,12 @@ import { Title } from './Title';
|
|
|
4
4
|
import { ILawyerTypes, IListPagesType, IListTypes } from './integrateType';
|
|
5
5
|
import { ViewMore } from './ViewMore';
|
|
6
6
|
import mobile from 'is-mobile';
|
|
7
|
-
import { useRouter } from 'next/navigation';
|
|
7
|
+
import { useRouter, useSearchParams } from 'next/navigation';
|
|
8
8
|
import Link from 'next/link';
|
|
9
9
|
import Image from 'next/image';
|
|
10
10
|
import style from './index.module.css';
|
|
11
11
|
import Mark from '../../Mark/Mark';
|
|
12
|
+
import { searchColorLawyerText } from '../../common/integrate';
|
|
12
13
|
|
|
13
14
|
const Lawyer = (props: {
|
|
14
15
|
isMobileSize: boolean | null;
|
|
@@ -156,7 +157,13 @@ const LawyerContainer = (props: {
|
|
|
156
157
|
isPro?: boolean; // true 일 시 특수분야 전문가
|
|
157
158
|
}) => {
|
|
158
159
|
const { item, lawyerImagePath, selectedFilter = '', onClickTel, isPro = false } = props;
|
|
159
|
-
const
|
|
160
|
+
const searchParams = useSearchParams();
|
|
161
|
+
const [search, setSearch] = useState<string>('');
|
|
162
|
+
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
const searchQuery = searchParams.get('search');
|
|
165
|
+
setSearch(searchQuery ? String(searchQuery) : '');
|
|
166
|
+
}, [searchParams]);
|
|
160
167
|
|
|
161
168
|
if (!isPro) {
|
|
162
169
|
return (
|
|
@@ -164,7 +171,8 @@ const LawyerContainer = (props: {
|
|
|
164
171
|
<div className={'flex w-[95%] flex-col sm:w-[80%]'}>
|
|
165
172
|
<Link
|
|
166
173
|
href={{
|
|
167
|
-
pathname: '/lawyer/' + item.id
|
|
174
|
+
pathname: '/lawyer/' + item.id,
|
|
175
|
+
query: search != '' ? { integrate_search: search } : {}
|
|
168
176
|
}}
|
|
169
177
|
tabIndex={-1}
|
|
170
178
|
>
|
|
@@ -205,7 +213,8 @@ const LawyerContainer = (props: {
|
|
|
205
213
|
<div className={'m-3 flex h-full flex-col justify-between'}>
|
|
206
214
|
<Link
|
|
207
215
|
href={{
|
|
208
|
-
pathname: '/lawyer/' + item.id
|
|
216
|
+
pathname: '/lawyer/' + item.id,
|
|
217
|
+
query: search != '' ? { integrate_search: search } : {}
|
|
209
218
|
}}
|
|
210
219
|
>
|
|
211
220
|
<span>
|
|
@@ -215,7 +224,7 @@ const LawyerContainer = (props: {
|
|
|
215
224
|
'my-2 text-[20px] font-[700] tracking-[-1.6px] sm:text-[25px] lg:text-[32px]'
|
|
216
225
|
}
|
|
217
226
|
>
|
|
218
|
-
{item.name}
|
|
227
|
+
{searchColorLawyerText(item.name, search)}
|
|
219
228
|
</p>
|
|
220
229
|
<Image
|
|
221
230
|
draggable={'false'}
|
|
@@ -228,7 +237,7 @@ const LawyerContainer = (props: {
|
|
|
228
237
|
</div>
|
|
229
238
|
|
|
230
239
|
<p className={'text-[16px] font-[600] tracking-[-1px] text-[#454545] lg:text-[22px]'}>
|
|
231
|
-
{item.code}
|
|
240
|
+
{searchColorLawyerText(item.code, search)}
|
|
232
241
|
</p>
|
|
233
242
|
|
|
234
243
|
{item.position ? (
|
|
@@ -237,7 +246,7 @@ const LawyerContainer = (props: {
|
|
|
237
246
|
' bg-[#F7FBFF] py-1 text-[14px] font-[600] tracking-[-1px] text-[#454545] lg:text-[18px]'
|
|
238
247
|
}
|
|
239
248
|
>
|
|
240
|
-
{item.position}
|
|
249
|
+
{searchColorLawyerText(item.position, search)}
|
|
241
250
|
</p>
|
|
242
251
|
) : (
|
|
243
252
|
<div className={'h-[35px] max-lg:hidden'}></div>
|
|
@@ -254,8 +263,8 @@ const LawyerContainer = (props: {
|
|
|
254
263
|
}
|
|
255
264
|
>
|
|
256
265
|
{item.group_career.length > 32
|
|
257
|
-
? item.group_career.replace(',', ', ')
|
|
258
|
-
: item.group_career.replace(',', '\n')}
|
|
266
|
+
? searchColorLawyerText(item.group_career.replace(',', ', '), search)
|
|
267
|
+
: searchColorLawyerText(item.group_career.replace(',', '\n'), search)}
|
|
259
268
|
</p>
|
|
260
269
|
) : (
|
|
261
270
|
<p
|
|
@@ -267,9 +276,13 @@ const LawyerContainer = (props: {
|
|
|
267
276
|
: 'text-[14px] lg:text-[18px] '
|
|
268
277
|
}whitespace-pre-wrap mt-[11px] font-medium leading-tight tracking-[-1px] text-[#143F79] max-lg:mb-[5px]`}
|
|
269
278
|
>
|
|
270
|
-
<span className="font-[800] max-sm:hidden">
|
|
279
|
+
<span className="font-[800] max-sm:hidden">
|
|
280
|
+
{searchColorLawyerText(item.ability, search)}
|
|
281
|
+
</span>
|
|
271
282
|
<span className="font-[800] sm:hidden">
|
|
272
|
-
{item.ability.length > 29
|
|
283
|
+
{item.ability.length > 29
|
|
284
|
+
? searchColorLawyerText(item.ability.split('\n').join(', '), search)
|
|
285
|
+
: searchColorLawyerText(item.ability, search)}
|
|
273
286
|
</span>
|
|
274
287
|
</p>
|
|
275
288
|
)}
|
|
@@ -282,7 +295,10 @@ const LawyerContainer = (props: {
|
|
|
282
295
|
aria-label={item.name + '변호사에게 전화하기 ' + item.tel}
|
|
283
296
|
>
|
|
284
297
|
<p className={'text-[14px] font-[600] max-xs:text-[12px] lg:text-[18px]'}>
|
|
285
|
-
T.
|
|
298
|
+
T.{' '}
|
|
299
|
+
<span className={'font-[800] text-[#6e6e6e] underline'}>
|
|
300
|
+
{searchColorLawyerText(item.tel, search)}
|
|
301
|
+
</span>
|
|
286
302
|
</p>
|
|
287
303
|
</Link>
|
|
288
304
|
) : (
|
|
@@ -315,10 +331,13 @@ const LawyerContainer = (props: {
|
|
|
315
331
|
'mt-3 line-clamp-1 text-ellipsis text-[14px] font-medium text-[#6e6e6e] lg:text-[18px]'
|
|
316
332
|
}
|
|
317
333
|
>
|
|
318
|
-
{
|
|
319
|
-
.
|
|
320
|
-
|
|
321
|
-
|
|
334
|
+
{searchColorLawyerText(
|
|
335
|
+
item.careers
|
|
336
|
+
.replaceAll(',', '')
|
|
337
|
+
.replace('일반소송', '민사')
|
|
338
|
+
.replace('중재', '손해배상'),
|
|
339
|
+
search
|
|
340
|
+
)}
|
|
322
341
|
전문
|
|
323
342
|
</p>
|
|
324
343
|
</div>
|
|
@@ -333,7 +352,8 @@ const LawyerContainer = (props: {
|
|
|
333
352
|
return (
|
|
334
353
|
<Link
|
|
335
354
|
href={{
|
|
336
|
-
pathname: '/lawyer/' + item.id
|
|
355
|
+
pathname: '/lawyer/' + item.id,
|
|
356
|
+
query: search != '' ? { integrate_search: search } : {}
|
|
337
357
|
}}
|
|
338
358
|
key={item.id}
|
|
339
359
|
className={'flex justify-center'}
|
|
@@ -354,7 +374,7 @@ const LawyerContainer = (props: {
|
|
|
354
374
|
<div className={'m-3'}>
|
|
355
375
|
<div className={'flex items-center justify-between'}>
|
|
356
376
|
<p className={'my-2 text-[20px] font-[800] tracking-[-1.6px] sm:text-[28px]'}>
|
|
357
|
-
{item.name}
|
|
377
|
+
{searchColorLawyerText(item.name, search)}
|
|
358
378
|
</p>
|
|
359
379
|
<Image
|
|
360
380
|
draggable={'false'}
|
|
@@ -365,7 +385,9 @@ const LawyerContainer = (props: {
|
|
|
365
385
|
height={40}
|
|
366
386
|
/>
|
|
367
387
|
</div>
|
|
368
|
-
<p className={'text-lg font-[600] tracking-[-1.1px] text-[#454545]'}>
|
|
388
|
+
<p className={'text-lg font-[600] tracking-[-1.1px] text-[#454545]'}>
|
|
389
|
+
{searchColorLawyerText(item.code, search)}
|
|
390
|
+
</p>
|
|
369
391
|
</div>
|
|
370
392
|
</div>
|
|
371
393
|
</div>
|
|
@@ -1,90 +1,31 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
import React, { useEffect, useState } from 'react';
|
|
12
|
-
import { useRouter } from 'next/navigation';
|
|
13
3
|
import { useSearchParams } from 'next/navigation';
|
|
14
4
|
import Link from 'next/link';
|
|
15
5
|
import { tabTypes } from '../../common/integrate';
|
|
16
6
|
const MenuTab = ({ search, searchDoneRef, setChoiceTabValue, totalCount, count }) => {
|
|
17
|
-
const router = useRouter();
|
|
18
7
|
const [tab, setTab] = useState('');
|
|
19
8
|
const searchParams = useSearchParams();
|
|
20
9
|
const querySearch = searchParams.get('search');
|
|
21
10
|
const queryTab = searchParams.get('tab');
|
|
22
|
-
const handleChange = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
yield router.push(`/integrate?search=${querySearch}&tab=${event.target.value}`);
|
|
24
|
-
});
|
|
25
|
-
const onClickEvent = (tab, search) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
-
yield router.push(`/integrate?search=${querySearch}&tab=${tab}`);
|
|
27
|
-
});
|
|
28
11
|
useEffect(() => {
|
|
29
12
|
setTab(String(queryTab));
|
|
30
13
|
setChoiceTabValue === null || setChoiceTabValue === void 0 ? void 0 : setChoiceTabValue(queryTab ? String(queryTab) : '전체'); // 부모에게 tab button value 넘겨주는 setState
|
|
31
14
|
}, [searchParams]);
|
|
32
|
-
return (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}} aria-label={'전체 ' +
|
|
48
|
-
totalCount.toLocaleString() +
|
|
49
|
-
'개의 검색결과 보기 ' +
|
|
50
|
-
`${tab === '전체' ? '선택된 메뉴입니다.' : ''}`}>
|
|
51
|
-
전체 ({totalCount.toLocaleString()})
|
|
52
|
-
</Link>
|
|
53
|
-
<div className={'mb-16 mt-3 flex-col flex-wrap gap-2 sm:flex sm:w-auto sm:flex-row'}>
|
|
54
|
-
{tabTypes.map(item => {
|
|
55
|
-
return (<TabButton key={item.value} tab={tab} count={
|
|
56
|
-
// @ts-ignore
|
|
57
|
-
count[String(item.value)]} title={item.tab} type={item.value} onClickEvent={onClickEvent} search={search}/>);
|
|
58
|
-
})}
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
{/*모바일*/}
|
|
62
|
-
<div className={"relative after:absolute after:right-[2em] after:top-[1.2em] after:h-[10px] after:w-[10px] after:rotate-[135deg] after:border-r-[2px] after:border-t-[2px] after:border-[#fff] after:content-[''] sm:hidden"}>
|
|
63
|
-
<select onChange={handleChange} aria-label={'search-tab'} className="z-9 relative my-10 block w-full appearance-none rounded-[30px] border border-gray-400 bg-[#285FA7] px-6 py-3 text-[18px] font-[800] text-[#fff] hover:border-gray-500 sm:hidden">
|
|
64
|
-
<option value="전체">
|
|
65
|
-
전체
|
|
66
|
-
{`(${totalCount.toLocaleString()})`}
|
|
67
|
-
</option>
|
|
68
|
-
|
|
69
|
-
{tabTypes.map(t => {
|
|
70
|
-
// @ts-ignore
|
|
71
|
-
const tabNum = count[t.value];
|
|
72
|
-
return (tabNum > 0 && (<option value={t.value} key={t.value}>
|
|
73
|
-
{t.tab} {`(${tabNum.toLocaleString()})`}
|
|
74
|
-
</option>));
|
|
15
|
+
return (<div className={'mb-[106px] mt-20 grid h-full w-full grid-cols-8 max-xl:grid-cols-4 max-lg:my-[60px] max-sm:my-10 max-sm:grid-cols-2'}>
|
|
16
|
+
{[{ tab: '전체', etab: 'All', value: '전체' }, ...tabTypes].map(item => {
|
|
17
|
+
return (<Link ref={searchDoneRef} href={`/integrate?search=${querySearch}&tab=${item.value}`} key={item.value} className={'flex h-[62px] w-full items-center justify-center text-[20px] leading-none tracking-[-0.7px] max-3xl:text-[18px] max-md:text-[16px] max-sm:h-[40px] max-sm:text-[14px] ' +
|
|
18
|
+
(tab === item.value
|
|
19
|
+
? 'bg-[#29579C] font-[800] text-[#FFFFFF] '
|
|
20
|
+
: 'border border-solid border-[#E9E9E9] bg-[#F7F7F7] font-[500] text-[#949494] ')}>
|
|
21
|
+
{item.value} (
|
|
22
|
+
{item.value != '전체'
|
|
23
|
+
? //@ts-ignore
|
|
24
|
+
count[String(item.value)].toLocaleString()
|
|
25
|
+
: totalCount.toLocaleString()}
|
|
26
|
+
)
|
|
27
|
+
</Link>);
|
|
75
28
|
})}
|
|
76
|
-
|
|
77
|
-
</div>
|
|
78
|
-
</>);
|
|
79
|
-
};
|
|
80
|
-
const TabButton = (props) => {
|
|
81
|
-
const searchParams = useSearchParams();
|
|
82
|
-
const buttonClass = 'block flex items-center justify-center sm:w-[155px] sm:text-[16px] lg:w-[165px] lg:text-[17px] text-center cursor-pointer font-semibold rounded-[30px] h-[56px] ';
|
|
83
|
-
const { tab, count, type, title, onClickEvent, search } = props;
|
|
84
|
-
const querySearch = searchParams.get('search');
|
|
85
|
-
return (<Link href={`/integrate?search=${querySearch}&tab=${type}`} className={`${tab === type ? ' bg-[#285FA7] text-[#fff] ' : ' bg-[#F8F8F8] '} ${buttonClass} ${count < 1 ? 'hidden' : ''}`}>
|
|
86
|
-
{`${title}`}
|
|
87
|
-
{` (${count.toLocaleString()})`}
|
|
88
|
-
</Link>);
|
|
29
|
+
</div>);
|
|
89
30
|
};
|
|
90
31
|
export default MenuTab;
|