@daeryun/dr_components 0.1.17 → 0.1.19
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/Footer.stories.jsx +4 -3
- package/dist/components/Footer/Footer.stories.tsx +15 -14
- package/dist/components/Footer/IFooterTypes.d.ts +23 -0
- package/dist/components/Footer/IFooterTypes.js +1 -0
- package/dist/components/Footer/IFooterTypes.ts +24 -0
- package/dist/components/Footer/index.d.ts +3 -7
- package/dist/components/Footer/index.jsx +110 -72
- package/dist/components/Footer/index.tsx +164 -126
- package/dist/styles/globals.css +30 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ const meta = {
|
|
|
8
8
|
};
|
|
9
9
|
export default meta;
|
|
10
10
|
export const Default = {
|
|
11
|
-
render:
|
|
11
|
+
render: args => {
|
|
12
12
|
const queryClient = new QueryClient();
|
|
13
13
|
return (<QueryClientProvider client={queryClient}>
|
|
14
14
|
<Footer {...args}/>
|
|
@@ -16,7 +16,8 @@ export const Default = {
|
|
|
16
16
|
},
|
|
17
17
|
args: {
|
|
18
18
|
tel: '1800-7905',
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
logo: Logo,
|
|
20
|
+
groupsData: [],
|
|
21
|
+
aceUrl: 'https://example.com'
|
|
21
22
|
}
|
|
22
23
|
};
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import Footer from './index'
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
-
import '../../styles/globals.css'
|
|
4
|
-
import { QueryClient, QueryClientProvider } from 'react-query'
|
|
5
|
-
import Logo from '../../asset/images/footer/logo_b.webp'
|
|
1
|
+
import Footer from './index';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import '../../styles/globals.css';
|
|
4
|
+
import { QueryClient, QueryClientProvider } from 'react-query';
|
|
5
|
+
import Logo from '../../asset/images/footer/logo_b.webp';
|
|
6
6
|
|
|
7
7
|
const meta: Meta<typeof Footer> = {
|
|
8
8
|
component: Footer,
|
|
9
9
|
title: 'Footer'
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
|
|
12
|
-
export default meta
|
|
12
|
+
export default meta;
|
|
13
13
|
|
|
14
|
-
type Story = StoryObj<typeof meta
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
15
|
|
|
16
16
|
export const Default: Story = {
|
|
17
|
-
render:
|
|
18
|
-
const queryClient = new QueryClient()
|
|
17
|
+
render: args => {
|
|
18
|
+
const queryClient = new QueryClient();
|
|
19
19
|
return (
|
|
20
20
|
<QueryClientProvider client={queryClient}>
|
|
21
21
|
<Footer {...args} />
|
|
22
22
|
</QueryClientProvider>
|
|
23
|
-
)
|
|
23
|
+
);
|
|
24
24
|
},
|
|
25
25
|
args: {
|
|
26
26
|
tel: '1800-7905',
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
logo: Logo,
|
|
28
|
+
groupsData: [],
|
|
29
|
+
aceUrl: 'https://example.com'
|
|
29
30
|
}
|
|
30
|
-
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
export interface INewFooterTypes {
|
|
19
|
+
groupsData: IGroupsData[] | null;
|
|
20
|
+
logo: string;
|
|
21
|
+
tel: string;
|
|
22
|
+
aceUrl: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
|
|
19
|
+
export interface INewFooterTypes {
|
|
20
|
+
groupsData: IGroupsData[] | null;
|
|
21
|
+
logo: string;
|
|
22
|
+
tel: string;
|
|
23
|
+
aceUrl: string;
|
|
24
|
+
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
aceCountLink?: string;
|
|
6
|
-
}
|
|
7
|
-
declare const Footer: (props: IFooterTypes) => React.JSX.Element;
|
|
8
|
-
export default Footer;
|
|
2
|
+
import { INewFooterTypes } from './IFooterTypes';
|
|
3
|
+
declare const NewFooter: ({ groupsData, tel, logo, aceUrl }: INewFooterTypes) => React.JSX.Element;
|
|
4
|
+
export default NewFooter;
|
|
@@ -1,50 +1,59 @@
|
|
|
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 { paramFetch } from '../../lib';
|
|
8
|
-
import { useQuery } from 'react-query';
|
|
9
16
|
import Wrapper from '../Layout/Wrapper';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
17
|
+
import TopBtn from './TopBtn';
|
|
18
|
+
import { useRouter } from 'next/router';
|
|
19
|
+
import sns01 from '/public/images/footer/sns_01.webp';
|
|
20
|
+
import sns02 from '/public/images/footer/sns_02.webp';
|
|
21
|
+
import sns03 from '/public/images/footer/sns_03.webp';
|
|
22
|
+
import sns04 from '/public/images/footer/sns_04.webp';
|
|
23
|
+
import sns05 from '/public/images/footer/sns_05.webp';
|
|
24
|
+
const NewFooter = ({ groupsData, tel, logo, aceUrl }) => {
|
|
25
|
+
var _a;
|
|
26
|
+
const router = useRouter();
|
|
20
27
|
const mobile = require('is-mobile');
|
|
21
28
|
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]';
|
|
29
|
+
const [isGroups, setIsGroups] = useState([]);
|
|
22
30
|
const [isMobile, setIsMobile] = useState(false);
|
|
23
|
-
const [centerLink, setCenterLink] = useState([]);
|
|
24
31
|
const [isOpen, setIsOpen] = useState(false);
|
|
25
32
|
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
|
-
|
|
33
|
+
const routeLocation = router.asPath === '/';
|
|
34
|
+
const fetchData = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
+
try {
|
|
36
|
+
const req = yield fetch('/api/center/list');
|
|
37
|
+
return yield req.json();
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.error(`fetch groupsData error : ${error} `);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
const fetchGroupsData = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
if (router.asPath !== '/') {
|
|
46
|
+
try {
|
|
47
|
+
const data = yield fetchData();
|
|
48
|
+
setIsGroups(data); // data를 setIsGroups로 설정
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.error(`fetch groupsData useEffect error: ${error}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
fetchGroupsData();
|
|
56
|
+
}, [router.asPath]);
|
|
48
57
|
const onClickTel = () => {
|
|
49
58
|
insert('call', isMobile);
|
|
50
59
|
savePowerLinkConversion('call', isMobile);
|
|
@@ -86,7 +95,7 @@ const Footer = (props) => {
|
|
|
86
95
|
const ace_pcTelClick = () => {
|
|
87
96
|
try {
|
|
88
97
|
// @ts-ignore
|
|
89
|
-
_PL(
|
|
98
|
+
_PL(aceUrl ? aceUrl : 'www.daeryunlaw.com/tel');
|
|
90
99
|
}
|
|
91
100
|
catch (e) { }
|
|
92
101
|
};
|
|
@@ -107,22 +116,22 @@ const Footer = (props) => {
|
|
|
107
116
|
useEffect(() => {
|
|
108
117
|
setIsMobile(mobile());
|
|
109
118
|
}, []);
|
|
110
|
-
return (<footer className={'relative flex h-[550px] w-full items-center justify-center border-t border-solid border-[#A8A8A8] bg-white font-[SUIT] text-[18px] ' +
|
|
119
|
+
return (<footer className={'relative mb-[30px] flex h-[550px] w-full items-center justify-center border-t border-solid border-[#A8A8A8] bg-white font-[SUIT] text-[18px] ' +
|
|
111
120
|
'max-xs:h-[800px] ' +
|
|
112
121
|
'max-lg:mb-[70px] ' +
|
|
113
122
|
'max-2xs:h-[730px]'}>
|
|
114
123
|
{/*top button*/}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
<Wrapper>
|
|
124
|
+
<Wrapper id={'footer'} className={'!absolute top-0'}>
|
|
125
|
+
<div className={'relative z-20'}>
|
|
126
|
+
<TopBtn className={'absolute right-0 top-[-50%] translate-y-[-50%]'}/>
|
|
127
|
+
</div>
|
|
128
|
+
</Wrapper>
|
|
129
|
+
<Wrapper id={'footer'}>
|
|
121
130
|
<div className={'w-full'}>
|
|
122
131
|
<div className={'mb-[77px] font-[800] tracking-[-0px] xs:flex xs:items-center ' +
|
|
123
132
|
'max-xl:mb-[50px] max-xl:justify-center max-xl:gap-[5%] '}>
|
|
124
133
|
<Link href={'/'}>
|
|
125
|
-
<Image src={
|
|
134
|
+
<Image src={logo} 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
135
|
</Link>
|
|
127
136
|
|
|
128
137
|
<div className={'flex gap-[36px] max-xxl:gap-[20px] max-xl:hidden '}>
|
|
@@ -144,27 +153,56 @@ const Footer = (props) => {
|
|
|
144
153
|
법무법인 대륜 그룹 바로가기
|
|
145
154
|
</button>
|
|
146
155
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
156
|
+
<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={{
|
|
157
|
+
zIndex: isOpen ? 50 : -9999,
|
|
158
|
+
pointerEvents: isOpen ? 'auto' : 'none'
|
|
159
|
+
}} role="listbox" aria-orientation="vertical" aria-labelledby="listbox-label" aria-expanded="true" aria-hidden="false">
|
|
160
|
+
{routeLocation
|
|
161
|
+
? groupsData === null || groupsData === void 0 ? void 0 : groupsData.map((item, index) => (
|
|
162
|
+
// 메인페이지로 접근했을 때, 서버사이드에서 가져온 데이터로 색인
|
|
163
|
+
<>
|
|
164
|
+
<li key={index} value={item.code_name} className="cursor-pointer px-5 py-[5px] text-[17px] font-[500] duration-150 hover:bg-gray-100">
|
|
165
|
+
<Link href={getDomainHandler(item.code, item.code_desc)} key={index} target="_blank" title={item.code_name} onClick={() => {
|
|
150
166
|
setIsOpen(!isOpen);
|
|
151
167
|
}}>
|
|
152
|
-
|
|
153
|
-
?
|
|
154
|
-
: item.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
+
{item.code === 'CT0000'
|
|
169
|
+
? item.code_name
|
|
170
|
+
: `${item.code_name} 그룹`}
|
|
171
|
+
</Link>
|
|
172
|
+
</li>
|
|
173
|
+
{item.children.length > 0 &&
|
|
174
|
+
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">
|
|
175
|
+
<Link href={childGroup.etc2} key={index} target="_blank" title={childGroup.codename} onClick={() => {
|
|
176
|
+
setIsOpen(!isOpen);
|
|
177
|
+
}}>
|
|
178
|
+
{childGroup.code_name} 센터
|
|
179
|
+
</Link>
|
|
180
|
+
</li>))}
|
|
181
|
+
</>))
|
|
182
|
+
: (_a = isGroups.list) === null || _a === void 0 ? void 0 : _a.map((item, index) => (
|
|
183
|
+
// 메인페이지가 아닌 경로로 유입되었을 때, api 호출하여 받은 데이터. 색인 x
|
|
184
|
+
<>
|
|
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
|
+
|
|
205
|
+
<Image draggable={false} src={process.env.NEXT_PUBLIC_S3_URL + '/comp-asset/section10/icon_arrow_gray.webp'} 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>
|
|
170
208
|
</div>
|
|
@@ -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={
|
|
197
|
-
<span className={'inline-block'}>{
|
|
234
|
+
<Link href={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'}>
|
|
@@ -207,11 +245,11 @@ const Footer = (props) => {
|
|
|
207
245
|
</p>
|
|
208
246
|
<div className={'flex max-xl:justify-center max-xl:gap-1'}>
|
|
209
247
|
<Link href="https://www.scourt.go.kr/portal/information/events/search/search.jsp" target="_blank" rel="noopener noreferrer">
|
|
210
|
-
<Image src={
|
|
248
|
+
<Image src={sns01} alt="나의 사건 검색" width={66} height={66} className={snsClass}/>
|
|
211
249
|
</Link>
|
|
212
250
|
|
|
213
251
|
<Link href="https://blog.naver.com/lawfirmdaeryun" target="_blank" rel="noopener noreferrer">
|
|
214
|
-
<Image src={
|
|
252
|
+
<Image src={sns02} alt="법무법인(유한) 대륜 공식블로그" width={37} height={31} className={snsClass}/>
|
|
215
253
|
</Link>
|
|
216
254
|
|
|
217
255
|
<Link href="https://pf.kakao.com/_xgxoTlK/chat" target="_blank" rel="noopener noreferrer" onClick={() => {
|
|
@@ -220,22 +258,22 @@ const Footer = (props) => {
|
|
|
220
258
|
mKakaoClick();
|
|
221
259
|
ace_mKakaoClick();
|
|
222
260
|
}}>
|
|
223
|
-
<Image src={
|
|
261
|
+
<Image src={sns03} alt="법무법인(유한) 대륜 카카오톡채널" width={66} height={66} className={snsClass}/>
|
|
224
262
|
</Link>
|
|
225
263
|
|
|
226
264
|
<Link href="https://www.youtube.com/channel/UC3uX0o1sFLj5eHdvZp2T64g/featured" target="_blank" rel="noopener noreferrer">
|
|
227
|
-
<Image draggable={false} src={
|
|
265
|
+
<Image draggable={false} src={sns04} alt="법무법인(유한) 대륜 유투브" width={66} height={66} className={snsClass}/>
|
|
228
266
|
</Link>
|
|
229
267
|
|
|
230
268
|
<Link href="https://www.instagram.com/daeryun_lawfirm/?utm_medium=copy_link" target="_blank" rel="noopener noreferrer">
|
|
231
|
-
<Image draggable={false} src={
|
|
269
|
+
<Image draggable={false} src={sns05} alt="법무법인(유한) 대륜 인스타그램" width={66} height={66} className={snsClass}/>
|
|
232
270
|
</Link>
|
|
233
271
|
</div>
|
|
234
272
|
</div>
|
|
235
273
|
</Wrapper>
|
|
236
274
|
</footer>);
|
|
237
275
|
};
|
|
238
|
-
export default
|
|
276
|
+
export default NewFooter;
|
|
239
277
|
const FooterLinkList = () => {
|
|
240
278
|
return (<>
|
|
241
279
|
<p>
|