@daeryun/dr_components 1.3.21 → 1.3.24

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,388 @@
1
+ 'use client';
2
+
3
+ import { IContentsListTypes, ISeoTemplateTypes } from '../SuccessNew/SuccessNewType';
4
+ import { IAddLinkTypes, IFieldTypes, ILawyerTypes } from '../../common/types/seo';
5
+ import { IInitialDataTypes } from '../../common';
6
+ import useBrowser from '../../hook/useBrowser';
7
+ import { usePathname, useRouter, useSearchParams } from 'next/navigation';
8
+ import React, { useEffect, useRef, useState } from 'react';
9
+ import PageTitleBox from '../../PageTitleBox/PageTitleBox';
10
+ import { ImgTypes } from '../../PageTitleBox/ImgTypes';
11
+ import PdfPrintCopyLink from '../../PdfPrintCopyLink/PdfPrintCopyLink';
12
+ import { htmlUrlDecode } from '../../../lib';
13
+ import ContentList from '../SuccessNew/components/ContentList';
14
+ import H2Contents from '../SuccessNew/components/H2Contents';
15
+ import H3Contents from '../SuccessNew/components/H3Contents';
16
+ import SeoAdditionalLink from '../../Seo/SeoAdditionalLink';
17
+ import SeoYoutube from '../../Seo/SeoYoutube';
18
+ import SeoStrength from '../../Seo/SeoStrength';
19
+ import SeoConsulting from '../../Seo/SeoConsulting';
20
+ import LawInfoContentList from '../SuccessNew/components/LawInfoContentList';
21
+ import { Lawyer } from '../../Seo/Lawyer';
22
+ import PostNavigation from '../../postNavigation/PostNavigation';
23
+ import { FieldCase } from '../SuccessNew/components/FieldCase';
24
+ import { ITrendDetailPageTypes } from '../../common/types/trend';
25
+
26
+ const TrendDetail = ({ data, tel }: ITrendDetailPageTypes) => {
27
+ const {
28
+ template,
29
+ contentsList,
30
+ h2List,
31
+ lawyerData,
32
+ fieldData,
33
+ pnData,
34
+ referenceLinkList,
35
+ newsLinkList,
36
+ shortsLinkList,
37
+ youtubeLinkList,
38
+ initialData
39
+ } = data;
40
+
41
+ const { width } = useBrowser(true);
42
+ const router = useRouter();
43
+ const pathname = usePathname();
44
+ const searchParams = useSearchParams();
45
+ const printRef = useRef<HTMLDivElement>(null);
46
+
47
+ //details 태그
48
+ const detailsRef = useRef<HTMLDetailsElement>(null);
49
+ const [isOpen, setIsOpen] = useState(false);
50
+ const [isFaqActive, setIsFaqActive] = useState<boolean>(false);
51
+
52
+ const handleScrollToElement = (idx: number) => {
53
+ if (typeof window != 'undefined') {
54
+ const element = document.getElementById(idx.toString());
55
+ if (element) {
56
+ const topOffset = element.getBoundingClientRect().top;
57
+ window.scrollTo({
58
+ top: window.scrollY + topOffset - 130,
59
+ behavior: 'smooth'
60
+ });
61
+ }
62
+ }
63
+ };
64
+
65
+ const handleClickGoImg = () => {
66
+ const imgLocation = document.getElementById('img_wrap')?.offsetTop ?? 0;
67
+ window.scrollTo({ top: imgLocation + (width > 680 ? 300 : 200), behavior: 'smooth' });
68
+ };
69
+
70
+ useEffect(() => {
71
+ const detailsElement = detailsRef.current;
72
+ if (detailsElement) {
73
+ const handleToggle = () => setIsOpen(detailsElement.open);
74
+ detailsElement.addEventListener('toggle', handleToggle);
75
+ setIsOpen(detailsElement.open);
76
+
77
+ return () => detailsElement.removeEventListener('toggle', handleToggle);
78
+ }
79
+ }, []);
80
+
81
+ useEffect(() => {
82
+ const el = document.getElementById('daum-wm-content') as HTMLLinkElement;
83
+ el.focus();
84
+ }, [pathname, searchParams]);
85
+
86
+ useEffect(() => {
87
+ if (template) {
88
+ // 초기화
89
+ setIsFaqActive(false);
90
+
91
+ for (const data of template) {
92
+ // console.log("faq 활성화: ", data['active_faq']);
93
+ if (data['active_faq']) {
94
+ setIsFaqActive(true);
95
+ }
96
+ }
97
+ }
98
+ }, [template]);
99
+
100
+ return (
101
+ <>
102
+ <PageTitleBox
103
+ titleTxt={'판결분석/최신동향'}
104
+ subTxt={
105
+ <>
106
+ 분야별 전문성을 갖춘 법무법인(유한) 대륜의 <br /> 판결과 법적이슈에 대한 분석을 전해드립니다.
107
+ </>
108
+ }
109
+ imgType={ImgTypes.TREND}
110
+ isViewP
111
+ isSeo
112
+ />
113
+ <div
114
+ id={'sub_contents'}
115
+ ref={printRef}
116
+ itemScope={isFaqActive ? undefined : true}
117
+ itemType={isFaqActive ? undefined : 'https://schema.org/FAQPage'}
118
+ >
119
+ <div className="relative m-auto mb-[100px] w-[90%] max-w-screen-2xl max-md2:mb-[40px] max-xs:mb-[30px]">
120
+ <div
121
+ className={
122
+ 'm-auto mt-[100px] flex gap-[120px] ' +
123
+ //1700px
124
+ 'max-5xl:gap-[80px] ' +
125
+ //1500px
126
+ 'max-3xl:gap-10 ' +
127
+ //1280px
128
+ 'max-xl:mt-0 max-xl:flex-col max-xl:gap-0 ' +
129
+ //600px
130
+ 'max-sm:mt-[10px] '
131
+ }
132
+ >
133
+ <span>
134
+ <div className="flex-1">
135
+ {template && width < 1280 ? (
136
+ <PdfPrintCopyLink
137
+ fileName={template.filter(t => t.tag === 'h1')[0].tag_title}
138
+ printRef={printRef}
139
+ />
140
+ ) : null}
141
+ <div className={'max-xl:mt-[25px] max-xs:mt-[15px]'}>
142
+ {template
143
+ .filter(t => t.tag === 'h1')
144
+ .map((h1Contents, index) => {
145
+ return (
146
+ <React.Fragment key={index}>
147
+ {/*h1*/}
148
+
149
+ <h1
150
+ className={
151
+ 'text-[52.5px] font-[800] !leading-[1.3] tracking-[-2.1px] text-[#285FA7] max-3xl:text-5xl max-md:text-4xl max-xs:text-[28px] '
152
+ }
153
+ key={index}
154
+ >
155
+ {h1Contents.tag_title}
156
+ </h1>
157
+ <div className={'mt-[32px] h-[2px] w-full bg-[#285FA7]'}></div>
158
+ {/*h1 설명글*/}
159
+ <div
160
+ className={
161
+ 'mb-[54px] mt-[16px] text-[16px] font-normal tracking-[-0.96px] xs:text-[18px] sm:mb-[62px] sm:mt-[26px] sm:text-[20px] lg:mb-[75px] lg:mt-[26px] lg:text-[24px] '
162
+ }
163
+ >
164
+ {h1Contents.is_editor ? (
165
+ <div
166
+ id={'ck-content'}
167
+ dangerouslySetInnerHTML={{
168
+ __html: htmlUrlDecode(
169
+ h1Contents.description.replace(
170
+ '../../UploadFile',
171
+ '/SE2/upload'
172
+ )
173
+ )
174
+ }}
175
+ />
176
+ ) : (
177
+ h1Contents.description
178
+ )}
179
+ </div>
180
+ </React.Fragment>
181
+ );
182
+ })}
183
+ </div>
184
+ <article>
185
+ {/*목차*/}
186
+ <ContentList
187
+ template={template}
188
+ h2List={h2List ? h2List : []}
189
+ onImageMove={handleClickGoImg}
190
+ onScrollToElement={handleScrollToElement}
191
+ />
192
+
193
+ {/*h2*/}
194
+ {h2List &&
195
+ h2List.map((h2Template, index) => {
196
+ return (
197
+ <section
198
+ className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'}
199
+ key={'h2영역' + h2Template.idx}
200
+ >
201
+ <H2Contents index={index} h2Template={h2Template} />
202
+
203
+ {/*h3*/}
204
+ {template
205
+ .filter(t => t.parent === h2Template.idx)
206
+ .map((h3Template, h3Index) => {
207
+ const refer_is_use = h3Template.reference_is_use;
208
+ const refer_length = referenceLinkList.length;
209
+ const refer_content_length = referenceLinkList.filter(
210
+ i => i.tag_idx === h3Template.idx
211
+ ).length;
212
+
213
+ const news_is_use = h3Template.news_is_use;
214
+ const news_length = newsLinkList.length;
215
+ const news_content_length = newsLinkList.filter(
216
+ i => i.tag_idx === h3Template.idx
217
+ ).length;
218
+
219
+ return (
220
+ <React.Fragment key={'h3영역' + h3Template.idx}>
221
+ <H3Contents h3Template={h3Template} />
222
+ {(refer_is_use &&
223
+ refer_length > 0 &&
224
+ refer_content_length > 0) ||
225
+ (news_is_use &&
226
+ news_length > 0 &&
227
+ news_content_length > 0) ? (
228
+ <span
229
+ className={
230
+ 'mb-[44px] flex flex-col gap-[26px] px-[10px] sm:mx-[33px] sm:mb-[50px] sm:px-[18px] lg:mb-[78px] ' +
231
+ //520px
232
+ 'max-2sm:gap-[16px]'
233
+ }
234
+ >
235
+ {refer_is_use && refer_length > 0 && (
236
+ <SeoAdditionalLink
237
+ type={'더보기'}
238
+ linkList={referenceLinkList.filter(
239
+ i =>
240
+ i.tag_idx === h3Template.idx
241
+ )}
242
+ />
243
+ )}
244
+ {news_is_use && news_length > 0 && (
245
+ <SeoAdditionalLink
246
+ type={'관련기사'}
247
+ linkList={newsLinkList.filter(
248
+ i =>
249
+ i.tag_idx === h3Template.idx
250
+ )}
251
+ />
252
+ )}
253
+ </span>
254
+ ) : (
255
+ <></>
256
+ )}
257
+ </React.Fragment>
258
+ );
259
+ })}
260
+ <span
261
+ className={
262
+ 'flex flex-col gap-[26px] ' +
263
+ //520px
264
+ 'max-2sm:gap-[16px]'
265
+ }
266
+ >
267
+ {h2Template.reference_is_use &&
268
+ referenceLinkList.length > 0 && (
269
+ <SeoAdditionalLink
270
+ type={'더보기'}
271
+ linkList={referenceLinkList.filter(
272
+ i => i.tag_idx === h2Template.idx
273
+ )}
274
+ />
275
+ )}
276
+ {h2Template.news_is_use && newsLinkList.length > 0 && (
277
+ <SeoAdditionalLink
278
+ type={'관련기사'}
279
+ linkList={newsLinkList.filter(
280
+ i => i.tag_idx === h2Template.idx
281
+ )}
282
+ />
283
+ )}
284
+ {shortsLinkList.length > 0 && (
285
+ <SeoYoutube
286
+ type={'shorts'}
287
+ linkList={shortsLinkList.filter(
288
+ i => i.tag_idx === h2Template.idx
289
+ )}
290
+ />
291
+ )}
292
+ {youtubeLinkList.length > 0 && (
293
+ <SeoYoutube
294
+ type={'youtube'}
295
+ linkList={youtubeLinkList.filter(
296
+ i => i.tag_idx === h2Template.idx
297
+ )}
298
+ />
299
+ )}
300
+ </span>
301
+ </section>
302
+ );
303
+ })}
304
+ </article>
305
+ {width >= 1280 ? (
306
+ <div className={'flex flex-col gap-[60px] lg:mt-[60px]'}>
307
+ <div className={'relative w-full '}>
308
+ <SeoStrength initialData={initialData} />
309
+ </div>
310
+ <SeoConsulting tel={tel} />
311
+ <LawInfoContentList
312
+ contentsList={contentsList}
313
+ className={''}
314
+ template={template}
315
+ />
316
+ </div>
317
+ ) : (
318
+ <></>
319
+ )}
320
+ </div>
321
+ </span>
322
+ <span
323
+ className={
324
+ 'relative mb-[30px] mt-[30px] w-[340px] shrink-0 ' +
325
+ //1500px
326
+ 'max-3xl:mt-[10px] max-3xl:w-[300px] ' +
327
+ //1280px
328
+ 'max-xl:mt-[50px] max-xl:w-full max-xl:pt-0'
329
+ }
330
+ >
331
+ <span
332
+ id={'fixSideBar'}
333
+ className={
334
+ 'top-[140px] flex w-[340px] flex-col gap-[50px] xl:sticky ' +
335
+ 'max-3xl:w-[300px] max-xl:w-full'
336
+ }
337
+ >
338
+ {template && width >= 1280 ? (
339
+ <PdfPrintCopyLink
340
+ fileName={template.filter(t => t.tag === 'h1')[0].tag_title}
341
+ printRef={printRef}
342
+ />
343
+ ) : null}
344
+ {fieldData ? <FieldCase fieldData={fieldData} /> : <></>}
345
+ {lawyerData ? <Lawyer lawyerData={lawyerData} /> : <></>}
346
+ </span>
347
+ </span>
348
+ </div>
349
+ <hr className={'mb-[2rem] hidden h-[1px] w-[100%] bg-gray-100 xl:block'} />
350
+ </div>
351
+ </div>
352
+ <div>
353
+ {width < 1280 ? (
354
+ <>
355
+ <div className="m-auto flex flex-col gap-[60px] max-4xl:w-[90%]">
356
+ <div className={'relative w-full lg:mb-20'}>
357
+ <SeoStrength initialData={initialData} />
358
+ </div>
359
+ <SeoConsulting tel={tel} />
360
+ <LawInfoContentList contentsList={contentsList} template={template} />
361
+ </div>
362
+ </>
363
+ ) : (
364
+ <></>
365
+ )}
366
+ {/*게시글 리스트*/}
367
+ <section
368
+ className={
369
+ 'm-auto mt-[3rem] w-[90%] max-w-screen-2xl xl:mt-0 ' +
370
+ //1280px
371
+ 'max-xl:pb-[10px] max-xl:pr-0 '
372
+ }
373
+ >
374
+ <PostNavigation
375
+ url={'/trend'}
376
+ postNav={pnData[0]}
377
+ preTxt={'이전글'}
378
+ nextTxt={'다음글'}
379
+ listTxt={'목록보기'}
380
+ />
381
+ <div className={'my-10 mt-20 w-[100%]'}></div>
382
+ </section>
383
+ </div>
384
+ </>
385
+ );
386
+ };
387
+
388
+ export default TrendDetail;
@@ -50,7 +50,7 @@ const TrendList = ({ trend, page, size, search, count, tel }) => {
50
50
  <PageTitleBox titleTxt={'판결분석/최신동향'} subTxt={<>
51
51
  분야별 전문성을 갖춘 법무법인(유한) 대륜의 <br /> 판결과 법적이슈에 대한 분석을 전해드립니다.
52
52
  </>} imgType={ImgTypes.TREND}/>
53
- <PageWrapper>
53
+ <PageWrapper className={'mb-[200px] max-md:mb-[100px]'}>
54
54
  <div className="sticky top-[100px] z-[45] mb-[20px] bg-white pb-[2px] pt-4 max-md:top-[60px]">
55
55
  <SearchBar label={'판결분석 검색창'} onChange={e => {
56
56
  setSearchInput(e.currentTarget.value);
@@ -115,7 +115,7 @@ const TrendList = ({ trend, page, size, search, count, tel }) => {
115
115
  <p className={'w-fit'}>검색 결과가 없습니다.</p>
116
116
  </div>)}
117
117
 
118
- <Pagination currentPage={page} totalPages={count / size} onPageChange={onChange}/>
118
+ <Pagination currentPage={page} totalPages={Math.ceil(count / size)} onPageChange={onChange}/>
119
119
  </PageWrapper>
120
120
  <ListBottomKeywd routeType={RouteType.SUCCESS} tel={tel}/>
121
121
  </>);
@@ -70,7 +70,7 @@ const TrendList = ({ trend, page, size, search, count, tel }: ITrendListProps) =
70
70
  }
