@daeryun/dr_components 0.1.55 → 0.1.57

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.
@@ -0,0 +1,154 @@
1
+ import React, { useEffect, useState, useRef } from 'react';
2
+ import Image from 'next/image';
3
+ import 'swiper/css';
4
+ import 'swiper/css/navigation';
5
+ import 'swiper/css/pagination';
6
+ import { useRouter } from 'next/router';
7
+ import Wrapper from '../Layout/Wrapper';
8
+ import useBrowser from '../common/hook/useBrowser';
9
+ import AreaImage from '../MapFix/AreaImage';
10
+ import { IInitialDataTypes, newNapArea } from '../common';
11
+ import Map from './Map';
12
+ import Link from 'next/link';
13
+
14
+ const MapSection = ({
15
+ initialData,
16
+ selectRegion,
17
+ setSelectRegion,
18
+ setMapFixOpen,
19
+ Title
20
+ }: {
21
+ initialData: IInitialDataTypes;
22
+ selectRegion: string;
23
+ setSelectRegion: any;
24
+ setMapFixOpen: any;
25
+ Title?: React.ReactNode;
26
+ }) => {
27
+ const router = useRouter();
28
+
29
+ const { width } = useBrowser();
30
+ const [mapAreas, setMapAreas] = useState<{ name: string; desc: string; url: string; src: string }[]>([]);
31
+ useEffect(() => {
32
+ const data = newNapArea[selectRegion];
33
+ setMapAreas(data);
34
+ }, [selectRegion]);
35
+
36
+ return (
37
+ <section className={'relative h-full w-full overflow-hidden'}>
38
+ {/*배경*/}
39
+ <Image
40
+ src={'https://d1tgonli21s4df.cloudfront.net/main_new/images_office_bg.webp'}
41
+ alt=""
42
+ fill
43
+ className={'object-cover max-sm:object-left '}
44
+ draggable="false"
45
+ />
46
+
47
+ <Wrapper
48
+ className={
49
+ 'flex h-full w-full overflow-hidden pb-[239px] pt-[180px] max-xl:py-[150px] max-md:flex-col max-sm:py-[80px]'
50
+ }
51
+ >
52
+ <div
53
+ className={
54
+ 'w-[60%] pb-[200px] max-3xl:pb-[140px] max-lg:w-[63%] max-md2:w-[65%] max-md:w-full max-md:pb-0'
55
+ }
56
+ >
57
+ {Title ? (
58
+ Title
59
+ ) : (
60
+ <span className={'flex items-end pb-[1.1%]'}>
61
+ <p
62
+ className={
63
+ `!font-[NanumSquare] text-[173px] font-[800] leading-[0.8] tracking-[-3.46px] text-black max-3xl:text-[150px] max-xxl:text-[120px] max-lg:text-[90px] max-md:text-[80px] ` +
64
+ ' max-sm:text-[100px] max-2xs:text-[70px] '
65
+ }
66
+ >
67
+ {initialData.office_cnt}
68
+ </p>
69
+ <span
70
+ className={
71
+ 'pb-[8px] pl-[20px] justify-between max-3xl:pb-[6px] max-xxl:pb-[3px] max-lg:pl-[10px] max-sm:pl-3'
72
+ }
73
+ >
74
+ <p
75
+ className={
76
+ 'text-[80px] font-[900] leading-none tracking-[-3.2px] ' +
77
+ 'max-3xl:text-[70px] max-xxl:text-[60px] max-lg:text-[45px] max-md:text-[40px] max-sm:text-[45px] max-2xs:text-[35px]'
78
+ }
79
+ >
80
+ OFFICE
81
+ </p>
82
+ </span>
83
+ </span>
84
+ )}
85
+
86
+ <div
87
+ className={
88
+ 'relative mt-[55px] flex w-full justify-end max-3xl:mt-10 max-lg:mt-5 max-md:hidden '
89
+ }
90
+ >
91
+ <Link
92
+ className={
93
+ 'flex h-[82px] w-[386px] justify-between items-center px-[41px] text-[24px] font-bold text-white ' +
94
+ 'max-3xl:h-[70px] max-3xl:w-[300px] max-3xl:px-[24px] max-3xl:text-[20px] ' +
95
+ 'max-lg:h-[50px] max-lg:w-[230px] max-lg:px-4 max-lg:text-[16px] ' +
96
+ 'bg-black rounded-full'
97
+ }
98
+ href={'/map'}
99
+ aria-label={'오시는길 페이지로 이동'}
100
+ >
101
+ VIEW MORE OFFICES
102
+ <Image
103
+ src={'https://d1tgonli21s4df.cloudfront.net/comp/main/section5/icon_arrow_white.webp'}
104
+ alt={''}
105
+ width={52}
106
+ height={39}
107
+ draggable={'false'}
108
+ className={'h-auto w-[34px] max-3xl:w-[28px] max-lg:w-[20px]'}
109
+ />
110
+ </Link>
111
+ </div>
112
+ {/*지도 grid*/}
113
+ <div className={`mt-[84px] max-3xl:mt-14 max-lg:mt-7 max-md:hidden `}>
114
+ <p className={'sr-only'}>{selectRegion}</p>
115
+
116
+ <div
117
+ className={'grid grid-cols-4 gap-3 max-lg:gap-2 max-md2:gap-1'}
118
+ tabIndex={-1}
119
+ aria-label={selectRegion + ' 선택됨.'}
120
+ >
121
+ {mapAreas && mapAreas.length > 0 ? (
122
+ mapAreas.map((area, index) => {
123
+ return <AreaImage key={index} area={area} />;
124
+ })
125
+ ) : (
126
+ <></>
127
+ )}
128
+ </div>
129
+ </div>
130
+ </div>
131
+ <div
132
+ className={
133
+ 'absolute right-10 top-[180px] z-50 h-[80%] w-[40%] ' +
134
+ 'max-lg:right-0 max-lg:top-[140px] ' +
135
+ ' max-md:relative max-md:top-0 max-md:mx-auto max-md:h-[85%] max-md:w-[85%] ' +
136
+ 'max-xs:mt-10 max-xs:h-full max-xs:w-full max-xs:scale-110'
137
+ }
138
+ >
139
+ <Map
140
+ selectRegion={selectRegion}
141
+ onClick={select => {
142
+ setSelectRegion(select);
143
+ if (width < 769) {
144
+ setMapFixOpen(true);
145
+ }
146
+ }}
147
+ />
148
+ </div>
149
+ </Wrapper>
150
+ </section>
151
+ );
152
+ };
153
+
154
+ export default MapSection;
@@ -13,30 +13,6 @@ const CategoryComponent = (props) => {
13
13
  else {
14
14
  link = `https://www.daeryunlaw-${selectedCenter.code_desc}.com/${pathname}`;
15
15
  }
16
- //
17
- // //field 상세 없는 페이지 처리
18
- // //노동
19
- // if (selectedCenter.code_desc === 'labor') {
20
- // if (id === 217 || id === 221 || id === 234 || id === 226 || id === 225 || id === 222) link += '/fire';
21
- // else if (id === 216) link += '/payment';
22
- // else if (id === 228 || id === 229) link += '/industrial';
23
- // else if (id === 234) link += '/damages';
24
- // else if (id === 232 || id === 219 || id === 224) link += '/accusation';
25
- // else if (id === 223) link += '/torment';
26
- // else if (id === 223) link += '/victim';
27
- // return link;
28
- // }
29
- // //학교폭력
30
- // if (selectedCenter.code_desc === 'school') {
31
- // if (id === 375 || id === 362) link += '/violence';
32
- // else if (id === 364) link += '/perpetrator';
33
- // else if (id === 365) link += '/victim';
34
- // else if (id === 363) link += '/process';
35
- // else if (id === 366) link += '/juvenile';
36
- // return link;
37
- // }
38
- // //증거조사
39
- // if (selectedCenter.code_desc === 'discovery') return link;
40
16
  return link + '/' + id;
41
17
  };
