@daeryun/dr_components 0.8.24 → 0.8.25

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,306 @@
1
+ 'use client';
2
+ import ContentList from '../SuccessNew/components/ContentList';
3
+ import { useEffect, useRef, useState } from 'react';
4
+ import useBrowser from '../../hook/useBrowser';
5
+ import { IFieldTypes, ILawyerTypes } from '../SuccessNew/SuccessNewType';
6
+ import { htmlUrlDecode } from '../../../lib';
7
+ import H2Contents from '../SuccessNew/components/H2Contents';
8
+ import H3Contents from '../SuccessNew/components/H3Contents';
9
+ import SeoAdditionalLink from '../SuccessNew/components/SeoAdditionalLink';
10
+ import PdfPrintCopyLink from '../../PdfPrintCopyLink/PdfPrintCopyLink';
11
+ import SeoYoutube from '../../Seo/SeoYoutube';
12
+ import SeoStrength from '../../Seo/SeoStrength';
13
+ import SeoConsulting from '../../Seo/SeoConsulting';
14
+ import { Lawyer } from '../../Seo/Lawyer';
15
+ import LawInfoContentList from '../SuccessNew/components/LawInfoContentList';
16
+ import { SuccessCase } from '../SuccessNew/components/SuccessCase';
17
+ import { FieldCase } from '../SuccessNew/components/FieldCase';
18
+ import { IFieldNewPageTypes } from './FieldNewTypes';
19
+ const FieldNew = ({ data, tel }: IFieldNewPageTypes) => {
20
+ const {
21
+ template,
22
+ contentsList,
23
+ h2List,
24
+ lawyerData,
25
+ fieldData,
26
+ successData,
27
+ groupTopTenLawyerList,
28
+ referenceLinkList,
29
+ newsLinkList,
30
+ shortsLinkList,
31
+ youtubeLinkList,
32
+ initialData
33
+ } = data;
34
+ const { width } = useBrowser(true);
35
+ const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState<ILawyerTypes[]>(lawyerData);
36
+ const [isFaqActive, setIsFaqActive] = useState<boolean>(false);
37
+ const printRef = useRef<HTMLDivElement>(null);
38
+ const idxNum: number | null = template && (template[0].type_idx as number);
39
+ const filteredFieldDataList: IFieldTypes[] = fieldData.filter(data => data.idx !== idxNum);
40
+ const h1Title: string = template
41
+ .map(temp => temp.tag === 'h1' && temp.tag_title)
42
+ .filter(temp => temp !== false)
43
+ .toString();
44
+ const h1Description: string = template
45
+ .map(temp => temp.tag === 'h1' && temp.description)
46
+ .filter(temp => temp !== false)
47
+ .toString();
48
+
49
+ const handleScrollToElement = (idx: number) => {
50
+ if (typeof window != 'undefined') {
51
+ const element = document.getElementById(idx.toString());
52
+ if (element) {
53
+ const topOffset = element.getBoundingClientRect().top;
54
+ window.scrollTo({
55
+ top: window.scrollY + topOffset - 130,
56
+ behavior: 'smooth'
57
+ });
58
+ }
59
+ }
60
+ };
61
+
62
+ // 변호사 6명 맞추기
63
+ useEffect(() => {
64
+ const originLawyerLength = lawyerData.length;
65
+ const maxCount = 6; // 최대 변호사 수
66
+ const sliceCount = maxCount - originLawyerLength;
67
+
68
+ if (originLawyerLength < maxCount) {
69
+ // 중복되지 않은 변호사 리스트 생성
70
+ const additionalLawyers = groupTopTenLawyerList
71
+ .filter(topLawyer => !lawyerData.some(lawyer => lawyer.lawyer_name === topLawyer.lawyer_name))
72
+ .slice(0, sliceCount);
73
+
74
+ // 변호사 리스트 업데이트 (중복 방지)
75
+ setRelatedCaseLawyerList([...lawyerData, ...additionalLawyers]);
76
+ } else {
77
+ // 변호사 수가 충분하면 최대 6명만 설정
78
+ setRelatedCaseLawyerList(lawyerData.slice(0, maxCount));
79
+ }
80
+ }, [lawyerData, groupTopTenLawyerList]);
81
+
82
+ useEffect(() => {
83
+ if (template) {
84
+ // 초기화
85
+ setIsFaqActive(false);
86
+
87
+ for (const data of template) {
88
+ // console.log("faq 활성화: ", data['active_faq']);
89
+ if (data['active_faq']) {
90
+ setIsFaqActive(true);
91
+ }
92
+ }
93
+ }
94
+ }, [template]);
95
+
96
+ return (
97
+ <>
98
+ <div
99
+ itemScope={isFaqActive ? undefined : true}
100
+ itemType={isFaqActive ? undefined : 'https://schema.org/FAQPage'}
101
+ ref={printRef}
102
+ >
103
+ <div id={'sub_contents'} ref={printRef}>
104
+ <div className="relative m-auto mb-[100px] w-[90%] max-w-screen-2xl font-[SUIT] max-xs:mb-[30px] ">
105
+ <div
106
+ className={
107
+ 'm-auto mt-[100px] flex gap-[120px] ' +
108
+ //1700px
109
+ 'max-5xl:gap-[80px] ' +
110
+ //1500px
111
+ 'max-3xl:gap-10 ' +
112
+ //1280px
113
+ 'max-xl:mt-0 max-xl:flex-col max-xl:gap-0 ' +
114
+ //600px
115
+ 'max-sm:mt-[10px] '
116
+ }
117
+ >
118
+ <div>
119
+ {template && width < 1280 ? (
120
+ <PdfPrintCopyLink
121
+ fileName={template.filter(t => t.tag === 'h1')[0].tag_title}
122
+ printRef={printRef}
123
+ />
124
+ ) : null}
125
+ <div className={'max-xl:mt-[25px] max-xs:mt-[15px]'}>
126
+ {/* h1 제목 */}
127
+ <h1
128
+ className={
129
+ 'text-[52.5px] font-[800] tracking-[-2.1px] text-[#285FA7] max-3xl:text-5xl max-md:text-4xl max-xs:text-[28px]'
130
+ }
131
+ >
132
+ {h1Title}
133
+ </h1>
134
+
135
+ {/* h1 설명글 */}
136
+ <div
137
+ className={
138
+ 'mb-[54px] mt-[16px] whitespace-break-spaces text-[16px] font-normal tracking-[-0.96px] xs:text-[18px] sm:mb-[62px] sm:mt-[26px] sm:text-[20px] lg:mb-[75px] lg:mt-[37.5px] lg:text-[24px]'
139
+ }
140
+ >
141
+ <div
142
+ id={'ck-content'}
143
+ dangerouslySetInnerHTML={{
144
+ __html: htmlUrlDecode(
145
+ h1Description.replace('../../UploadFile', '/SE2/upload') as string
146
+ )
147
+ }}
148
+ />
149
+ </div>
150
+ </div>
151
+
152
+ <article>
153
+ {/*목차*/}
154
+ <ContentList
155
+ template={template}
156
+ h2List={h2List ? h2List : []}
157
+ onScrollToElement={handleScrollToElement}
158
+ />
159
+
160
+ {/*h2*/}
161
+ {h2List &&
162
+ h2List.map((h2Template, index) => {
163
+ return (
164
+ <section
165
+ className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'}
166
+ key={'h2영역' + h2Template.idx}
167
+ >
168
+ <H2Contents h2Template={h2Template} index={index} />
169
+ {/*h3*/}
170
+ {template
171
+ .filter(t => t.parent === h2Template.idx)
172
+ .map((h3Template, h3Index) => {
173
+ return (
174
+ <H3Contents
175
+ h3Template={h3Template}
176
+ key={'h3영역' + h3Template.idx}
177
+ />
178
+ );
179
+ })}
180
+ <span
181
+ className={
182
+ 'flex flex-col gap-[26px] ' +
183
+ //520px
184
+ 'max-2sm:gap-[16px]'
185
+ }
186
+ >
187
+ {h2Template.reference_is_use &&
188
+ referenceLinkList.length > 0 && (
189
+ <SeoAdditionalLink
190
+ type={'참고'}
191
+ linkList={referenceLinkList.filter(
192
+ i => i.tag_idx === h2Template.idx
193
+ )}
194
+ />
195
+ )}
196
+ {h2Template.news_is_use && newsLinkList.length > 0 && (
197
+ <SeoAdditionalLink
198
+ type={'관련기사'}
199
+ linkList={newsLinkList.filter(
200
+ i => i.tag_idx === h2Template.idx
201
+ )}
202
+ />
203
+ )}
204
+ {h2Template.youtube_is_use && (
205
+ <>
206
+ {shortsLinkList.length > 0 && (
207
+ <SeoYoutube
208
+ type={'shorts'}
209
+ linkList={shortsLinkList.filter(
210
+ i => i.tag_idx === h2Template.idx
211
+ )}
212
+ />
213
+ )}
214
+ {youtubeLinkList.length > 0 && (
215
+ <SeoYoutube
216
+ type={'youtube'}
217
+ linkList={youtubeLinkList.filter(
218
+ i => i.tag_idx === h2Template.idx
219
+ )}
220
+ />
221
+ )}
222
+ </>
223
+ )}
224
+ </span>
225
+ </section>
226
+ );
227
+ })}
228
+ </article>
229
+ {width >= 1280 ? (
230
+ <div className={'flex flex-col gap-[60px] lg:mt-[60px]'}>
231
+ <div className={'relative w-full '}>
232
+ <SeoStrength initialData={initialData} />
233
+ </div>
234
+
235
+ <SeoConsulting tel={tel} />
236
+
237
+ <LawInfoContentList
238
+ contentsList={contentsList}
239
+ template={template}
240
+ className={''}
241
+ />
242
+ </div>
243
+ ) : (
244
+ <></>
245
+ )}
246
+ </div>
247
+
248
+ {(filteredFieldDataList.length > 0 ||
249
+ relatedCaseLawyerList.length > 0 ||
250
+ successData.length > 0) && (
251
+ <span
252
+ className={
253
+ 'relative mb-[30px] mt-[30px] w-[340px] shrink-0 ' +
254
+ //1500px
255
+ 'max-3xl:mt-[10px] max-3xl:w-[300px] ' +
256
+ //1280px
257
+ 'max-xl:mt-[50px] max-xl:w-full max-xl:pt-0'
258
+ }
259
+ >
260
+ <span
261
+ id={'fixSideBar'}
262
+ className={
263
+ 'top-[140px] flex w-[340px] flex-col gap-[50px] xl:sticky ' +
264
+ 'max-3xl:w-[300px] max-xl:w-full'
265
+ }
266
+ >
267
+ {template && width >= 1280 ? (
268
+ <PdfPrintCopyLink
269
+ fileName={template.filter(t => t.tag === 'h1')[0].tag_title}
270
+ printRef={printRef}
271
+ />
272
+ ) : null}
273
+ {successData.length > 0 && <SuccessCase successData={successData} />}
274
+ {fieldData.length > 0 && <FieldCase fieldData={fieldData} />}
275
+ {relatedCaseLawyerList.length > 0 && (
276
+ <Lawyer lawyerData={relatedCaseLawyerList} />
277
+ )}
278
+ </span>
279
+ </span>
280
+ )}
281
+ </div>
282
+ </div>
283
+ <div className="m-auto mt-[7em] max-w-screen-2xl max-md2:mt-[0] max-xs:mb-[30px] lg:mt-[5em] ">
284
+ {width < 1280 ? (
285
+ <>
286
+ <div className="m-auto flex flex-col gap-[60px] max-4xl:w-[90%]">
287
+ <div className={'relative w-full lg:mb-20'}>
288
+ <SeoStrength initialData={initialData} />
289
+ </div>
290
+
291
+ <SeoConsulting tel={tel} />
292
+
293
+ <LawInfoContentList contentsList={contentsList} template={template} />
294
+ </div>
295
+ </>
296
+ ) : (
297
+ <></>
298
+ )}
299
+ </div>
300
+ </div>
301
+ </div>
302
+ </>
303
+ );
304
+ };
305
+
306
+ export default FieldNew;
@@ -0,0 +1,22 @@
1
+ import { IInitialDataTypes } from '../../common';
2
+ import { ISeoTemplateTypes, IContentsListTypes, IImgsTypes, ILawyerTypes, IFieldTypes, ICanonicalTypes, IAddLinkTypes, ISuccessTypes } from '../SuccessNew/SuccessNewType';
3
+ export interface IFieldNewPageTypes {
4
+ data: IFieldNewTypes;
5
+ tel: string;
6
+ }
7
+ export interface IFieldNewTypes {
8
+ template: ISeoTemplateTypes[];
9
+ contentsList: IContentsListTypes[] | null;
10
+ imgData: IImgsTypes[] | null;
11
+ h2List: ISeoTemplateTypes[] | null;
12
+ lawyerData: ILawyerTypes[];
13
+ fieldData: IFieldTypes[];
14
+ successData: ISuccessTypes[];
15
+ canonicalUrl: ICanonicalTypes[];
16
+ groupTopTenLawyerList: ILawyerTypes[];
17
+ referenceLinkList: IAddLinkTypes[];
18
+ newsLinkList: IAddLinkTypes[];
19
+ shortsLinkList: IAddLinkTypes[];
20
+ youtubeLinkList: IAddLinkTypes[];
21
+ initialData: IInitialDataTypes;
22
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ import { IInitialDataTypes } from '../../common';
2
+ import {
3
+ ISeoTemplateTypes,
4
+ IContentsListTypes,
5
+ IImgsTypes,
6
+ ILawyerTypes,
7
+ IFieldTypes,
8
+ ICanonicalTypes,
9
+ IAddLinkTypes,
10
+ ISuccessTypes
11
+ } from '../SuccessNew/SuccessNewType';
12
+
13
+ export interface IFieldNewPageTypes {
14
+ data: IFieldNewTypes;
15
+ tel: string;
16
+ }
17
+ export interface IFieldNewTypes {
18
+ template: ISeoTemplateTypes[];
19
+ contentsList: IContentsListTypes[] | null;
20
+ imgData: IImgsTypes[] | null;
21
+ h2List: ISeoTemplateTypes[] | null;
22
+ lawyerData: ILawyerTypes[];
23
+ fieldData: IFieldTypes[];
24
+ successData: ISuccessTypes[];
25
+ canonicalUrl: ICanonicalTypes[];
26
+ groupTopTenLawyerList: ILawyerTypes[];
27
+ referenceLinkList: IAddLinkTypes[];
28
+ newsLinkList: IAddLinkTypes[];
29
+ shortsLinkList: IAddLinkTypes[];
30
+ youtubeLinkList: IAddLinkTypes[];
31
+ initialData: IInitialDataTypes;
32
+ }
@@ -88,7 +88,10 @@ const SuccessNew = ({ data, tel }) => {
88
88
  return (<div itemScope={isFaqActive ? undefined : true} itemType={isFaqActive ? undefined : 'https://schema.org/FAQPage'} ref={printRef}>
89
89
  <div className="relative m-auto mb-[100px] w-[90%] max-w-screen-2xl font-[SUIT] max-xs:mb-[30px]">
90
90
  <div className={'m-auto mt-[100px] flex gap-[120px] ' +
91
- 'max-5xl:gap-[80px] max-3xl:gap-10 ' +
91
+ //1700px
92
+ 'max-5xl:gap-[80px] ' +
93
+ //1500px
94
+ 'max-3xl:gap-10 ' +
92
95
  //1280px
93
96
  'max-xl:mt-0 max-xl:flex-col max-xl:gap-0 ' +
94
97
  //600px
@@ -122,7 +122,10 @@ const SuccessNew = ({ data, tel }: ISuccessNewPageTypes) => {
122
122
  <div
123
123
  className={
124
124
  'm-auto mt-[100px] flex gap-[120px] ' +
125
- 'max-5xl:gap-[80px] max-3xl:gap-10 ' +
125
+ //1700px
126
+ 'max-5xl:gap-[80px] ' +
127
+ //1500px
128
+ 'max-3xl:gap-10 ' +
126
129
  //1280px
127
130
  'max-xl:mt-0 max-xl:flex-col max-xl:gap-0 ' +
128
131
  //600px
@@ -2136,6 +2136,10 @@ video {
2136
2136
  display: flex;
2137
2137
  }
2138
2138
 
2139
+ .table {
2140
+ display: table;
2141
+ }
2142
+
2139
2143
  .\!grid {
2140
2144
  display: grid !important;
2141
2145
  }
@@ -16661,6 +16665,10 @@ body {
16661
16665
  margin-bottom: 0px;
16662
16666
  }
16663
16667
 
16668
+ .lg\:mb-20 {
16669
+ margin-bottom: 5rem;
16670
+ }
16671
+
16664
16672
  .lg\:mb-\[10em\] {
16665
16673
  margin-bottom: 10em;
16666
16674
  }