@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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface IGroupsData {
|
|
2
|
+
code: string;
|
|
3
|
+
codename: string;
|
|
4
|
+
parent_code: string;
|
|
5
|
+
etc: string;
|
|
6
|
+
etc2: string;
|
|
7
|
+
children: {
|
|
8
|
+
code: string;
|
|
9
|
+
code_desc: string;
|
|
10
|
+
code_name: string;
|
|
11
|
+
codename: string;
|
|
12
|
+
etc: string;
|
|
13
|
+
etc2: string;
|
|
14
|
+
parent_code: string;
|
|
15
|
+
sort_order: null;
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface IGroupsData {
|
|
2
|
+
code: string;
|
|
3
|
+
codename: string;
|
|
4
|
+
parent_code: string;
|
|
5
|
+
etc: string;
|
|
6
|
+
etc2: string;
|
|
7
|
+
children: {
|
|
8
|
+
code: string;
|
|
9
|
+
code_desc: string;
|
|
10
|
+
code_name: string;
|
|
11
|
+
codename: string;
|
|
12
|
+
etc: string;
|
|
13
|
+
etc2: string;
|
|
14
|
+
parent_code: string;
|
|
15
|
+
sort_order: null;
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
18
|
+
[];
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { IGroupsData } from './IFooterTypes';
|
|
2
3
|
interface IFooterTypes {
|
|
3
4
|
tel: string;
|
|
4
5
|
logoUrl: string;
|
|
5
6
|
aceCountLink?: string;
|
|
7
|
+
groupsData: IGroupsData[] | null;
|
|
6
8
|
}
|
|
7
|
-
declare const Footer: (
|
|
9
|
+
declare const Footer: ({ groupsData, tel, logoUrl, aceCountLink }: IFooterTypes) => React.JSX.Element;
|
|
8
10
|
export default Footer;
|
|
@@ -1,60 +1,70 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
import Image from 'next/image';
|
|
2
11
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
12
|
import * as gtag from '../../lib/gtag';
|
|
4
13
|
import Link from 'next/link';
|
|
5
|
-
import { insert } from '../../lib';
|
|
14
|
+
import { getDomainHandler, insert } from '../../lib';
|
|
6
15
|
import { savePowerLinkConversion } from '../../lib';
|
|
7
|
-
import
|
|
8
|
-
import { useQuery } from 'react-query';
|
|
16
|
+
import TopBtn from './TopBtn';
|
|
9
17
|
import Wrapper from '../Layout/Wrapper';
|
|
18
|
+
import { useRouter } from 'next/router';
|
|
10
19
|
import ArrowIcon from '../../asset/images/footer/icon_arrow_gray.webp';
|
|
11
20
|
import SNS1 from '../../asset/images/footer/sns_01.webp';
|
|
12
21
|
import SNS2 from '../../asset/images/footer/sns_02.webp';
|
|
13
22
|
import SNS3 from '../../asset/images/footer/sns_03.webp';
|
|
14
23
|
import SNS4 from '../../asset/images/footer/sns_04.webp';
|
|
15
24
|
import SNS5 from '../../asset/images/footer/sns_05.webp';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const Footer = (props) => {
|
|
25
|
+
const Footer = ({ groupsData, tel, logoUrl, aceCountLink }) => {
|
|
26
|
+
var _a;
|
|
27
|
+
const router = useRouter();
|
|
20
28
|
const mobile = require('is-mobile');
|
|
21
29
|
const snsClass = '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]';
|
|
30
|
+
const [isGroups, setIsGroups] = useState([]);
|
|
22
31
|
const [isMobile, setIsMobile] = useState(false);
|
|
23
|
-
const [centerLink, setCenterLink] = useState([]);
|
|
24
32
|
const [isOpen, setIsOpen] = useState(false);
|
|
25
33
|
const wrapperRef = useRef(null);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
const routeLocation = router.asPath === '/' ? true : false;
|
|
35
|
+
const fetchData = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
try {
|
|
37
|
+
const req = yield fetch('/api/center/list');
|
|
38
|
+
return yield req.json();
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
console.error(`fetch groupsData error : ${error} `);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
const fetchGroupsData = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
+
if (router.asPath !== '/') {
|
|
47
|
+
try {
|
|
48
|
+
const data = yield fetchData();
|
|
49
|
+
setIsGroups(data);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
console.error(`fetch groupsData useEffect error: ${error}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
fetchGroupsData();
|
|
57
|
+
}, [router.asPath]);
|
|
48
58
|
const onClickTel = () => {
|
|
49
59
|
insert('call', isMobile);
|
|
50
60
|
savePowerLinkConversion('call', isMobile);
|
|
51
61
|
if (isMobile) {
|
|
52
|
-
mTelClick();
|
|
53
62
|
ace_mTelClick();
|
|
63
|
+
mTelClick();
|
|
54
64
|
}
|
|
55
65
|
else {
|
|
56
|
-
pcTelClick();
|
|
57
66
|
ace_pcTelClick();
|
|
67
|
+
pcTelClick();
|
|
58
68
|
}
|
|
59
69
|
};
|
|
60
70
|
// GA 클릭이벤트
|
|
@@ -86,7 +96,7 @@ const Footer = (props) => {
|
|
|
86
96
|
const ace_pcTelClick = () => {
|
|
87
97
|
try {
|
|
88
98
|
// @ts-ignore
|
|
89
|
-
_PL(
|
|
99
|
+
_PL(aceCountLink ? aceCountLink : 'www.daeryunlaw.com/tel');
|
|
90
100
|
}
|
|
91
101
|
catch (e) { }
|
|
92
102
|
};
|
|
@@ -112,17 +122,17 @@ const Footer = (props) => {
|
|
|
112
122
|
'max-lg:mb-[70px] ' +
|
|
113
123
|
'max-2xs:h-[730px]'}>
|
|
114
124
|
{/*top button*/}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
125
|
+
<Wrapper className={'!absolute top-0'}>
|
|
126
|
+
<div className={'relative z-20'}>
|
|
127
|
+
<TopBtn className={'absolute right-0 top-[-50%] translate-y-[-50%]'}/>
|
|
128
|
+
</div>
|
|
129
|
+
</Wrapper>
|
|
120
130
|
<Wrapper>
|
|
121
131
|
<div className={'w-full'}>
|
|
122
132
|
<div className={'mb-[77px] font-[800] tracking-[-0px] xs:flex xs:items-center ' +
|
|
123
133
|
'max-xl:mb-[50px] max-xl:justify-center max-xl:gap-[5%] '}>
|
|
124
134
|
<Link href={'/'}>
|
|
125
|
-
<Image src={
|
|
135
|
+
<Image src={logoUrl} alt="대륜 로고" width={216} height={33} className={'mr-[4.27vw] h-auto w-[208px] max-3xl:mr-[2vw] max-md:w-[180px] max-2xs:w-[148px] '}/>
|
|
126
136
|
</Link>
|
|
127
137
|
|
|
128
138
|
<div className={'flex gap-[36px] max-xxl:gap-[20px] max-xl:hidden '}>
|
|
@@ -144,26 +154,54 @@ const Footer = (props) => {
|
|
|
144
154
|
법무법인 대륜 그룹 바로가기
|
|
145
155
|
</button>
|
|
146
156
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
157
|
+
<ul 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 ${isOpen ? 'visible opacity-100' : 'invisible opacity-0'}`} style={{
|
|
158
|
+
zIndex: isOpen ? 50 : -9999,
|
|
159
|
+
pointerEvents: isOpen ? 'auto' : 'none'
|
|
160
|
+
}} role="listbox" aria-orientation="vertical" aria-labelledby="listbox-label" aria-expanded="true" aria-hidden="false">
|
|
161
|
+
{routeLocation
|
|
162
|
+
? groupsData === null || groupsData === void 0 ? void 0 : groupsData.map((item, index) => (
|
|
163
|
+
// 메인페이지로 접근했을 때, 서버사이드에서 가져온 데이터로 색인
|
|
164
|
+
<>
|
|
165
|
+
<li key={index} value={item.code_name} className="cursor-pointer px-5 py-[5px] text-[17px] font-[500] duration-150 hover:bg-gray-100">
|
|
166
|
+
<Link href={getDomainHandler(item.code, item.code_desc)} key={index} target="_blank" title={item.code_name} onClick={() => {
|
|
150
167
|
setIsOpen(!isOpen);
|
|
151
168
|
}}>
|
|
152
|
-
|
|
153
|
-
?
|
|
154
|
-
: item.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
169
|
+
{item.code === 'CT0000'
|
|
170
|
+
? item.code_name
|
|
171
|
+
: `${item.code_name} 그룹`}
|
|
172
|
+
</Link>
|
|
173
|
+
</li>
|
|
174
|
+
{item.children.length > 0 &&
|
|
175
|
+
item.children.map((childGroup) => (<li key={childGroup.code} value={childGroup.code_name} className="cursor-pointer px-9 py-[5px] text-[15px] font-[500] duration-150 hover:bg-gray-100">
|
|
176
|
+
<Link href={childGroup.etc2} key={index} target="_blank" title={childGroup.codename} onClick={() => {
|
|
177
|
+
setIsOpen(!isOpen);
|
|
178
|
+
}}>
|
|
179
|
+
{childGroup.code_name} 센터
|
|
180
|
+
</Link>
|
|
181
|
+
</li>))}
|
|
182
|
+
</>))
|
|
183
|
+
: // 메인페이지가 아닌 경로로 유입되었을 때, api 호출하여 받은 데이터. 색인 x
|
|
184
|
+
(_a = isGroups.list) === null || _a === void 0 ? void 0 : _a.map((item, index) => (<>
|
|
185
|
+
<li key={index} value={item.code_name} className="cursor-pointer px-5 py-[5px] text-[17px] font-[500] duration-150 hover:bg-gray-100">
|
|
186
|
+
<Link href={getDomainHandler(item.code, item.code_desc)} key={index} target="_blank" title={item.code_name} onClick={() => {
|
|
187
|
+
setIsOpen(!isOpen);
|
|
188
|
+
}}>
|
|
189
|
+
{item.code === 'CT0000'
|
|
190
|
+
? item.code_name
|
|
191
|
+
: `${item.code_name} 그룹`}
|
|
192
|
+
</Link>
|
|
193
|
+
</li>
|
|
194
|
+
{item.children.length > 0 &&
|
|
195
|
+
item.children.map((childGroup) => (<li key={childGroup.code} value={childGroup.code_name} className="cursor-pointer px-9 py-[5px] text-[15px] font-[500] duration-150 hover:bg-gray-100">
|
|
196
|
+
<Link href={childGroup.etc2} key={index} target="_blank" title={childGroup.codename} onClick={() => {
|
|
197
|
+
setIsOpen(!isOpen);
|
|
198
|
+
}}>
|
|
199
|
+
{childGroup.code_name} 센터
|
|
200
|
+
</Link>
|
|
201
|
+
</li>))}
|
|
202
|
+
</>))}
|
|
203
|
+
</ul>
|
|
204
|
+
|
|
167
205
|
<Image draggable={false} src={ArrowIcon} alt={'select icon'} width={28} height={15} className={'absolute right-[10%] top-[50%] w-[15px] translate-y-[-50%] max-sm:w-[14px]'}/>
|
|
168
206
|
</div>
|
|
169
207
|
</div>
|
|
@@ -177,7 +215,7 @@ const Footer = (props) => {
|
|
|
177
215
|
'max-xs:mb-[42px] max-xs:grid max-xs:grid-cols-2 max-xs:gap-2 max-xs:text-[16px] max-xs:leading-snug '}>
|
|
178
216
|
<FooterLinkList />
|
|
179
217
|
</div>
|
|
180
|
-
<div className={'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-
|
|
218
|
+
<div className={'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'}>
|
|
181
219
|
<p className={'xs:pr-[11px] xs:text-center'}>
|
|
182
220
|
<span className="font-[800]">주소</span>{' '}
|
|
183
221
|
<span className={'inline-block max-2xs:text-[14px]'}>
|
|
@@ -193,8 +231,8 @@ const Footer = (props) => {
|
|
|
193
231
|
|
|
194
232
|
<p className={'border-solid max-xs:my-[11px] xs:border-r xs:px-[11px] xs:text-center'}>
|
|
195
233
|
<span className="font-[800]">법률상담접수 </span>{' '}
|
|
196
|
-
<Link href={`tel:${
|
|
197
|
-
<span className={'inline-block'}>{
|
|
234
|
+
<Link href={`tel:${tel}`} onClick={onClickTel} aria-label={'법률상담접수 ' + tel} className={'inline-block'}>
|
|
235
|
+
<span className={'inline-block'}>{tel}</span>
|
|
198
236
|
</Link>
|
|
199
237
|
</p>
|
|
200
238
|
<p className={'break-keep xs:pl-[11px] xs:text-center'}>
|
|
@@ -217,8 +255,8 @@ const Footer = (props) => {
|
|
|
217
255
|
<Link href="https://pf.kakao.com/_xgxoTlK/chat" target="_blank" rel="noopener noreferrer" onClick={() => {
|
|
218
256
|
insert('kakao', isMobile);
|
|
219
257
|
savePowerLinkConversion('kakao', isMobile);
|
|
220
|
-
mKakaoClick();
|
|
221
258
|
ace_mKakaoClick();
|
|
259
|
+
mKakaoClick();
|
|
222
260
|
}}>
|
|
223
261
|
<Image src={SNS3} alt="법무법인(유한) 대륜 카카오톡채널" width={66} height={66} className={snsClass}/>
|
|
224
262
|
</Link>
|
|
@@ -239,29 +277,19 @@ export default Footer;
|
|
|
239
277
|
const FooterLinkList = () => {
|
|
240
278
|
return (<>
|
|
241
279
|
<p>
|
|
242
|
-
<Link href={'
|
|
243
|
-
면책공고
|
|
244
|
-
</Link>
|
|
280
|
+
<Link href={'/common/disclaimer'}>면책공고</Link>
|
|
245
281
|
</p>
|
|
246
282
|
<p>
|
|
247
|
-
<Link href={'
|
|
248
|
-
유한책임
|
|
249
|
-
</Link>
|
|
283
|
+
<Link href={'/common/limited-liability'}>유한책임</Link>
|
|
250
284
|
</p>
|
|
251
285
|
<p>
|
|
252
|
-
<Link href={'
|
|
253
|
-
개인정보처리방침
|
|
254
|
-
</Link>
|
|
286
|
+
<Link href={'/common/privacy-policy'}>개인정보처리방침</Link>
|
|
255
287
|
</p>
|
|
256
288
|
<p>
|
|
257
|
-
<Link href={'
|
|
258
|
-
이메일무단수집거부
|
|
259
|
-
</Link>
|
|
289
|
+
<Link href={'/common/collect'}>이메일무단수집거부</Link>
|
|
260
290
|
</p>
|
|
261
291
|
<p className={'text-[#285FA7]'}>
|
|
262
|
-
<Link href={'https://www.daeryunlaw.com/inquire'}
|
|
263
|
-
고객만족센터
|
|
264
|
-
</Link>
|
|
292
|
+
<Link href={'https://www.daeryunlaw.com/inquire'}>고객만족센터</Link>
|
|
265
293
|
</p>
|
|
266
294
|
</>);
|
|
267
295
|
};
|