71
71
  imgType={ImgTypes.TREND}
72
72
  />
73
- <PageWrapper>
73
+ <PageWrapper className={'mb-[200px] max-md:mb-[100px]'}>
74
74
  <div className="sticky top-[100px] z-[45] mb-[20px] bg-white pb-[2px] pt-4 max-md:top-[60px]">
75
75
  <SearchBar
76
76
  label={'판결분석 검색창'}
@@ -171,7 +171,7 @@ const TrendList = ({ trend, page, size, search, count, tel }: ITrendListProps) =
171
171
  </div>
172
172
  )}
173
173
 
174
- <Pagination currentPage={page} totalPages={count / size} onPageChange={onChange} />
174
+ <Pagination currentPage={page} totalPages={Math.ceil(count / size)} onPageChange={onChange} />
175
175
  </PageWrapper>
176
176
  <ListBottomKeywd routeType={RouteType.SUCCESS} tel={tel} />
177
177
  </>
@@ -30,3 +30,4 @@ export { default as BroadcastList } from './Broadcast/BroadcastList';
30
30
  export { default as BroadcastDetail } from './Broadcast/BroadcastDetail';
31
31
  export { default as SuccessList } from './Success/SuccessList';
32
32
  export { default as TrendList } from './Trend/TrendList';