42
18
  return (<div className={'flex h-auto w-full flex-col justify-between bg-[#FAFAFA] px-[30px] py-[20px] ' +
@@ -32,30 +32,6 @@ const CategoryComponent = (props: {
32
32
  } else {
33
33
  link = `https://www.daeryunlaw-${selectedCenter.code_desc}.com/${pathname}`;
34
34
  }
35
- //
36
- // //field 상세 없는 페이지 처리
37
- // //노동
38
- // if (selectedCenter.code_desc === 'labor') {
39
- // if (id === 217 || id === 221 || id === 234 || id === 226 || id === 225 || id === 222) link += '/fire';
40
- // else if (id === 216) link += '/payment';
41
- // else if (id === 228 || id === 229) link += '/industrial';
42
- // else if (id === 234) link += '/damages';
43
- // else if (id === 232 || id === 219 || id === 224) link += '/accusation';
44
- // else if (id === 223) link += '/torment';
45
- // else if (id === 223) link += '/victim';
46
- // return link;
47
- // }
48
- // //학교폭력
49
- // if (selectedCenter.code_desc === 'school') {
50
- // if (id === 375 || id === 362) link += '/violence';
51
- // else if (id === 364) link += '/perpetrator';
52
- // else if (id === 365) link += '/victim';
53
- // else if (id === 363) link += '/process';
54
- // else if (id === 366) link += '/juvenile';
55
- // return link;
56
- // }
57
- // //증거조사
58
- // if (selectedCenter.code_desc === 'discovery') return link;
59
35
 
60
36
  return link + '/' + id;
61
37
  };
@@ -155,11 +131,11 @@ const CategoryComponent = (props: {
155
131
  </p>
156
132
  <span
157
133
  className={
158
- 'flex items-center gap-[20px] ' +
159
- //900px
160
- 'max-md2:w-[20%] max-md2:justify-between max-md2:gap-0 ' +
161
- //640px
162
- 'max-sm:w-[30%] '
134
+ 'flex items-center gap-[20px] ' +
135
+ //900px
136
+ 'max-md2:w-[20%] max-md2:justify-between max-md2:gap-0 ' +
137
+ //640px
138
+ 'max-sm:w-[30%] '
163
139
  }
164
140
  >
165
141
  <button
@@ -1,5 +1,8 @@
1
1
  import React from 'react';
2
+ import { ICategory, ICenter } from './ICategoryViewTypes';
2
3
  declare const CategoryView: (props: {
4
+ initCenterList?: ICenter[];
5
+ initShowCategoryList?: ICategory[];
3
6
  themeColor: string;
4
7
  currentCenterTitle: string;
5
8
  hiddenTitle?: boolean;
@@ -13,12 +13,12 @@ import CategoryComponent from './CategoryComponent';
13
13
  import axios from 'axios';
14
14
  const CategoryView = (props) => {
15
15
  //센터, 분야정보
16
- const [centerList, setCenterList] = useState([]);
16
+ const [centerList, setCenterList] = useState(props.initCenterList ? props.initCenterList : []);
17
17
  const [categoryList, setCategoryList] = useState([]);
18
18
  const [selectedCenter, setSelectedCenter] = useState({ code: '', code_name: '', code_desc: '' });
19
19
  const [filterCategory, setFilterCategory] = useState([]);
20
20
  // 페이지 관련
21
- const [showCategory, setShowCategory] = useState([]);
21
+ const [showCategory, setShowCategory] = useState(props.initShowCategoryList ? props.initShowCategoryList : []);
22
22
  const [currentPage, setCurrentPage] = useState(1);
23
23
  const [maxPageNum, setMaxPageNum] = useState(0);
24
24
  //보여지는 카테고리 수
@@ -5,19 +5,23 @@ import CategoryComponent from './CategoryComponent';
5
5
  import axios from 'axios';
6
6
 
7
7
  const CategoryView = (props: {
8
+ initCenterList?: ICenter[];
9
+ initShowCategoryList?: ICategory[];
8
10
  themeColor: string; // 테마색상
9
11
  currentCenterTitle: string; // 기준이 되는 센터 영어이름 (설정 시, 센터 가장 상단위치, 기본값)
10
12
  hiddenTitle?: boolean; // '1280px' 보다 클 시, 타이틀 숨김처리
11
13
  allMainCenterTargetBlank?: boolean; // 카테고리 링크 전부 새창, 해당 센터 카테고리로 이동
12
14
  }) => {
13
15
  //센터, 분야정보
14
- const [centerList, setCenterList] = useState<ICenter[]>([]);
16
+ const [centerList, setCenterList] = useState<ICenter[]>(props.initCenterList ? props.initCenterList : []);
15
17
  const [categoryList, setCategoryList] = useState<ICategory[]>([]);
16
18
  const [selectedCenter, setSelectedCenter] = useState<ICenter>({ code: '', code_name: '', code_desc: '' });
17
19
  const [filterCategory, setFilterCategory] = useState<ICategory[]>([]);
18
20
 
19
21
  // 페이지 관련
20
- const [showCategory, setShowCategory] = useState<ICategory[]>([]);
22
+ const [showCategory, setShowCategory] = useState<ICategory[]>(
23
+ props.initShowCategoryList ? props.initShowCategoryList : []
24
+ );
21
25
  const [currentPage, setCurrentPage] = useState(1);
22
26
  const [maxPageNum, setMaxPageNum] = useState<number>(0);
23
27
 
@@ -30,3 +30,4 @@ export declare const imageLogoData: {
30
30
  name: string;
31
31
  sizes: string;
32
32
  }[];
33
+ export declare const newNapArea: IMapArea;
@@ -2051,3 +2051,216 @@ export const imageLogoData = [
2051
2051
  sizes: '86px'
2052
2052
  }
2053
2053
  ];
2054
+ //new map section
2055
+ export const newNapArea = {
2056
+ 강원: [
2057
+ { name: '', desc: '', url: '', src: '' },
2058
+ { name: '', desc: '', url: '', src: '' },
2059
+ {
2060
+ name: 'Chuncheon',
2061
+ desc: '춘천',
2062
+ url: 'map_chuncheon.webp',
2063
+ src: 'chuncheon'
2064
+ },
2065
+ { name: '', desc: '', url: '', src: '' },
2066
+ { name: '', desc: '', url: '', src: '' },
2067
+ { name: 'Wonju', desc: '원주', url: 'map_wonju.webp', src: 'wonju' },
2068
+ { name: 'Gangneung', desc: '깅릉', url: 'map_gangneung.webp', src: 'gangneung' },
2069
+ { name: '', desc: '', url: '', src: '' }
2070
+ ],
2071
+ 경기북부: [
2072
+ { name: '', desc: '', url: '', src: '' },
2073
+ { name: 'Goyang', desc: '고양', url: 'map_goyang.webp', src: 'goyang' },
2074
+ {
2075
+ name: 'Uijeongbu',
2076
+ desc: '의정부',
2077
+ url: 'map_uijeongbu.webp',
2078
+ src: 'uijeongbu'
2079
+ },
2080
+ { name: '', desc: '', url: '', src: '' },
2081
+ {
2082
+ name: 'Namyangju',
2083
+ desc: '남양주',
2084
+ url: 'map_namyangju.webp',
2085
+ src: 'namyangju'
2086
+ },
2087
+ { name: '', desc: '', url: '', src: '' },
2088
+ { name: '', desc: '', url: '', src: '' },
2089
+ { name: '', desc: '', url: '', src: '' }
2090
+ ],
2091
+ 서울: [
2092
+ { name: '', desc: '', url: '', src: '' },
2093
+ { name: 'Yeouido', desc: '본사', url: 'map_bonsa.webp', src: 'seoulbon' },
2094
+ {
2095
+ name: 'Yongsan',
2096
+ desc: '서울용산',
2097
+ url: 'map_yongsan.webp',
2098
+ src: 'seoul'
2099
+ },
2100
+ {
2101
+ name: 'Gangnam',
2102
+ desc: '서울본부',
2103
+ url: 'map_gangnam.webp',
2104
+ src: 'gangnam'
2105
+ },
2106
+ { name: 'Seocho', desc: '서울중앙', url: 'map_seocho.webp', src: 'seocho' },
2107
+ { name: 'Dobong', desc: '서울북부', url: 'map_dobong.webp', src: 'dobong' },
2108
+ { name: '', desc: '', url: '', src: '' },
2109
+ { name: '', desc: '', url: '', src: '' }
2110
+ ],
2111
+ '인천·부천': [
2112
+ { name: '', desc: '', url: '', src: '' },
2113
+ {
2114
+ name: 'Songdo',
2115
+ desc: '인천본부',
2116
+ url: 'map_incheonbon.webp',
2117
+ src: 'incheonbon'
2118
+ },
2119
+ { name: 'Incheon', desc: '인천', url: 'map_incheon.webp', src: 'incheon' },
2120
+ { name: '', desc: '', url: '', src: '' },
2121
+ { name: '', desc: '', url: '', src: '' },
2122
+ { name: '', desc: '', url: '', src: '' },
2123
+ { name: '', desc: '', url: '', src: '' },
2124
+ { name: 'Bucheon', desc: '부천', url: 'map_bucheon.webp', src: 'bucheon' }
2125
+ ],
2126
+ 경기남부: [
2127
+ { name: '', desc: '', url: '', src: '' },
2128
+ {
2129
+ name: 'Suwon',
2130
+ desc: '수원본부',
2131
+ url: 'map_suwonbon.webp',
2132
+ src: 'suwonbon'
2133
+ },
2134
+ { name: 'Gwanggyo', desc: '수원', url: 'map_suwon.webp', src: 'suwon' },
2135
+ {
2136
+ name: 'Seongnam',
2137
+ desc: '성남',
2138
+ url: 'map_seongnam.webp',
2139
+ src: 'sungnam'
2140
+ },
2141
+ { name: 'Ansan', desc: '안산', url: 'map_ansan.webp', src: 'ansan' },
2142
+ {
2143
+ name: 'Pyeongtaek',
2144
+ desc: '평택',
2145
+ url: 'map_pyeongtaek.webp',
2146
+ src: 'pyeongtaek'
2147
+ },
2148
+ { name: 'Anyang', desc: '안양', url: 'map_anyang.webp', src: 'anyang' },
2149
+ { name: '', desc: '', url: '', src: '' }
2150
+ ],
2151
+ 충북: [
2152
+ { name: '', desc: '', url: '', src: '' },
2153
+ { name: '', desc: '', url: '', src: '' },
2154
+ {
2155
+ name: 'Cheongju',
2156
+ desc: '청주',
2157
+ url: 'map_cheongju.webp',
2158
+ src: 'cheongju'
2159
+ },
2160
+ { name: '', desc: '', url: '', src: '' },
2161
+ { name: '', desc: '', url: '', src: '' },
2162
+ { name: '', desc: '', url: '', src: '' },
2163
+ { name: '', desc: '', url: '', src: '' },
2164
+ { name: '', desc: '', url: '', src: '' }
2165
+ ],
2166
+ '대전·충남': [
2167
+ { name: '', desc: '', url: '', src: '' },
2168
+ { name: 'Daejeon', desc: '대전', url: 'map_daejeon.webp', src: 'daejeon' },
2169
+ { name: '', desc: '', url: '', src: '' },
2170
+ { name: '', desc: '', url: '', src: '' },
2171
+ { name: '', desc: '', url: '', src: '' },
2172
+ { name: '', desc: '', url: '', src: '' },
2173
+ { name: 'CheonAn', desc: '천안', url: 'map_cheon-an.webp', src: 'cheonan' },
2174
+ { name: '', desc: '', url: '', src: '' }
2175
+ ],
2176
+ '대구·경북': [
2177
+ { name: '', desc: '', url: '', src: '' },
2178
+ {
2179
+ name: 'Daegu',
2180
+ desc: '대구본부',
2181
+ url: 'map_daegu.webp',
2182
+ src: 'daegumain'
2183
+ },
2184
+ {
2185
+ name: 'Suseong-Gu',
2186
+ desc: '대구',
2187
+ url: 'map_suseonggu.webp',
2188
+ src: 'daegu'
2189
+ },
2190
+ { name: '', desc: '', url: '', src: '' },
2191
+ { name: 'Pohang', desc: '포항', url: 'map_pohang.webp', src: 'pohang' },
2192
+ { name: '', desc: '', url: '', src: '' },
2193
+ { name: '', desc: '', url: '', src: '' },
2194
+ { name: '', desc: '', url: '', src: '' }
2195
+ ],
2196
+ 전북: [
2197
+ { name: '', desc: '', url: '', src: '' },
2198
+ { name: '', desc: '', url: '', src: '' },
2199
+ { name: 'Jeonju', desc: '전주', url: 'map_jeonju.webp', src: 'jeonju' },
2200
+ { name: '', desc: '', url: '', src: '' },
2201
+ { name: '', desc: '', url: '', src: '' },
2202
+ { name: 'Gunsan', desc: '군산', url: 'map_gunsan.webp', src: 'gunsan' },
2203
+ { name: '', desc: '', url: '', src: '' },
2204
+ { name: '', desc: '', url: '', src: '' }
2205
+ ],
2206
+ '광주·전남': [
2207
+ { name: '', desc: '', url: '', src: '' },
2208
+ {
2209
+ name: 'Sangmu',
2210
+ desc: '광주본부',
2211
+ url: 'map_gwangjumain.webp',
2212
+ src: 'gwangjumain'
2213
+ },
2214
+ { name: 'Gwangju', desc: '광주', url: 'map_gwangju.webp', src: 'gwangju' },
2215
+ { name: '', desc: '', url: '', src: '' },
2216
+ { name: '', desc: '', url: '', src: '' },
2217
+ { name: 'Mokpo', desc: '목포', url: 'map_mokpo.webp', src: 'mokpo' },
2218
+ { name: '', desc: '', url: '', src: '' },
2219
+ {
2220
+ name: 'Suncheon',
2221
+ desc: '순천',
2222
+ url: 'map_suncheon.webp',
2223
+ src: 'suncheon'
2224
+ }
2225
+ ],
2226
+ '부산·울산·경남': [
2227
+ { name: '', desc: '', url: '', src: '' },
2228
+ {
2229
+ name: 'Haeundae',
2230
+ desc: '부산본부',
2231
+ url: 'map_busan.webp',
2232
+ src: 'busan1'
2233
+ },
2234
+ { name: 'Busan', desc: '부산', url: 'map_yeonjegu.webp', src: 'busan2' },
2235
+ {
2236
+ name: 'Myeongji',
2237
+ desc: '부산서부',
2238
+ url: 'map_myeongji.webp',
2239
+ src: 'myeongji'
2240
+ },
2241
+ { name: 'Ulsan', desc: '울산', url: 'map_ulsan.webp', src: 'ulsan' },
2242
+ {
2243
+ name: 'Changwon',
2244
+ desc: '창원',
2245
+ url: 'map_changwon.webp',
2246
+ src: 'changwon'
2247
+ },
2248
+ { name: 'Jinju', desc: '진주', url: 'map_jinju.webp', src: 'jinju' },
2249
+ {
2250
+ name: 'Tongyeong',
2251
+ desc: '통영',
2252
+ url: 'map_tongyeong.webp',
2253
+ src: 'tongyeong'
2254
+ }
2255
+ ],
2256
+ 제주도: [
2257
+ { name: '', desc: '', url: '', src: '' },
2258
+ { name: '', desc: '', url: '', src: '' },
2259
+ { name: 'Jeju', desc: '제주', url: 'map_jeju.webp', src: 'jeju' },
2260
+ { name: '', desc: '', url: '', src: '' },
2261
+ { name: '', desc: '', url: '', src: '' },
2262
+ { name: '', desc: '', url: '', src: '' },
2263
+ { name: '', desc: '', url: '', src: '' },
2264
+ { name: '', desc: '', url: '', src: '' }
2265
+ ]
2266
+ };