@daeryun/dr_components 0.1.17 → 0.1.18
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/IFooterTypes.d.ts +17 -0
- package/dist/components/Footer/IFooterTypes.js +2 -0
- package/dist/components/Footer/IFooterTypes.ts +18 -0
- package/dist/components/Footer/index.d.ts +3 -1
- package/dist/components/Footer/index.jsx +104 -76
- package/dist/components/Footer/index.tsx +163 -125
- package/dist/styles/globals.css +28 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -2,84 +2,76 @@ import Image from 'next/image';
|
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import * as gtag from '../../lib/gtag';
|
|
4
4
|
import Link from 'next/link';
|
|
5
|
-
import { insert } from '../../lib';
|
|
5
|
+
import { getDomainHandler, insert } from '../../lib';
|
|
6
6
|
import { savePowerLinkConversion } from '../../lib';
|
|
7
|
-
import { paramFetch } from '../../lib';
|
|
8
|
-
import { useQuery } from 'react-query';
|
|
9
7
|
import TopBtn from './TopBtn';
|
|
10
8
|
import Wrapper from '../Layout/Wrapper';
|
|
11
|
-
|
|
9
|
+
import { useRouter } from 'next/router';
|
|
12
10
|
import ArrowIcon from '../../asset/images/footer/icon_arrow_gray.webp';
|
|
13
11
|
import SNS1 from '../../asset/images/footer/sns_01.webp';
|
|
14
12
|
import SNS2 from '../../asset/images/footer/sns_02.webp';
|
|
15
13
|
import SNS3 from '../../asset/images/footer/sns_03.webp';
|
|
16
14
|
import SNS4 from '../../asset/images/footer/sns_04.webp';
|
|
17
15
|
import SNS5 from '../../asset/images/footer/sns_05.webp';
|
|
16
|
+
import { IGroupsData } from './IFooterTypes';
|
|
18
17
|
|
|
19
18
|
interface IFooterTypes {
|
|
20
19
|
tel: string;
|
|
21
20
|
logoUrl: string;
|
|
22
21
|
aceCountLink?: string;
|
|
22
|
+
groupsData: IGroupsData[] | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface GroupsProps {
|
|
26
|
+
list: IGroupsData[];
|
|
23
27
|
}
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// aceCountLink?: string -> 에이스 카운터 전환태그 주소, 안 넣을 경우 메인으로
|
|
28
|
-
const Footer = (props: IFooterTypes) => {
|
|
29
|
+
const Footer = ({ groupsData, tel, logoUrl, aceCountLink }: IFooterTypes) => {
|
|
30
|
+
const router = useRouter();
|
|
29
31
|
const mobile = require('is-mobile');
|
|
30
32
|
const snsClass =
|
|
31
33
|
'w-[44px] h-auto mr-[5px] max-md:w-[40px] max-md:m-0 max-xs:w-[45px] max-xs:mr-[17px] max-2xs:w-[40px] max-3xs:w-[35px]';
|
|
34
|
+
const [isGroups, setIsGroups] = useState<GroupsProps[]>([]);
|
|
32
35
|
|
|
33
36
|
const [isMobile, setIsMobile] = useState<boolean>(false);
|
|
34
|
-
const [centerLink, setCenterLink] = useState<
|
|
35
|
-
{ code: string; codename: string; parent_code: string; etc: string; etc2: string }[]
|
|
36
|
-
>([]);
|
|
37
37
|
const [isOpen, setIsOpen] = useState(false);
|
|
38
38
|
const wrapperRef = useRef(null);
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
'centerList',
|
|
42
|
-
() => {
|
|
43
|
-
paramFetch(
|
|
44
|
-
'https://mng.daeryunlaw.com/api/center/list',
|
|
45
|
-
{ type: 'footer' },
|
|
46
|
-
(obj: any) => {
|
|
47
|
-
const data = obj.list
|
|
48
|
-
.filter((i: any) => i.code != 'CT0020')
|
|
49
|
-
.map((l: any) => {
|
|
50
|
-
return {
|
|
51
|
-
codename: l.code_name.replace('전문', '') + '그룹',
|
|
52
|
-
code:
|
|
53
|
-
l.code === 'CT0000'
|
|
54
|
-
? 'https://www.daeryunlaw.com/'
|
|
55
|
-
: l.parent_code === 'center'
|
|
56
|
-
? `https://www.daeryunlaw-${l.code_desc}.com`
|
|
57
|
-
: l.etc2,
|
|
58
|
-
code_num: l.code,
|
|
59
|
-
etc: l.etc,
|
|
60
|
-
code_name2: l.code_name2,
|
|
61
|
-
parent_code: l.parent_code,
|
|
62
|
-
etc2: l.etc2
|
|
63
|
-
};
|
|
64
|
-
});
|
|
40
|
+
const routeLocation: boolean = router.asPath === '/' ? true : false;
|
|
65
41
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
42
|
+
const fetchData = async () => {
|
|
43
|
+
try {
|
|
44
|
+
const req = await fetch('/api/center/list');
|
|
45
|
+
return await req.json();
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error(`fetch groupsData error : ${error} `);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const fetchGroupsData = async () => {
|
|
53
|
+
if (router.asPath !== '/') {
|
|
54
|
+
try {
|
|
55
|
+
const data: GroupsProps[] = await fetchData();
|
|
56
|
+
setIsGroups(data);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error(`fetch groupsData useEffect error: ${error}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
fetchGroupsData();
|
|
64
|
+
}, [router.asPath]);
|
|
73
65
|
|
|
74
66
|
const onClickTel = () => {
|
|
75
67
|
insert('call', isMobile);
|
|
76
68
|
savePowerLinkConversion('call', isMobile);
|
|
77
69
|
if (isMobile) {
|
|
78
|
-
mTelClick();
|
|
79
70
|
ace_mTelClick();
|
|
71
|
+
mTelClick();
|
|
80
72
|
} else {
|
|
81
|
-
pcTelClick();
|
|
82
73
|
ace_pcTelClick();
|
|
74
|
+
pcTelClick();
|
|
83
75
|
}
|
|
84
76
|
};
|
|
85
77
|
|
|
@@ -115,7 +107,7 @@ const Footer = (props: IFooterTypes) => {
|
|
|
115
107
|
const ace_pcTelClick = () => {
|
|
116
108
|
try {
|
|
117
109
|
// @ts-ignore
|
|
118
|
-
_PL(
|
|
110
|
+
_PL(aceCountLink ? aceCountLink : 'www.daeryunlaw.com/tel');
|
|
119
111
|
} catch (e) {}
|
|
120
112
|
};
|
|
121
113
|
|
|
@@ -147,11 +139,11 @@ const Footer = (props: IFooterTypes) => {
|
|
|
147
139
|
}
|
|
148
140
|
>
|
|
149
141
|
{/*top button*/}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
142
|
+
<Wrapper className={'!absolute top-0'}>
|
|
143
|
+
<div className={'relative z-20'}>
|
|
144
|
+
<TopBtn className={'absolute right-0 top-[-50%] translate-y-[-50%]'} />
|
|
145
|
+
</div>
|
|
146
|
+
</Wrapper>
|
|
155
147
|
<Wrapper>
|
|
156
148
|
<div className={'w-full'}>
|
|
157
149
|
<div
|
|
@@ -162,7 +154,7 @@ const Footer = (props: IFooterTypes) => {
|
|
|
162
154
|
>
|
|
163
155
|
<Link href={'/'}>
|
|
164
156
|
<Image
|
|
165
|
-
src={
|
|
157
|
+
src={logoUrl}
|
|
166
158
|
alt="대륜 로고"
|
|
167
159
|
width={216}
|
|
168
160
|
height={33}
|
|
@@ -204,59 +196,115 @@ const Footer = (props: IFooterTypes) => {
|
|
|
204
196
|
법무법인 대륜 그룹 바로가기
|
|
205
197
|
</button>
|
|
206
198
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
199
|
+
<ul
|
|
200
|
+
className={`absolute right-0 mt-2 h-[340px] w-full origin-top-right overflow-y-auto rounded-md bg-white pt-3 shadow-lg ring-1 ring-black ring-opacity-5 transition-all duration-150 focus:outline-none ${
|
|
201
|
+
isOpen ? 'visible opacity-100' : 'invisible opacity-0'
|
|
202
|
+
}`}
|
|
203
|
+
style={{
|
|
204
|
+
zIndex: isOpen ? 50 : -9999,
|
|
205
|
+
pointerEvents: isOpen ? 'auto' : 'none'
|
|
206
|
+
}}
|
|
207
|
+
role="listbox"
|
|
208
|
+
aria-orientation="vertical"
|
|
209
|
+
aria-labelledby="listbox-label"
|
|
210
|
+
aria-expanded="true"
|
|
211
|
+
aria-hidden="false"
|
|
212
|
+
>
|
|
213
|
+
{routeLocation
|
|
214
|
+
? groupsData?.map((item: any, index: number) => (
|
|
215
|
+
// 메인페이지로 접근했을 때, 서버사이드에서 가져온 데이터로 색인
|
|
216
|
+
<>
|
|
217
|
+
<li
|
|
218
|
+
key={index}
|
|
219
|
+
value={item.code_name}
|
|
220
|
+
className="cursor-pointer px-5 py-[5px] text-[17px] font-[500] duration-150 hover:bg-gray-100"
|
|
221
|
+
>
|
|
222
|
+
<Link
|
|
223
|
+
href={getDomainHandler(item.code, item.code_desc)}
|
|
224
|
+
key={index}
|
|
225
|
+
target="_blank"
|
|
226
|
+
title={item.code_name}
|
|
227
|
+
onClick={() => {
|
|
228
|
+
setIsOpen(!isOpen);
|
|
229
|
+
}}
|
|
230
|
+
>
|
|
231
|
+
{item.code === 'CT0000'
|
|
232
|
+
? item.code_name
|
|
233
|
+
: `${item.code_name} 그룹`}
|
|
234
|
+
</Link>
|
|
235
|
+
</li>
|
|
236
|
+
{item.children.length > 0 &&
|
|
237
|
+
item.children.map((childGroup: any) => (
|
|
238
|
+
<li
|
|
239
|
+
key={childGroup.code}
|
|
240
|
+
value={childGroup.code_name}
|
|
241
|
+
className="cursor-pointer px-9 py-[5px] text-[15px] font-[500] duration-150 hover:bg-gray-100"
|
|
242
|
+
>
|
|
243
|
+
<Link
|
|
244
|
+
href={childGroup.etc2}
|
|
245
|
+
key={index}
|
|
246
|
+
target="_blank"
|
|
247
|
+
title={childGroup.codename}
|
|
248
|
+
onClick={() => {
|
|
249
|
+
setIsOpen(!isOpen);
|
|
250
|
+
}}
|
|
251
|
+
>
|
|
252
|
+
{childGroup.code_name} 센터
|
|
253
|
+
</Link>
|
|
254
|
+
</li>
|
|
255
|
+
))}
|
|
256
|
+
</>
|
|
257
|
+
))
|
|
258
|
+
: // 메인페이지가 아닌 경로로 유입되었을 때, api 호출하여 받은 데이터. 색인 x
|
|
259
|
+
(
|
|
260
|
+
isGroups as unknown as {
|
|
261
|
+
list: any[];
|
|
262
|
+
}
|
|
263
|
+
).list?.map((item: any, index: number) => (
|
|
264
|
+
<>
|
|
265
|
+
<li
|
|
266
|
+
key={index}
|
|
267
|
+
value={item.code_name}
|
|
268
|
+
className="cursor-pointer px-5 py-[5px] text-[17px] font-[500] duration-150 hover:bg-gray-100"
|
|
269
|
+
>
|
|
270
|
+
<Link
|
|
271
|
+
href={getDomainHandler(item.code, item.code_desc)}
|
|
272
|
+
key={index}
|
|
273
|
+
target="_blank"
|
|
274
|
+
title={item.code_name}
|
|
275
|
+
onClick={() => {
|
|
276
|
+
setIsOpen(!isOpen);
|
|
277
|
+
}}
|
|
278
|
+
>
|
|
279
|
+
{item.code === 'CT0000'
|
|
280
|
+
? item.code_name
|
|
281
|
+
: `${item.code_name} 그룹`}
|
|
282
|
+
</Link>
|
|
283
|
+
</li>
|
|
284
|
+
{item.children.length > 0 &&
|
|
285
|
+
item.children.map((childGroup: any) => (
|
|
286
|
+
<li
|
|
287
|
+
key={childGroup.code}
|
|
288
|
+
value={childGroup.code_name}
|
|
289
|
+
className="cursor-pointer px-9 py-[5px] text-[15px] font-[500] duration-150 hover:bg-gray-100"
|
|
290
|
+
>
|
|
291
|
+
<Link
|
|
292
|
+
href={childGroup.etc2}
|
|
293
|
+
key={index}
|
|
294
|
+
target="_blank"
|
|
295
|
+
title={childGroup.codename}
|
|
296
|
+
onClick={() => {
|
|
297
|
+
setIsOpen(!isOpen);
|
|
298
|
+
}}
|
|
299
|
+
>
|
|
300
|
+
{childGroup.code_name} 센터
|
|
301
|
+
</Link>
|
|
302
|
+
</li>
|
|
303
|
+
))}
|
|
304
|
+
</>
|
|
305
|
+
))}
|
|
306
|
+
</ul>
|
|
307
|
+
|
|
260
308
|
<Image
|
|
261
309
|
draggable={false}
|
|
262
310
|
src={ArrowIcon}
|
|
@@ -285,7 +333,7 @@ const Footer = (props: IFooterTypes) => {
|
|
|
285
333
|
</div>
|
|
286
334
|
<div
|
|
287
335
|
className={
|
|
288
|
-
'mb-[15px] max-xl:justify-center max-md:text-[14px] max-xs:mb-[24px] max-xs:text-[16px] max-2xs:mb-[33px] xs:flex xs:w-
|
|
336
|
+
'mb-[15px] max-xl:justify-center max-md:text-[14px] max-xs:mb-[24px] max-xs:text-[16px] max-2xs:mb-[33px] xs:flex xs:w-[90vw] xs:items-center'
|
|
289
337
|
}
|
|
290
338
|
>
|
|
291
339
|
<p className={'xs:pr-[11px] xs:text-center'}>
|
|
@@ -308,12 +356,12 @@ const Footer = (props: IFooterTypes) => {
|
|
|
308
356
|
<p className={'border-solid max-xs:my-[11px] xs:border-r xs:px-[11px] xs:text-center'}>
|
|
309
357
|
<span className="font-[800]">법률상담접수 </span>{' '}
|
|
310
358
|
<Link
|
|
311
|
-
href={`tel:${
|
|
359
|
+
href={`tel:${tel}`}
|
|
312
360
|
onClick={onClickTel}
|
|
313
|
-
aria-label={'법률상담접수 ' +
|
|
361
|
+
aria-label={'법률상담접수 ' + tel}
|
|
314
362
|
className={'inline-block'}
|
|
315
363
|
>
|
|
316
|
-
<span className={'inline-block'}>{
|
|
364
|
+
<span className={'inline-block'}>{tel}</span>
|
|
317
365
|
</Link>
|
|
318
366
|
</p>
|
|
319
367
|
<p className={'break-keep xs:pl-[11px] xs:text-center'}>
|
|
@@ -354,8 +402,8 @@ const Footer = (props: IFooterTypes) => {
|
|
|
354
402
|
onClick={() => {
|
|
355
403
|
insert('kakao', isMobile);
|
|
356
404
|
savePowerLinkConversion('kakao', isMobile);
|
|
357
|
-
mKakaoClick();
|
|
358
405
|
ace_mKakaoClick();
|
|
406
|
+
mKakaoClick();
|
|
359
407
|
}}
|
|
360
408
|
>
|
|
361
409
|
<Image
|
|
@@ -409,29 +457,19 @@ const FooterLinkList = () => {
|
|
|
409
457
|
return (
|
|
410
458
|
<>
|
|
411
459
|
<p>
|
|
412
|
-
<Link href={'
|
|
413
|
-
면책공고
|
|
414
|
-
</Link>
|
|
460
|
+
<Link href={'/common/disclaimer'}>면책공고</Link>
|
|
415
461
|
</p>
|
|
416
462
|
<p>
|
|
417
|
-
<Link href={'
|
|
418
|
-
유한책임
|
|
419
|
-
</Link>
|
|
463
|
+
<Link href={'/common/limited-liability'}>유한책임</Link>
|
|
420
464
|
</p>
|
|
421
465
|
<p>
|
|
422
|
-
<Link href={'
|
|
423
|
-
개인정보처리방침
|
|
424
|
-
</Link>
|
|
466
|
+
<Link href={'/common/privacy-policy'}>개인정보처리방침</Link>
|
|
425
467
|
</p>
|
|
426
468
|
<p>
|
|
427
|
-
<Link href={'
|
|
428
|
-
이메일무단수집거부
|
|
429
|
-
</Link>
|
|
469
|
+
<Link href={'/common/collect'}>이메일무단수집거부</Link>
|
|
430
470
|
</p>
|
|
431
471
|
<p className={'text-[#285FA7]'}>
|
|
432
|
-
<Link href={'https://www.daeryunlaw.com/inquire'}
|
|
433
|
-
고객만족센터
|
|
434
|
-
</Link>
|
|
472
|
+
<Link href={'https://www.daeryunlaw.com/inquire'}>고객만족센터</Link>
|
|
435
473
|
</p>
|
|
436
474
|
</>
|
|
437
475
|
);
|
package/dist/styles/globals.css
CHANGED
|
@@ -544,6 +544,14 @@ video {
|
|
|
544
544
|
pointer-events: none;
|
|
545
545
|
}
|
|
546
546
|
|
|
547
|
+
.visible {
|
|
548
|
+
visibility: visible;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
.invisible {
|
|
552
|
+
visibility: hidden;
|
|
553
|
+
}
|
|
554
|
+
|
|
547
555
|
.fixed {
|
|
548
556
|
position: fixed;
|
|
549
557
|
}
|
|
@@ -1195,6 +1203,11 @@ video {
|
|
|
1195
1203
|
padding-right: 1.25rem;
|
|
1196
1204
|
}
|
|
1197
1205
|
|
|
1206
|
+
.px-9 {
|
|
1207
|
+
padding-left: 2.25rem;
|
|
1208
|
+
padding-right: 2.25rem;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1198
1211
|
.px-\[140px\] {
|
|
1199
1212
|
padding-left: 140px;
|
|
1200
1213
|
padding-right: 140px;
|
|
@@ -1303,6 +1316,10 @@ video {
|
|
|
1303
1316
|
font-size: 14px;
|
|
1304
1317
|
}
|
|
1305
1318
|
|
|
1319
|
+
.text-\[15px\] {
|
|
1320
|
+
font-size: 15px;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1306
1323
|
.text-\[16px\] {
|
|
1307
1324
|
font-size: 16px;
|
|
1308
1325
|
}
|
|
@@ -1529,6 +1546,10 @@ video {
|
|
|
1529
1546
|
transition-duration: 150ms;
|
|
1530
1547
|
}
|
|
1531
1548
|
|
|
1549
|
+
.duration-150 {
|
|
1550
|
+
transition-duration: 150ms;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1532
1553
|
.duration-700 {
|
|
1533
1554
|
transition-duration: 700ms;
|
|
1534
1555
|
}
|
|
@@ -1590,6 +1611,11 @@ body {
|
|
|
1590
1611
|
background-color: #b99c6e1a;
|
|
1591
1612
|
}
|
|
1592
1613
|
|
|
1614
|
+
.hover\:bg-gray-100:hover {
|
|
1615
|
+
--tw-bg-opacity: 1;
|
|
1616
|
+
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1593
1619
|
.focus\:outline-none:focus {
|
|
1594
1620
|
outline: 2px solid transparent;
|
|
1595
1621
|
outline-offset: 2px;
|
|
@@ -2406,8 +2432,8 @@ body {
|
|
|
2406
2432
|
display: flex;
|
|
2407
2433
|
}
|
|
2408
2434
|
|
|
2409
|
-
.xs\:w
|
|
2410
|
-
width:
|
|
2435
|
+
.xs\:w-\[90vw\] {
|
|
2436
|
+
width: 90vw;
|
|
2411
2437
|
}
|
|
2412
2438
|
|
|
2413
2439
|
.xs\:items-center {
|