33
+ export { default as TrendDetail } from './Trend/TrendDetail';
@@ -32,3 +32,4 @@ export { default as BroadcastList } from './Broadcast/BroadcastList';
32
32
  export { default as BroadcastDetail } from './Broadcast/BroadcastDetail';
33
33
  export { default as SuccessList } from './Success/SuccessList';
34
34
  export { default as TrendList } from './Trend/TrendList';
35
+ export { default as TrendDetail } from './Trend/TrendDetail';
@@ -32,3 +32,4 @@ export { default as BroadcastList } from './Broadcast/BroadcastList';
32
32
  export { default as BroadcastDetail } from './Broadcast/BroadcastDetail';
33
33
  export { default as SuccessList } from './Success/SuccessList';
34
34
  export { default as TrendList } from './Trend/TrendList';
35
+ export { default as TrendDetail } from './Trend/TrendDetail';
@@ -4,12 +4,12 @@ interface IPostNav {
4
4
  idx?: number;
5
5
  is_template?: boolean;
6
6
  keyword?: string;
7
- next_idx: number;
7
+ next_idx: number | null;
8
8
  next_template?: boolean;
9
- next_title: string;
10
- pre_idx: number;
9
+ next_title: string | null;
10
+ pre_idx: number | null;
11
11
  pre_template?: boolean;
12
- pre_title: string;
12
+ pre_title: string | null;
13
13
  }
