@daeryun/dr_components 1.1.10 → 1.1.11
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/asset/images/map/close.webp +0 -0
- package/dist/asset/images/map/expand.webp +0 -0
- package/dist/asset/images/map/map.webp +0 -0
- package/dist/asset/images/map/officeBtn/arrow.svg +6 -0
- package/dist/asset/images/map/officeBtn/home_icon.svg +10 -0
- package/dist/asset/images/map/share.webp +0 -0
- package/dist/asset/images/map/youtube.webp +0 -0
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/components/common/types/map/index.d.ts +33 -0
- package/dist/components/common/types/map/index.js +1 -0
- package/dist/components/common/types/map/index.ts +34 -0
- package/dist/components/page/MapPage/MapModal.d.ts +10 -0
- package/dist/components/page/MapPage/MapModal.jsx +48 -0
- package/dist/components/page/MapPage/MapModal.tsx +76 -0
- package/dist/components/page/MapPage/MapPage.d.ts +6 -0
- package/dist/components/page/MapPage/MapPage.jsx +147 -0
- package/dist/components/page/MapPage/MapPage.stories.d.ts +7 -0
- package/dist/components/page/MapPage/MapPage.stories.jsx +83 -0
- package/dist/components/page/MapPage/MapPage.stories.tsx +98 -0
- package/dist/components/page/MapPage/MapPage.tsx +197 -0
- package/dist/components/page/MapPage/MobileMapKeyDetail.d.ts +11 -0
- package/dist/components/page/MapPage/MobileMapKeyDetail.jsx +99 -0
- package/dist/components/page/MapPage/MobileMapKeyDetail.tsx +177 -0
- package/dist/components/page/MapPage/PcMapKeyDetail.d.ts +11 -0
- package/dist/components/page/MapPage/PcMapKeyDetail.jsx +99 -0
- package/dist/components/page/MapPage/PcMapKeyDetail.tsx +178 -0
- package/dist/components/page/index.d.ts +1 -0
- package/dist/components/page/index.js +1 -0
- package/dist/components/page/index.ts +1 -0
- package/dist/styles/globals.css +699 -373
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,147 @@
|
|
|
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
|
+
import PageWrapper from '../../Layout/PageWrapper';
|
|
12
|
+
import CategoryMenuForPage from '../../CategoryMenu/CategoryMenuForPage';
|
|
13
|
+
import SubPageTitle from '../../SubPage/SubPageTitle';
|
|
14
|
+
import { useEffect, useRef, useState } from 'react';
|
|
15
|
+
import { useRouter } from 'next/navigation';
|
|
16
|
+
import Map from '../../MapSection/Map';
|
|
17
|
+
import Link from 'next/link';
|
|
18
|
+
import useBrowser from '../../hook/useBrowser';
|
|
19
|
+
import share from '../../../lib/share';
|
|
20
|
+
import PcMapKeyDetail from './PcMapKeyDetail';
|
|
21
|
+
import MobileMapKeyDetail from './MobileMapKeyDetail';
|
|
22
|
+
import MapModal from './MapModal';
|
|
23
|
+
const MapPage = ({ officeList, mapInfo }) => {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
const router = useRouter();
|
|
26
|
+
const { width } = useBrowser();
|
|
27
|
+
const [selectRegion, setSelectRegion] = useState('전체');
|
|
28
|
+
const [showModal, setShowModal] = useState(false);
|
|
29
|
+
const listSelectRef = useRef(null);
|
|
30
|
+
const targetRef = useRef(null);
|
|
31
|
+
const mapPath = `${process.env.NEXT_PUBLIC_S3_URL}/${process.env.NEXT_PUBLIC_MAP_UPLOAD_PATH}`;
|
|
32
|
+
const scrollToTarget = () => {
|
|
33
|
+
if (targetRef.current) {
|
|
34
|
+
const yOffset = -80;
|
|
35
|
+
const y = targetRef.current.getBoundingClientRect().top + window.scrollY + yOffset; // scrollY 추가
|
|
36
|
+
window.scrollTo({ top: y, behavior: 'smooth' });
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (mapInfo) {
|
|
41
|
+
setSelectRegion(mapInfo.modified_br_name || '');
|
|
42
|
+
if (mapInfo.modified_br_name) {
|
|
43
|
+
scrollToTarget();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, [mapInfo]);
|
|
47
|
+
const mapShare = (item) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
+
const shareData = {
|
|
49
|
+
title: item.keyword.replace('@replace@', ''),
|
|
50
|
+
text: item.sub_title.replace('@replace@', ''),
|
|
51
|
+
url: `${process.env.NEXT_PUBLIC_SERVICE_DOMAIN}/map/${item.key}`
|
|
52
|
+
};
|
|
53
|
+
const result = yield share(shareData);
|
|
54
|
+
if (!navigator.canShare) {
|
|
55
|
+
if (result === 'copiedToClipboard') {
|
|
56
|
+
alert('링크를 클립보드에 복사했습니다.');
|
|
57
|
+
}
|
|
58
|
+
else if (result === 'failed') {
|
|
59
|
+
alert('공유하기가 지원되지 않는 환경입니다.');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
const getSeoMapH1Title = (key) => {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
if (key && mapInfo) {
|
|
66
|
+
if (mapInfo.key.includes('daegumain') ||
|
|
67
|
+
mapInfo.key.includes('gwangjumain') ||
|
|
68
|
+
mapInfo.key.includes('incheonbon') ||
|
|
69
|
+
(mapInfo === null || mapInfo === void 0 ? void 0 : mapInfo.key.includes('suwonbon')) ||
|
|
70
|
+
mapInfo.key === 'samseong' ||
|
|
71
|
+
mapInfo.key === 'daejeon') {
|
|
72
|
+
return (_a = mapInfo.keyword) === null || _a === void 0 ? void 0 : _a.replace('@replace@변호사', `${process.env.NEXT_PUBLIC_MAP_KEYWORD}법무법인`);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
return (_b = mapInfo.keyword) === null || _b === void 0 ? void 0 : _b.replace('@replace@', `${process.env.NEXT_PUBLIC_MAP_KEYWORD}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
return (<section>
|
|
80
|
+
<PageWrapper className={'pb-[120px] pt-[130px] max-lg:pt-[120px] max-sm:pt-[100px]'}>
|
|
81
|
+
<div className="mb-[80px] mt-[50px] flex justify-end max-lg:mb-[70px]">
|
|
82
|
+
<CategoryMenuForPage />
|
|
83
|
+
</div>
|
|
84
|
+
<div className={'m-auto '}>
|
|
85
|
+
<SubPageTitle titleTxt={'오시는 길'} minTitle={'LOCATION'}/>
|
|
86
|
+
<p className={'mt-[10px] text-[16px] font-bold text-[#7b7b7b] 3xs:text-[16px] sm:text-[16px] md:text-[18px] lg:text-[22px]'}>
|
|
87
|
+
전국 어디서나 365일 24시간 상담접수 가능합니다.
|
|
88
|
+
</p>
|
|
89
|
+
</div>
|
|
90
|
+
<span className={'relative block h-[32px] w-[300px] leading-none text-white'}>
|
|
91
|
+
<button className={'absolute h-[0%] w-full overflow-hidden bg-[#555] transition-[height] focus:h-full'} onKeyUp={e => {
|
|
92
|
+
var _a;
|
|
93
|
+
if (e.key === 'Enter') {
|
|
94
|
+
(_a = document.getElementById('전북')) === null || _a === void 0 ? void 0 : _a.focus();
|
|
95
|
+
}
|
|
96
|
+
}}>
|
|
97
|
+
<p className={'flex h-[32px] w-full items-center justify-center'}>지도이미지에서 선택</p>
|
|
98
|
+
</button>
|
|
99
|
+
<button className={'absolute h-[0%] w-full overflow-hidden bg-[#555] transition-[height] focus:h-full'} onKeyDown={e => {
|
|
100
|
+
var _a;
|
|
101
|
+
if (e.key === 'Enter') {
|
|
102
|
+
(_a = listSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
103
|
+
}
|
|
104
|
+
}}>
|
|
105
|
+
<p className={'flex h-[32px] w-full items-center justify-center'}>목록에서 선택</p>
|
|
106
|
+
</button>
|
|
107
|
+
</span>
|
|
108
|
+
<div className="flex flex-col gap-10 md:flex-row">
|
|
109
|
+
{/* 지도 */}
|
|
110
|
+
<div className={'relative md:h-[60%] md:w-[45%] lg:w-[40%]'}>
|
|
111
|
+
<Map isFirstClick={false} onClick={(select, key) => __awaiter(void 0, void 0, void 0, function* () {
|
|
112
|
+
setSelectRegion(key);
|
|
113
|
+
yield router.push(`/map/${key}`);
|
|
114
|
+
})} selectRegion={selectRegion}/>
|
|
115
|
+
</div>
|
|
116
|
+
{/* 지도 리스트 */}
|
|
117
|
+
<div className={'md:w-[60%] lg:min-h-[50em]'}>
|
|
118
|
+
<p className={'pb-3 text-[26px] font-[800] text-[#0D2B52] lg:text-[32px]'}>전국 사무소 안내</p>
|
|
119
|
+
<ul className={'grid grid-cols-6 gap-2 border-b-[1px] border-t-[1px] border-solid border-[#285FA7] py-10 max-xl:grid-cols-5 max-lg:grid-cols-3 md:py-5 lg:py-9'}>
|
|
120
|
+
<Link href="/map" aria-label={'전체 선택됨.'} ref={listSelectRef}>
|
|
121
|
+
<li>
|
|
122
|
+
<div className={`${selectRegion === '전체' ? 'bg-[#285FA7] text-[#fff]' : 'text-[#707070]'} flex h-[55px] items-center justify-center border-[1px] border-solid border-[#285FA7] text-center text-[16px] lg:h-[70px] lg:text-[18px]`} onClick={() => setSelectRegion('전체')}>
|
|
123
|
+
전체
|
|
124
|
+
</div>
|
|
125
|
+
</li>
|
|
126
|
+
</Link>
|
|
127
|
+
{officeList &&
|
|
128
|
+
officeList.length > 0 &&
|
|
129
|
+
officeList.map((item, index) => (<Link href={`/map/${item.key}`} key={index}>
|
|
130
|
+
<li style={{ cursor: 'pointer' }} value={item.br_code}>
|
|
131
|
+
<div className={`${(mapInfo === null || mapInfo === void 0 ? void 0 : mapInfo.key) === item.key ? 'bg-[#285FA7] text-[#fff]' : 'text-[#707070]'} flex h-[55px] items-center justify-center whitespace-pre-line border-[1px] border-solid border-[#285FA7] text-center text-[16px] transition-[background-color,color] ease-linear hover:bg-[#285FA7] hover:text-[#fff] lg:h-[70px] lg:text-[18px]`}>
|
|
132
|
+
{item.tab_name.replace('(', '\n(')}
|
|
133
|
+
{item.modified_br_name}
|
|
134
|
+
</div>
|
|
135
|
+
</li>
|
|
136
|
+
</Link>))}
|
|
137
|
+
</ul>
|
|
138
|
+
|
|
139
|
+
{mapInfo &&
|
|
140
|
+
(width >= 1024 ? (<PcMapKeyDetail h1Title={(_a = getSeoMapH1Title(mapInfo === null || mapInfo === void 0 ? void 0 : mapInfo.key)) !== null && _a !== void 0 ? _a : ''} mapInfo={mapInfo} setShowModal={setShowModal} mapPath={mapPath} mapShare={mapShare} targetRef={targetRef}/>) : (<MobileMapKeyDetail h1Title={(_b = getSeoMapH1Title(mapInfo === null || mapInfo === void 0 ? void 0 : mapInfo.key)) !== null && _b !== void 0 ? _b : ''} mapInfo={mapInfo} setShowModal={setShowModal} mapPath={mapPath} mapShare={mapShare} targetRef={targetRef}/>))}
|
|
141
|
+
</div>
|
|
142
|
+
{mapInfo && (<MapModal showModal={showModal} setShowModal={setShowModal} mapPath={mapPath} mapInfo={mapInfo}/>)}
|
|
143
|
+
</div>
|
|
144
|
+
</PageWrapper>
|
|
145
|
+
</section>);
|
|
146
|
+
};
|
|
147
|
+
export default MapPage;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import MapPage from './MapPage';
|
|
3
|
+
declare const meta: Meta<typeof MapPage>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Example1: Story;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import MapPage from './MapPage';
|
|
2
|
+
const meta = {
|
|
3
|
+
component: MapPage,
|
|
4
|
+
title: 'MapPage'
|
|
5
|
+
};
|
|
6
|
+
export default meta;
|
|
7
|
+
export const Default = {
|
|
8
|
+
render: () => {
|
|
9
|
+
return (<div className={'font-[SUIT]'}>
|
|
10
|
+
<MapPage officeList={officeList}/>
|
|
11
|
+
</div>);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export const Example1 = {
|
|
15
|
+
render: () => {
|
|
16
|
+
return (<div className={'font-[SUIT]'}>
|
|
17
|
+
<MapPage officeList={officeList} mapInfo={mapInfo}/>
|
|
18
|
+
</div>);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const officeList = [
|
|
22
|
+
{ tab_name: '주사무소(강남)', m_sort: 0, key: 'gangnam', br_code: 'BR001', br_name: '서울' },
|
|
23
|
+
{ tab_name: '서울(여의도)', m_sort: 1, key: 'seoulbon', br_code: 'BR001', br_name: '서울' },
|
|
24
|
+
{ tab_name: '서울대치', m_sort: 2, key: 'samseong', br_code: 'BR001', br_name: '서울' },
|
|
25
|
+
{ tab_name: '서울용산', m_sort: 3, key: 'seoul', br_code: 'BR001', br_name: '서울' },
|
|
26
|
+
{ tab_name: '부산(해운대)', m_sort: 21, key: 'busan1', br_code: 'BR012', br_name: '부산' },
|
|
27
|
+
{ tab_name: '부산서부(명지)', m_sort: 28, key: 'myeongji', br_code: 'BR012', br_name: '부산' },
|
|
28
|
+
{ tab_name: '인천(송도)', m_sort: 31, key: 'incheonbon', br_code: 'BR002', br_name: '인천' },
|
|
29
|
+
{ tab_name: '대구(반월당)', m_sort: 34, key: 'daegumain', br_code: 'BR009', br_name: '대구' },
|
|
30
|
+
{ tab_name: '광주(상무지구)', m_sort: 40, key: 'gwangjumain', br_code: 'BR015', br_name: '광주' },
|
|
31
|
+
{ tab_name: '대전(유성구)', m_sort: 46, key: 'daejeon', br_code: 'BR007', br_name: '대전' },
|
|
32
|
+
{ tab_name: '울산', m_sort: 51, key: 'ulsan', br_code: 'BR013', br_name: '울산' },
|
|
33
|
+
{ tab_name: '수원', m_sort: 53, key: 'suwonbon', br_code: 'BR003', br_name: '수원/경기남부' },
|
|
34
|
+
{ tab_name: '고양', m_sort: 61, key: 'goyang', br_code: 'BR004', br_name: '의정부/경기북부' },
|
|
35
|
+
{ tab_name: '창원', m_sort: 66, key: 'changwon', br_code: 'BR014', br_name: '경남' },
|
|
36
|
+
{ tab_name: '성남', m_sort: 71, key: 'sungnam', br_code: 'BR003', br_name: '수원/경기남부' },
|
|
37
|
+
{ tab_name: '청주', m_sort: 76, key: 'cheongju', br_code: 'BR006', br_name: '청주/충북' },
|
|
38
|
+
{ tab_name: '부천', m_sort: 81, key: 'bucheon', br_code: 'BR002', br_name: '인천' },
|
|
39
|
+
{ tab_name: '남양주', m_sort: 83, key: 'namyangju', br_code: 'BR004', br_name: '의정부/경기북부' },
|
|
40
|
+
{ tab_name: '천안', m_sort: 86, key: 'cheonan', br_code: 'BR008', br_name: '충남' },
|
|
41
|
+
{ tab_name: '전주', m_sort: 91, key: 'jeonju', br_code: 'BR011', br_name: '전주/전북' },
|
|
42
|
+
{ tab_name: '안산', m_sort: 96, key: 'ansan', br_code: 'BR003', br_name: '수원/경기남부' },
|
|
43
|
+
{ tab_name: '평택', m_sort: 101, key: 'pyeongtaek', br_code: 'BR003', br_name: '수원/경기남부' },
|
|
44
|
+
{ tab_name: '안양', m_sort: 103, key: 'anyang', br_code: 'BR003', br_name: '수원/경기남부' },
|
|
45
|
+
{ tab_name: '김천구미', m_sort: 104, key: 'gimcheongumi', br_code: 'BR010', br_name: '경북' },
|
|
46
|
+
{ tab_name: '포항', m_sort: 106, key: 'pohang', br_code: 'BR010', br_name: '경북' },
|
|
47
|
+
{ tab_name: '의정부', m_sort: 111, key: 'uijeongbu', br_code: 'BR004', br_name: '의정부/경기북부' },
|
|
48
|
+
{ tab_name: '원주', m_sort: 113, key: 'wonju', br_code: 'BR005', br_name: '춘천/강원' },
|
|
49
|
+
{ tab_name: '진주', m_sort: 115, key: 'jinju', br_code: 'BR014', br_name: '경남' },
|
|
50
|
+
{ tab_name: '춘천', m_sort: 120, key: 'chuncheon', br_code: 'BR005', br_name: '춘천/강원' },
|
|
51
|
+
{ tab_name: '순천', m_sort: 126, key: 'suncheon', br_code: 'BR016', br_name: '전남' },
|
|
52
|
+
{ tab_name: '군산', m_sort: 129, key: 'gunsan', br_code: 'BR011', br_name: '전주/전북' },
|
|
53
|
+
{ tab_name: '목포', m_sort: 131, key: 'mokpo', br_code: 'BR016', br_name: '전남' },
|
|
54
|
+
{ tab_name: '강릉', m_sort: 133, key: 'gangneung', br_code: 'BR005', br_name: '춘천/강원' },
|
|
55
|
+
{ tab_name: '서산', m_sort: 134, key: 'seosan', br_code: 'BR008', br_name: '대전/충남' },
|
|
56
|
+
{ tab_name: '통영', m_sort: 135, key: 'tongyeong', br_code: 'BR014', br_name: '경남' },
|
|
57
|
+
{ tab_name: '제주', m_sort: 136, key: 'jeju', br_code: 'BR017', br_name: '제주' }
|
|
58
|
+
];
|
|
59
|
+
const mapInfo = {
|
|
60
|
+
address: '서울특별시 서초구 서초대로 74길 14 삼성화재 서초타워 9층 법무법인(유한) 대륜 주사무소',
|
|
61
|
+
address_arr: [],
|
|
62
|
+
br_code: 'BR001',
|
|
63
|
+
description: '강남@replace@변호사 상담 예약 : 1800-7905, 서울변호사 법률상담전담·송무전담 통합센터 오시는 길 : 서울특별시 서초구 서초대로 74길 14 삼성화재 서초타워 9층 법무법인(유한) 대륜 주사무소',
|
|
64
|
+
detail_img: '20250414022537666.webp',
|
|
65
|
+
domain: 'gangnam.daeryunlaw.com',
|
|
66
|
+
idx: 167,
|
|
67
|
+
img: '20250413124914582.webp',
|
|
68
|
+
key: 'gangnam',
|
|
69
|
+
keyword: '강남@replace@변호사',
|
|
70
|
+
lat: '',
|
|
71
|
+
lng: '',
|
|
72
|
+
modified_at: '2025-04-13T12:49:15.307Z',
|
|
73
|
+
modified_br_name: '서울',
|
|
74
|
+
parking_info: '주차비 유료(선임 시 주차비 지원)',
|
|
75
|
+
parking_info_arr: [],
|
|
76
|
+
place_id: '1075251166',
|
|
77
|
+
sub_title: '주사무소',
|
|
78
|
+
tab_name: '주사무소(강남)',
|
|
79
|
+
tel: '02-523-1128',
|
|
80
|
+
thumbnail_img: '',
|
|
81
|
+
title: '주사무소(강남법무법인)',
|
|
82
|
+
worktime: '평일) 08:00 - 19:00 | 토요일·공휴일) 10:00 - 17:00 | *전화상담 24시간 대응 가능'
|
|
83
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import MapPage from './MapPage';
|
|
3
|
+
import { IMap, IOfficeListTypes } from '../../common/types/map';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof MapPage> = {
|
|
6
|
+
component: MapPage,
|
|
7
|
+
title: 'MapPage'
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
|
|
14
|
+
export const Default: Story = {
|
|
15
|
+
render: () => {
|
|
16
|
+
return (
|
|
17
|
+
<div className={'font-[SUIT]'}>
|
|
18
|
+
<MapPage officeList={officeList} />
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const Example1: Story = {
|
|
25
|
+
render: () => {
|
|
26
|
+
return (
|
|
27
|
+
<div className={'font-[SUIT]'}>
|
|
28
|
+
<MapPage officeList={officeList} mapInfo={mapInfo} />
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const officeList: IOfficeListTypes[] = [
|
|
35
|
+
{ tab_name: '주사무소(강남)', m_sort: 0, key: 'gangnam', br_code: 'BR001', br_name: '서울' },
|
|
36
|
+
{ tab_name: '서울(여의도)', m_sort: 1, key: 'seoulbon', br_code: 'BR001', br_name: '서울' },
|
|
37
|
+
{ tab_name: '서울대치', m_sort: 2, key: 'samseong', br_code: 'BR001', br_name: '서울' },
|
|
38
|
+
{ tab_name: '서울용산', m_sort: 3, key: 'seoul', br_code: 'BR001', br_name: '서울' },
|
|
39
|
+
{ tab_name: '부산(해운대)', m_sort: 21, key: 'busan1', br_code: 'BR012', br_name: '부산' },
|
|
40
|
+
{ tab_name: '부산서부(명지)', m_sort: 28, key: 'myeongji', br_code: 'BR012', br_name: '부산' },
|
|
41
|
+
{ tab_name: '인천(송도)', m_sort: 31, key: 'incheonbon', br_code: 'BR002', br_name: '인천' },
|
|
42
|
+
{ tab_name: '대구(반월당)', m_sort: 34, key: 'daegumain', br_code: 'BR009', br_name: '대구' },
|
|
43
|
+
{ tab_name: '광주(상무지구)', m_sort: 40, key: 'gwangjumain', br_code: 'BR015', br_name: '광주' },
|
|
44
|
+
{ tab_name: '대전(유성구)', m_sort: 46, key: 'daejeon', br_code: 'BR007', br_name: '대전' },
|
|
45
|
+
{ tab_name: '울산', m_sort: 51, key: 'ulsan', br_code: 'BR013', br_name: '울산' },
|
|
46
|
+
{ tab_name: '수원', m_sort: 53, key: 'suwonbon', br_code: 'BR003', br_name: '수원/경기남부' },
|
|
47
|
+
{ tab_name: '고양', m_sort: 61, key: 'goyang', br_code: 'BR004', br_name: '의정부/경기북부' },
|
|
48
|
+
{ tab_name: '창원', m_sort: 66, key: 'changwon', br_code: 'BR014', br_name: '경남' },
|
|
49
|
+
{ tab_name: '성남', m_sort: 71, key: 'sungnam', br_code: 'BR003', br_name: '수원/경기남부' },
|
|
50
|
+
{ tab_name: '청주', m_sort: 76, key: 'cheongju', br_code: 'BR006', br_name: '청주/충북' },
|
|
51
|
+
{ tab_name: '부천', m_sort: 81, key: 'bucheon', br_code: 'BR002', br_name: '인천' },
|
|
52
|
+
{ tab_name: '남양주', m_sort: 83, key: 'namyangju', br_code: 'BR004', br_name: '의정부/경기북부' },
|
|
53
|
+
{ tab_name: '천안', m_sort: 86, key: 'cheonan', br_code: 'BR008', br_name: '충남' },
|
|
54
|
+
{ tab_name: '전주', m_sort: 91, key: 'jeonju', br_code: 'BR011', br_name: '전주/전북' },
|
|
55
|
+
{ tab_name: '안산', m_sort: 96, key: 'ansan', br_code: 'BR003', br_name: '수원/경기남부' },
|
|
56
|
+
{ tab_name: '평택', m_sort: 101, key: 'pyeongtaek', br_code: 'BR003', br_name: '수원/경기남부' },
|
|
57
|
+
{ tab_name: '안양', m_sort: 103, key: 'anyang', br_code: 'BR003', br_name: '수원/경기남부' },
|
|
58
|
+
{ tab_name: '김천구미', m_sort: 104, key: 'gimcheongumi', br_code: 'BR010', br_name: '경북' },
|
|
59
|
+
{ tab_name: '포항', m_sort: 106, key: 'pohang', br_code: 'BR010', br_name: '경북' },
|
|
60
|
+
{ tab_name: '의정부', m_sort: 111, key: 'uijeongbu', br_code: 'BR004', br_name: '의정부/경기북부' },
|
|
61
|
+
{ tab_name: '원주', m_sort: 113, key: 'wonju', br_code: 'BR005', br_name: '춘천/강원' },
|
|
62
|
+
{ tab_name: '진주', m_sort: 115, key: 'jinju', br_code: 'BR014', br_name: '경남' },
|
|
63
|
+
{ tab_name: '춘천', m_sort: 120, key: 'chuncheon', br_code: 'BR005', br_name: '춘천/강원' },
|
|
64
|
+
{ tab_name: '순천', m_sort: 126, key: 'suncheon', br_code: 'BR016', br_name: '전남' },
|
|
65
|
+
{ tab_name: '군산', m_sort: 129, key: 'gunsan', br_code: 'BR011', br_name: '전주/전북' },
|
|
66
|
+
{ tab_name: '목포', m_sort: 131, key: 'mokpo', br_code: 'BR016', br_name: '전남' },
|
|
67
|
+
{ tab_name: '강릉', m_sort: 133, key: 'gangneung', br_code: 'BR005', br_name: '춘천/강원' },
|
|
68
|
+
{ tab_name: '서산', m_sort: 134, key: 'seosan', br_code: 'BR008', br_name: '대전/충남' },
|
|
69
|
+
{ tab_name: '통영', m_sort: 135, key: 'tongyeong', br_code: 'BR014', br_name: '경남' },
|
|
70
|
+
{ tab_name: '제주', m_sort: 136, key: 'jeju', br_code: 'BR017', br_name: '제주' }
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
const mapInfo: IMap = {
|
|
74
|
+
address: '서울특별시 서초구 서초대로 74길 14 삼성화재 서초타워 9층 법무법인(유한) 대륜 주사무소',
|
|
75
|
+
address_arr: [],
|
|
76
|
+
br_code: 'BR001',
|
|
77
|
+
description:
|
|
78
|
+
'강남@replace@변호사 상담 예약 : 1800-7905, 서울변호사 법률상담전담·송무전담 통합센터 오시는 길 : 서울특별시 서초구 서초대로 74길 14 삼성화재 서초타워 9층 법무법인(유한) 대륜 주사무소',
|
|
79
|
+
detail_img: '20250414022537666.webp',
|
|
80
|
+
domain: 'gangnam.daeryunlaw.com',
|
|
81
|
+
idx: 167,
|
|
82
|
+
img: '20250413124914582.webp',
|
|
83
|
+
key: 'gangnam',
|
|
84
|
+
keyword: '강남@replace@변호사',
|
|
85
|
+
lat: '',
|
|
86
|
+
lng: '',
|
|
87
|
+
modified_at: '2025-04-13T12:49:15.307Z',
|
|
88
|
+
modified_br_name: '서울',
|
|
89
|
+
parking_info: '주차비 유료(선임 시 주차비 지원)',
|
|
90
|
+
parking_info_arr: [],
|
|
91
|
+
place_id: '1075251166',
|
|
92
|
+
sub_title: '주사무소',
|
|
93
|
+
tab_name: '주사무소(강남)',
|
|
94
|
+
tel: '02-523-1128',
|
|
95
|
+
thumbnail_img: '',
|
|
96
|
+
title: '주사무소(강남법무법인)',
|
|
97
|
+
worktime: '평일) 08:00 - 19:00 | 토요일·공휴일) 10:00 - 17:00 | *전화상담 24시간 대응 가능'
|
|
98
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import PageWrapper from '../../Layout/PageWrapper';
|
|
4
|
+
import CategoryMenuForPage from '../../CategoryMenu/CategoryMenuForPage';
|
|
5
|
+
import SubPageTitle from '../../SubPage/SubPageTitle';
|
|
6
|
+
import { useEffect, useRef, useState } from 'react';
|
|
7
|
+
import { useRouter } from 'next/navigation';
|
|
8
|
+
import Map from '../../MapSection/Map';
|
|
9
|
+
import Link from 'next/link';
|
|
10
|
+
import useBrowser from '../../hook/useBrowser';
|
|
11
|
+
import { IMap, IOfficeListTypes } from '../../common/types/map';
|
|
12
|
+
import share from '../../../lib/share';
|
|
13
|
+
import PcMapKeyDetail from './PcMapKeyDetail';
|
|
14
|
+
import MobileMapKeyDetail from './MobileMapKeyDetail';
|
|
15
|
+
import MapModal from './MapModal';
|
|
16
|
+
|
|
17
|
+
const MapPage = ({ officeList, mapInfo }: { officeList: IOfficeListTypes[]; mapInfo?: IMap }) => {
|
|
18
|
+
const router = useRouter();
|
|
19
|
+
const { width } = useBrowser();
|
|
20
|
+
const [selectRegion, setSelectRegion] = useState<string>('전체');
|
|
21
|
+
const [showModal, setShowModal] = useState(false);
|
|
22
|
+
const listSelectRef = useRef<HTMLAnchorElement>(null!);
|
|
23
|
+
const targetRef = useRef<HTMLDivElement>(null!);
|
|
24
|
+
const mapPath = `${process.env.NEXT_PUBLIC_S3_URL}/${process.env.NEXT_PUBLIC_MAP_UPLOAD_PATH}`;
|
|
25
|
+
|
|
26
|
+
const scrollToTarget = () => {
|
|
27
|
+
if (targetRef.current) {
|
|
28
|
+
const yOffset = -80;
|
|
29
|
+
const y = targetRef.current.getBoundingClientRect().top + window.scrollY + yOffset; // scrollY 추가
|
|
30
|
+
window.scrollTo({ top: y, behavior: 'smooth' });
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (mapInfo) {
|
|
36
|
+
setSelectRegion(mapInfo.modified_br_name || '');
|
|
37
|
+
if (mapInfo.modified_br_name) {
|
|
38
|
+
scrollToTarget();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}, [mapInfo]);
|
|
42
|
+
|
|
43
|
+
const mapShare = async (item: IMap) => {
|
|
44
|
+
const shareData: ShareData = {
|
|
45
|
+
title: item.keyword.replace('@replace@', ''),
|
|
46
|
+
text: item.sub_title.replace('@replace@', ''),
|
|
47
|
+
url: `${process.env.NEXT_PUBLIC_SERVICE_DOMAIN}/map/${item.key}`
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const result = await share(shareData);
|
|
51
|
+
|
|
52
|
+
if (!navigator.canShare) {
|
|
53
|
+
if (result === 'copiedToClipboard') {
|
|
54
|
+
alert('링크를 클립보드에 복사했습니다.');
|
|
55
|
+
} else if (result === 'failed') {
|
|
56
|
+
alert('공유하기가 지원되지 않는 환경입니다.');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const getSeoMapH1Title = (key: string) => {
|
|
62
|
+
if (key && mapInfo) {
|
|
63
|
+
if (
|
|
64
|
+
mapInfo.key.includes('daegumain') ||
|
|
65
|
+
mapInfo.key.includes('gwangjumain') ||
|
|
66
|
+
mapInfo.key.includes('incheonbon') ||
|
|
67
|
+
mapInfo?.key.includes('suwonbon') ||
|
|
68
|
+
mapInfo.key === 'samseong' ||
|
|
69
|
+
mapInfo.key === 'daejeon'
|
|
70
|
+
) {
|
|
71
|
+
return mapInfo.keyword?.replace('@replace@변호사', `${process.env.NEXT_PUBLIC_MAP_KEYWORD}법무법인`);
|
|
72
|
+
} else {
|
|
73
|
+
return mapInfo.keyword?.replace('@replace@', `${process.env.NEXT_PUBLIC_MAP_KEYWORD}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<section>
|
|
80
|
+
<PageWrapper className={'pb-[120px] pt-[130px] max-lg:pt-[120px] max-sm:pt-[100px]'}>
|
|
81
|
+
<div className="mb-[80px] mt-[50px] flex justify-end max-lg:mb-[70px]">
|
|
82
|
+
<CategoryMenuForPage />
|
|
83
|
+
</div>
|
|
84
|
+
<div className={'m-auto '}>
|
|
85
|
+
<SubPageTitle titleTxt={'오시는 길'} minTitle={'LOCATION'} />
|
|
86
|
+
<p
|
|
87
|
+
className={
|
|
88
|
+
'mt-[10px] text-[16px] font-bold text-[#7b7b7b] 3xs:text-[16px] sm:text-[16px] md:text-[18px] lg:text-[22px]'
|
|
89
|
+
}
|
|
90
|
+
>
|
|
91
|
+
전국 어디서나 365일 24시간 상담접수 가능합니다.
|
|
92
|
+
</p>
|
|
93
|
+
</div>
|
|
94
|
+
<span className={'relative block h-[32px] w-[300px] leading-none text-white'}>
|
|
95
|
+
<button
|
|
96
|
+
className={'absolute h-[0%] w-full overflow-hidden bg-[#555] transition-[height] focus:h-full'}
|
|
97
|
+
onKeyUp={e => {
|
|
98
|
+
if (e.key === 'Enter') {
|
|
99
|
+
document.getElementById('전북')?.focus();
|
|
100
|
+
}
|
|
101
|
+
}}
|
|
102
|
+
>
|
|
103
|
+
<p className={'flex h-[32px] w-full items-center justify-center'}>지도이미지에서 선택</p>
|
|
104
|
+
</button>
|
|
105
|
+
<button
|
|
106
|
+
className={'absolute h-[0%] w-full overflow-hidden bg-[#555] transition-[height] focus:h-full'}
|
|
107
|
+
onKeyDown={e => {
|
|
108
|
+
if (e.key === 'Enter') {
|
|
109
|
+
listSelectRef.current?.focus();
|
|
110
|
+
}
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
<p className={'flex h-[32px] w-full items-center justify-center'}>목록에서 선택</p>
|
|
114
|
+
</button>
|
|
115
|
+
</span>
|
|
116
|
+
<div className="flex flex-col gap-10 md:flex-row">
|
|
117
|
+
{/* 지도 */}
|
|
118
|
+
<div className={'relative md:h-[60%] md:w-[45%] lg:w-[40%]'}>
|
|
119
|
+
<Map
|
|
120
|
+
isFirstClick={false}
|
|
121
|
+
onClick={async (select, key) => {
|
|
122
|
+
setSelectRegion(key);
|
|
123
|
+
await router.push(`/map/${key}`);
|
|
124
|
+
}}
|
|
125
|
+
selectRegion={selectRegion}
|
|
126
|
+
/>
|
|
127
|
+
</div>
|
|
128
|
+
{/* 지도 리스트 */}
|
|
129
|
+
<div className={'md:w-[60%] lg:min-h-[50em]'}>
|
|
130
|
+
<p className={'pb-3 text-[26px] font-[800] text-[#0D2B52] lg:text-[32px]'}>전국 사무소 안내</p>
|
|
131
|
+
<ul
|
|
132
|
+
className={
|
|
133
|
+
'grid grid-cols-6 gap-2 border-b-[1px] border-t-[1px] border-solid border-[#285FA7] py-10 max-xl:grid-cols-5 max-lg:grid-cols-3 md:py-5 lg:py-9'
|
|
134
|
+
}
|
|
135
|
+
>
|
|
136
|
+
<Link href="/map" aria-label={'전체 선택됨.'} ref={listSelectRef}>
|
|
137
|
+
<li>
|
|
138
|
+
<div
|
|
139
|
+
className={`${selectRegion === '전체' ? 'bg-[#285FA7] text-[#fff]' : 'text-[#707070]'} flex h-[55px] items-center justify-center border-[1px] border-solid border-[#285FA7] text-center text-[16px] lg:h-[70px] lg:text-[18px]`}
|
|
140
|
+
onClick={() => setSelectRegion('전체')}
|
|
141
|
+
>
|
|
142
|
+
전체
|
|
143
|
+
</div>
|
|
144
|
+
</li>
|
|
145
|
+
</Link>
|
|
146
|
+
{officeList &&
|
|
147
|
+
officeList.length > 0 &&
|
|
148
|
+
officeList.map((item: any, index: any) => (
|
|
149
|
+
<Link href={`/map/${item.key}`} key={index}>
|
|
150
|
+
<li style={{ cursor: 'pointer' }} value={item.br_code}>
|
|
151
|
+
<div
|
|
152
|
+
className={`${mapInfo?.key === item.key ? 'bg-[#285FA7] text-[#fff]' : 'text-[#707070]'} flex h-[55px] items-center justify-center whitespace-pre-line border-[1px] border-solid border-[#285FA7] text-center text-[16px] transition-[background-color,color] ease-linear hover:bg-[#285FA7] hover:text-[#fff] lg:h-[70px] lg:text-[18px]`}
|
|
153
|
+
>
|
|
154
|
+
{item.tab_name.replace('(', '\n(')}
|
|
155
|
+
{item.modified_br_name}
|
|
156
|
+
</div>
|
|
157
|
+
</li>
|
|
158
|
+
</Link>
|
|
159
|
+
))}
|
|
160
|
+
</ul>
|
|
161
|
+
|
|
162
|
+
{mapInfo &&
|
|
163
|
+
(width >= 1024 ? (
|
|
164
|
+
<PcMapKeyDetail
|
|
165
|
+
h1Title={getSeoMapH1Title(mapInfo?.key) ?? ''}
|
|
166
|
+
mapInfo={mapInfo}
|
|
167
|
+
setShowModal={setShowModal}
|
|
168
|
+
mapPath={mapPath}
|
|
169
|
+
mapShare={mapShare}
|
|
170
|
+
targetRef={targetRef}
|
|
171
|
+
/>
|
|
172
|
+
) : (
|
|
173
|
+
<MobileMapKeyDetail
|
|
174
|
+
h1Title={getSeoMapH1Title(mapInfo?.key) ?? ''}
|
|
175
|
+
mapInfo={mapInfo}
|
|
176
|
+
setShowModal={setShowModal}
|
|
177
|
+
mapPath={mapPath}
|
|
178
|
+
mapShare={mapShare}
|
|
179
|
+
targetRef={targetRef}
|
|
180
|
+
/>
|
|
181
|
+
))}
|
|
182
|
+
</div>
|
|
183
|
+
{mapInfo && (
|
|
184
|
+
<MapModal
|
|
185
|
+
showModal={showModal}
|
|
186
|
+
setShowModal={setShowModal}
|
|
187
|
+
mapPath={mapPath}
|
|
188
|
+
mapInfo={mapInfo}
|
|
189
|
+
/>
|
|
190
|
+
)}
|
|
191
|
+
</div>
|
|
192
|
+
</PageWrapper>
|
|
193
|
+
</section>
|
|
194
|
+
);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export default MapPage;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IMap } from '../../common/types/map';
|
|
2
|
+
import { ForwardedRef } from 'react';
|
|
3
|
+
declare const MobileMapKeyDetail: ({ h1Title, mapInfo, setShowModal, mapPath, mapShare, targetRef }: {
|
|
4
|
+
h1Title: string;
|
|
5
|
+
mapInfo: IMap;
|
|
6
|
+
setShowModal: (v: boolean) => void;
|
|
7
|
+
mapPath: string;
|
|
8
|
+
mapShare: (item: IMap) => Promise<void>;
|
|
9
|
+
targetRef: ForwardedRef<HTMLDivElement>;
|
|
10
|
+
}) => import("react").JSX.Element;
|
|
11
|
+
export default MobileMapKeyDetail;
|