14
14
  interface PostNavigationProps {
15
15
  url: string;
@@ -8,13 +8,13 @@ interface IPostNav {
8
8
  is_template?: boolean;
9
9
  keyword?: string;
10
10
 
11
- next_idx: number;
11
+ next_idx: number | null;
12
12
  next_template?: boolean;
13
- next_title: string;
13
+ next_title: string | null;
14
14
 
15
- pre_idx: number;
15
+ pre_idx: number | null;
16
16
  pre_template?: boolean;
17
- pre_title: string;
17
+ pre_title: string | null;
18
18
  }
19
19
 
20
20
  interface PostNavigationProps {
@@ -1673,6 +1673,10 @@ html {
1673
1673
  margin-bottom: 1px;
1674
1674
  }
1675
1675
 
1676
+ .mb-\[200px\] {
1677
+ margin-bottom: 200px;
1678
+ }
1679
+
1676
1680
  .mb-\[20px\] {
1677
1681
  margin-bottom: 20px;
1678
1682
  }
@@ -1701,6 +1705,10 @@ html {
1701
1705
  margin-bottom: 2em;
1702
1706
  }
1703
1707
 
1708
+ .mb-\[2rem\] {
1709
+ margin-bottom: 2rem;
1710
+ }
1711
+
1704
1712
  .mb-\[3\.5em\] {
1705
1713
  margin-bottom: 3.5em;
1706
1714
  }
@@ -2157,6 +2165,10 @@ html {
2157
2165
  margin-top: 3em;
2158
2166
  }
2159
2167
 
2168
+ .mt-\[3rem\] {
2169
+ margin-top: 3rem;
2170
+ }
2171
+
2160
2172
  .mt-\[40px\] {
2161
2173
  margin-top: 40px;
2162
2174
  }
@@ -8211,6 +8223,10 @@ html {
8211
8223
  text-transform: uppercase;
8212
8224
  }
8213
8225
 
8226
+ .\!leading-\[1\.3\] {
8227
+ line-height: 1.3 !important;
8228
+ }
8229
+
8214
8230
  .\!leading-none {
8215
8231
  line-height: 1 !important;
8216
8232
  }
@@ -13642,6 +13658,10 @@ body {
13642
13658
  padding-left: 80px;
13643
13659
  }
13644
13660
 
13661
+ .max-xl\:pr-0 {
13662
+ padding-right: 0px;
13663
+ }
13664
+
13645
13665
  .max-xl\:pr-\[140px\] {
13646
13666
  padding-right: 140px;
13647
13667
  }
@@ -15985,6 +16005,10 @@ body {
15985
16005
  margin-bottom: 1.75rem;
15986
16006
  }
15987
16007
 
16008
+ .max-md\:mb-\[100px\] {
16009
+ margin-bottom: 100px;
16010
+ }
16011
+
15988
16012
  .max-md\:mb-\[10px\] {
15989
16013
  margin-bottom: 10px;
15990
16014
  }
@@ -23041,6 +23065,10 @@ body {
23041
23065
  margin-left: auto;
23042
23066
  }
23043
23067
 
23068
+ .xl\:mt-0 {
23069
+ margin-top: 0px;
23070
+ }
23071
+
23044
23072
  .xl\:mt-7 {
23045
23073
  margin-top: 1.75rem;
23046
23074
  }
@@ -23049,6 +23077,10 @@ body {
23049
23077
  margin-top: 80px;
23050
23078
  }
23051
23079
 
23080
+ .xl\:block {
23081
+ display: block;
23082
+ }
23083
+
23052
23084
  .xl\:hidden {
23053
23085
  display: none;
23054
23086
  }