@daeryun/dr_components 0.8.51 → 0.8.53
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/Daeryuntalk/ChatButton.jsx +25 -2
- package/dist/components/Daeryuntalk/ChatButton.tsx +29 -3
- package/dist/components/Daeryuntalk/ChatHomeView.jsx +0 -1
- package/dist/components/Daeryuntalk/ChatHomeView.tsx +0 -1
- package/dist/components/Daeryuntalk/ChatWidget.jsx +5 -3
- package/dist/components/Daeryuntalk/ChatWidget.tsx +5 -2
- package/dist/components/Daeryuntalk/HomeView.jsx +1 -1
- package/dist/components/Daeryuntalk/HomeView.tsx +1 -1
- package/dist/components/Daeryuntalk/Tiptap/Tiptap.jsx +1 -1
- package/dist/components/Daeryuntalk/Tiptap/Tiptap.tsx +1 -1
- package/dist/components/page/FieldNew/FieldNewView.d.ts +3 -0
- package/dist/components/page/FieldNew/FieldNewView.jsx +170 -0
- package/dist/components/page/FieldNew/FieldNewView.tsx +304 -0
- package/dist/components/page/FieldNew/FieldWrapper.d.ts +8 -0
- package/dist/components/page/FieldNew/FieldWrapper.jsx +30 -0
- package/dist/components/page/FieldNew/FieldWrapper.tsx +36 -0
- package/dist/components/page/LawInfoNew/LawInfoNewView.d.ts +3 -0
- package/dist/components/page/LawInfoNew/LawInfoNewView.jsx +197 -0
- package/dist/components/page/LawInfoNew/LawInfoNewView.tsx +394 -0
- package/dist/components/page/LawInfoNew/LawInfoWrapper.d.ts +8 -0
- package/dist/components/page/LawInfoNew/LawInfoWrapper.jsx +30 -0
- package/dist/components/page/LawInfoNew/LawInfoWrapper.tsx +36 -0
- package/dist/components/page/SuccessNew/components/SuccessWrapper.jsx +3 -4
- package/dist/components/page/SuccessNew/components/SuccessWrapper.tsx +3 -4
- package/dist/styles/globals.css +25 -9
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,304 @@
|
|
|
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
|
+
import FieldWrapper from './FieldWrapper';
|
|
20
|
+
|
|
21
|
+
const FieldNewView = ({ data, tel }: IFieldNewPageTypes) => {
|
|
22
|
+
const {
|
|
23
|
+
template,
|
|
24
|
+
contentsList,
|
|
25
|
+
h2List,
|
|
26
|
+
lawyerData,
|
|
27
|
+
fieldData,
|
|
28
|
+
successData,
|
|
29
|
+
groupTopTenLawyerList,
|
|
30
|
+
referenceLinkList,
|
|
31
|
+
newsLinkList,
|
|
32
|
+
shortsLinkList,
|
|
33
|
+
youtubeLinkList,
|
|
34
|
+
initialData
|
|
35
|
+
} = data;
|
|
36
|
+
const { width } = useBrowser(true);
|
|
37
|
+
const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState<ILawyerTypes[]>(lawyerData);
|
|
38
|
+
const [isFaqActive, setIsFaqActive] = useState<boolean>(false);
|
|
39
|
+
const printRef = useRef<HTMLDivElement>(null);
|
|
40
|
+
const idxNum: number | null = template && (template[0].type_idx as number);
|
|
41
|
+
const filteredFieldDataList: IFieldTypes[] = fieldData.filter(data => data.idx !== idxNum);
|
|
42
|
+
const h1Title: string = template
|
|
43
|
+
.map(temp => temp.tag === 'h1' && temp.tag_title)
|
|
44
|
+
.filter(temp => temp !== false)
|
|
45
|
+
.toString();
|
|
46
|
+
const h1Description: string = template
|
|
47
|
+
.map(temp => temp.tag === 'h1' && temp.description)
|
|
48
|
+
.filter(temp => temp !== false)
|
|
49
|
+
.toString();
|
|
50
|
+
|
|
51
|
+
const handleScrollToElement = (idx: number) => {
|
|
52
|
+
if (typeof window != 'undefined') {
|
|
53
|
+
const element = document.getElementById(idx.toString());
|
|
54
|
+
if (element) {
|
|
55
|
+
const topOffset = element.getBoundingClientRect().top;
|
|
56
|
+
window.scrollTo({
|
|
57
|
+
top: window.scrollY + topOffset - 130,
|
|
58
|
+
behavior: 'smooth'
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// 변호사 6명 맞추기
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
const originLawyerLength = lawyerData.length;
|
|
67
|
+
const maxCount = 6; // 최대 변호사 수
|
|
68
|
+
const sliceCount = maxCount - originLawyerLength;
|
|
69
|
+
|
|
70
|
+
if (originLawyerLength < maxCount) {
|
|
71
|
+
// 중복되지 않은 변호사 리스트 생성
|
|
72
|
+
const additionalLawyers = groupTopTenLawyerList
|
|
73
|
+
.filter(topLawyer => !lawyerData.some(lawyer => lawyer.lawyer_name === topLawyer.lawyer_name))
|
|
74
|
+
.slice(0, sliceCount);
|
|
75
|
+
|
|
76
|
+
// 변호사 리스트 업데이트 (중복 방지)
|
|
77
|
+
setRelatedCaseLawyerList([...lawyerData, ...additionalLawyers]);
|
|
78
|
+
} else {
|
|
79
|
+
// 변호사 수가 충분하면 최대 6명만 설정
|
|
80
|
+
setRelatedCaseLawyerList(lawyerData.slice(0, maxCount));
|
|
81
|
+
}
|
|
82
|
+
}, [lawyerData, groupTopTenLawyerList]);
|
|
83
|
+
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (template) {
|
|
86
|
+
// 초기화
|
|
87
|
+
setIsFaqActive(false);
|
|
88
|
+
|
|
89
|
+
for (const data of template) {
|
|
90
|
+
// console.log("faq 활성화: ", data['active_faq']);
|
|
91
|
+
if (data['active_faq']) {
|
|
92
|
+
setIsFaqActive(true);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}, [template]);
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<>
|
|
100
|
+
<div id={'sub_contents'}>
|
|
101
|
+
<FieldWrapper className="relative m-auto mb-[100px] mt-[7em] w-[90%] font-[SUIT] max-sm:mt-[70px] max-xs:mb-[30px] lg:mt-[5em]">
|
|
102
|
+
<div
|
|
103
|
+
className={
|
|
104
|
+
'm-auto mt-[3em] flex gap-[120px] ' +
|
|
105
|
+
//1700px
|
|
106
|
+
'max-5xl:gap-[80px] ' +
|
|
107
|
+
//1500px
|
|
108
|
+
'max-3xl:gap-10 ' +
|
|
109
|
+
'max-xl:flex-col max-xl:gap-0 lg:mt-[5em]'
|
|
110
|
+
}
|
|
111
|
+
>
|
|
112
|
+
<div>
|
|
113
|
+
{/* h1 제목 */}
|
|
114
|
+
<h1
|
|
115
|
+
className={
|
|
116
|
+
'text-[52.5px] font-[800] tracking-[-2.1px] text-[#285FA7] max-3xl:text-5xl max-md:text-4xl max-xs:text-[28px]'
|
|
117
|
+
}
|
|
118
|
+
>
|
|
119
|
+
{h1Title}
|
|
120
|
+
</h1>
|
|
121
|
+
|
|
122
|
+
{/* h1 설명글 */}
|
|
123
|
+
<div
|
|
124
|
+
className={
|
|
125
|
+
'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]'
|
|
126
|
+
}
|
|
127
|
+
>
|
|
128
|
+
<div
|
|
129
|
+
id={'ck-content'}
|
|
130
|
+
dangerouslySetInnerHTML={{
|
|
131
|
+
__html: htmlUrlDecode(
|
|
132
|
+
h1Description.replace('../../UploadFile', '/SE2/upload') as string
|
|
133
|
+
)
|
|
134
|
+
}}
|
|
135
|
+
/>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<article>
|
|
139
|
+
{/* 목차 */}
|
|
140
|
+
<ContentList
|
|
141
|
+
template={template}
|
|
142
|
+
h2List={h2List || []}
|
|
143
|
+
onScrollToElement={handleScrollToElement}
|
|
144
|
+
/>
|
|
145
|
+
|
|
146
|
+
{/* h2 */}
|
|
147
|
+
{h2List?.map((h2Template, index) => (
|
|
148
|
+
<section
|
|
149
|
+
className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'}
|
|
150
|
+
key={'h2영역' + h2Template.idx}
|
|
151
|
+
>
|
|
152
|
+
<H2Contents h2Template={h2Template} index={index} />
|
|
153
|
+
{/* h3 */}
|
|
154
|
+
{template
|
|
155
|
+
.filter(t => t.parent === h2Template.idx)
|
|
156
|
+
.map((h3Template, h3Index) => {
|
|
157
|
+
return (
|
|
158
|
+
<>
|
|
159
|
+
<H3Contents
|
|
160
|
+
h3Template={h3Template}
|
|
161
|
+
key={'h3영역' + h3Template.idx}
|
|
162
|
+
/>
|
|
163
|
+
{(h3Template.reference_is_use &&
|
|
164
|
+
referenceLinkList.length > 0) ||
|
|
165
|
+
(h3Template.news_is_use && newsLinkList.length > 0) ? (
|
|
166
|
+
<span
|
|
167
|
+
className={
|
|
168
|
+
'mb-[44px] flex flex-col gap-[26px] px-[10px] sm:mx-[33px] sm:mb-[50px] sm:px-[18px] lg:mb-[78px] ' +
|
|
169
|
+
//520px
|
|
170
|
+
'max-2sm:gap-[16px]'
|
|
171
|
+
}
|
|
172
|
+
>
|
|
173
|
+
{h3Template.reference_is_use &&
|
|
174
|
+
referenceLinkList.length > 0 && (
|
|
175
|
+
<SeoAdditionalLink
|
|
176
|
+
type={'더보기'}
|
|
177
|
+
linkList={referenceLinkList.filter(
|
|
178
|
+
i => i.tag_idx === h3Template.idx
|
|
179
|
+
)}
|
|
180
|
+
/>
|
|
181
|
+
)}
|
|
182
|
+
{h3Template.news_is_use && newsLinkList.length > 0 && (
|
|
183
|
+
<SeoAdditionalLink
|
|
184
|
+
type={'관련기사'}
|
|
185
|
+
linkList={newsLinkList.filter(
|
|
186
|
+
i => i.tag_idx === h3Template.idx
|
|
187
|
+
)}
|
|
188
|
+
/>
|
|
189
|
+
)}
|
|
190
|
+
</span>
|
|
191
|
+
) : (
|
|
192
|
+
<></>
|
|
193
|
+
)}
|
|
194
|
+
</>
|
|
195
|
+
);
|
|
196
|
+
})}
|
|
197
|
+
<span
|
|
198
|
+
className={
|
|
199
|
+
'flex flex-col gap-[26px] ' +
|
|
200
|
+
// 520px
|
|
201
|
+
'max-2sm:gap-[16px]'
|
|
202
|
+
}
|
|
203
|
+
>
|
|
204
|
+
{h2Template.reference_is_use && referenceLinkList.length > 0 && (
|
|
205
|
+
<SeoAdditionalLink
|
|
206
|
+
type={'더보기'}
|
|
207
|
+
linkList={referenceLinkList.filter(
|
|
208
|
+
i => i.tag_idx === h2Template.idx
|
|
209
|
+
)}
|
|
210
|
+
/>
|
|
211
|
+
)}
|
|
212
|
+
{h2Template.news_is_use && newsLinkList.length > 0 && (
|
|
213
|
+
<SeoAdditionalLink
|
|
214
|
+
type={'관련기사'}
|
|
215
|
+
linkList={newsLinkList.filter(i => i.tag_idx === h2Template.idx)}
|
|
216
|
+
/>
|
|
217
|
+
)}
|
|
218
|
+
{h2Template.youtube_is_use && (
|
|
219
|
+
<>
|
|
220
|
+
{shortsLinkList.length > 0 && (
|
|
221
|
+
<SeoYoutube
|
|
222
|
+
type={'shorts'}
|
|
223
|
+
linkList={shortsLinkList.filter(
|
|
224
|
+
i => i.tag_idx === h2Template.idx
|
|
225
|
+
)}
|
|
226
|
+
/>
|
|
227
|
+
)}
|
|
228
|
+
{youtubeLinkList.length > 0 && (
|
|
229
|
+
<SeoYoutube
|
|
230
|
+
type={'youtube'}
|
|
231
|
+
linkList={youtubeLinkList.filter(
|
|
232
|
+
i => i.tag_idx === h2Template.idx
|
|
233
|
+
)}
|
|
234
|
+
/>
|
|
235
|
+
)}
|
|
236
|
+
</>
|
|
237
|
+
)}
|
|
238
|
+
</span>
|
|
239
|
+
</section>
|
|
240
|
+
))}
|
|
241
|
+
</article>
|
|
242
|
+
{width >= 1280 ? (
|
|
243
|
+
<div className={'flex flex-col gap-[60px] lg:mt-[60px]'}>
|
|
244
|
+
<div className={'relative w-full'}>
|
|
245
|
+
<SeoStrength initialData={initialData} />
|
|
246
|
+
</div>
|
|
247
|
+
<SeoConsulting tel={tel} />
|
|
248
|
+
<LawInfoContentList
|
|
249
|
+
contentsList={contentsList}
|
|
250
|
+
template={template}
|
|
251
|
+
className={''}
|
|
252
|
+
/>
|
|
253
|
+
</div>
|
|
254
|
+
) : (
|
|
255
|
+
<></>
|
|
256
|
+
)}
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
{(filteredFieldDataList.length > 0 ||
|
|
260
|
+
relatedCaseLawyerList.length > 0 ||
|
|
261
|
+
successData.length > 0) && (
|
|
262
|
+
<span
|
|
263
|
+
className={
|
|
264
|
+
'relative mb-[30px] mt-[170px] w-[340px] shrink-0 ' +
|
|
265
|
+
// 1500px
|
|
266
|
+
'max-3xl:mt-[150px] max-3xl:w-[300px] ' +
|
|
267
|
+
// 1280px
|
|
268
|
+
'max-xl:mt-[50px] max-xl:w-full max-xl:pt-0'
|
|
269
|
+
}
|
|
270
|
+
>
|
|
271
|
+
<span
|
|
272
|
+
id={'fixSideBar'}
|
|
273
|
+
className={
|
|
274
|
+
'top-[140px] flex w-[340px] flex-col gap-[50px] xl:sticky ' +
|
|
275
|
+
'max-3xl:w-[300px] max-xl:w-full'
|
|
276
|
+
}
|
|
277
|
+
>
|
|
278
|
+
{successData.length > 0 && <SuccessCase successData={successData} />}
|
|
279
|
+
{fieldData.length > 0 && <FieldCase fieldData={fieldData} />}
|
|
280
|
+
{relatedCaseLawyerList.length > 0 && <Lawyer lawyerData={relatedCaseLawyerList} />}
|
|
281
|
+
</span>
|
|
282
|
+
</span>
|
|
283
|
+
)}
|
|
284
|
+
</div>
|
|
285
|
+
</FieldWrapper>
|
|
286
|
+
<FieldWrapper className="m-auto mb-[100px] max-xs:mb-[60px] lg:mt-[5em]">
|
|
287
|
+
{width < 1280 ? (
|
|
288
|
+
<div className="m-auto flex flex-col gap-[60px] max-4xl:w-[90%]">
|
|
289
|
+
<div className={'relative w-full lg:mb-20'}>
|
|
290
|
+
<SeoStrength initialData={initialData} />
|
|
291
|
+
</div>
|
|
292
|
+
<SeoConsulting tel={tel} />
|
|
293
|
+
<LawInfoContentList contentsList={contentsList} template={template} />
|
|
294
|
+
</div>
|
|
295
|
+
) : (
|
|
296
|
+
<></>
|
|
297
|
+
)}
|
|
298
|
+
</FieldWrapper>
|
|
299
|
+
</div>
|
|
300
|
+
</>
|
|
301
|
+
);
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
export default FieldNewView;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
interface WrapperProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const FieldWrapper: React.ForwardRefExoticComponent<WrapperProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default FieldWrapper;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { forwardRef } from 'react';
|
|
13
|
+
const FieldWrapper = forwardRef((_a, ref) => {
|
|
14
|
+
var { children, className = '', id } = _a, others = __rest(_a, ["children", "className", "id"]);
|
|
15
|
+
return (<div id={id} className={'relative mx-auto w-full max-w-[1920px] px-[190px] ' +
|
|
16
|
+
'max-5xl:px-[100px] ' +
|
|
17
|
+
// 1500px
|
|
18
|
+
'max-3xl:px-[80px] ' +
|
|
19
|
+
// 1024px - dev Tablets
|
|
20
|
+
'max-lg:px-[60px] ' +
|
|
21
|
+
// 900px - design Tablets
|
|
22
|
+
'max-md2:px-[40px] ' +
|
|
23
|
+
// 520px - dev Mobile ( 320px - design Mobile )
|
|
24
|
+
'max-2sm:px-[20px] ' +
|
|
25
|
+
className} ref={ref} {...others}>
|
|
26
|
+
{children}
|
|
27
|
+
</div>);
|
|
28
|
+
});
|
|
29
|
+
FieldWrapper.displayName = 'FieldWrapper';
|
|
30
|
+
export default FieldWrapper;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { ReactNode, forwardRef } from 'react';
|
|
2
|
+
|
|
3
|
+
interface WrapperProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string; // 스타일 추가
|
|
6
|
+
id?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const FieldWrapper = forwardRef<HTMLDivElement, WrapperProps>(({ children, className = '', id, ...others }, ref) => {
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
id={id}
|
|
13
|
+
className={
|
|
14
|
+
'relative mx-auto w-full max-w-[1920px] px-[190px] ' +
|
|
15
|
+
'max-5xl:px-[100px] ' +
|
|
16
|
+
// 1500px
|
|
17
|
+
'max-3xl:px-[80px] ' +
|
|
18
|
+
// 1024px - dev Tablets
|
|
19
|
+
'max-lg:px-[60px] ' +
|
|
20
|
+
// 900px - design Tablets
|
|
21
|
+
'max-md2:px-[40px] ' +
|
|
22
|
+
// 520px - dev Mobile ( 320px - design Mobile )
|
|
23
|
+
'max-2sm:px-[20px] ' +
|
|
24
|
+
className
|
|
25
|
+
}
|
|
26
|
+
ref={ref}
|
|
27
|
+
{...others}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
FieldWrapper.displayName = 'FieldWrapper';
|
|
35
|
+
|
|
36
|
+
export default FieldWrapper;
|
|
@@ -0,0 +1,197 @@
|
|
|
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 { htmlUrlDecode } from '../../../lib';
|
|
6
|
+
import H2Contents from '../SuccessNew/components/H2Contents';
|
|
7
|
+
import H3Contents from '../SuccessNew/components/H3Contents';
|
|
8
|
+
import SeoAdditionalLink from '../SuccessNew/components/SeoAdditionalLink';
|
|
9
|
+
import PdfPrintCopyLink from '../../PdfPrintCopyLink/PdfPrintCopyLink';
|
|
10
|
+
import SeoYoutube from '../../Seo/SeoYoutube';
|
|
11
|
+
import SeoStrength from '../../Seo/SeoStrength';
|
|
12
|
+
import SeoConsulting from '../../Seo/SeoConsulting';
|
|
13
|
+
import { Lawyer } from '../../Seo/Lawyer';
|
|
14
|
+
import LawInfoContentList from '../SuccessNew/components/LawInfoContentList';
|
|
15
|
+
import { SuccessCase } from '../SuccessNew/components/SuccessCase';
|
|
16
|
+
import { FieldCase } from '../SuccessNew/components/FieldCase';
|
|
17
|
+
import Link from 'next/link';
|
|
18
|
+
import Image from 'next/image';
|
|
19
|
+
import Arrow from '../../../asset/images/success_new/left.webp';
|
|
20
|
+
import RightArrow from '../../../asset/images/success_new/right.webp';
|
|
21
|
+
import LawInfoWrapper from './LawInfoWrapper';
|
|
22
|
+
const LawInfoNewView = ({ data, tel }) => {
|
|
23
|
+
const { template, contentsList, h2List, lawyerData, fieldData, successData, groupTopTenLawyerList, referenceLinkList, newsLinkList, shortsLinkList, youtubeLinkList, initialData, nextPost, prevPost } = data;
|
|
24
|
+
const { width } = useBrowser(true);
|
|
25
|
+
const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState(lawyerData);
|
|
26
|
+
const [isFaqActive, setIsFaqActive] = useState(false);
|
|
27
|
+
const printRef = useRef(null);
|
|
28
|
+
const h1Title = template
|
|
29
|
+
.map(temp => temp.tag === 'h1' && temp.tag_title)
|
|
30
|
+
.filter(temp => temp !== false)
|
|
31
|
+
.toString();
|
|
32
|
+
const h1Description = template
|
|
33
|
+
.map(temp => temp.tag === 'h1' && temp.description)
|
|
34
|
+
.filter(temp => temp !== false)
|
|
35
|
+
.toString();
|
|
36
|
+
const handleScrollToElement = (idx) => {
|
|
37
|
+
if (typeof window != 'undefined') {
|
|
38
|
+
const element = document.getElementById(idx.toString());
|
|
39
|
+
if (element) {
|
|
40
|
+
const topOffset = element.getBoundingClientRect().top;
|
|
41
|
+
window.scrollTo({
|
|
42
|
+
top: window.scrollY + topOffset - 130,
|
|
43
|
+
behavior: 'smooth'
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
// 변호사 6명 맞추기
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const originLawyerLength = lawyerData.length;
|
|
51
|
+
const maxCount = 6; // 최대 변호사 수
|
|
52
|
+
const sliceCount = maxCount - originLawyerLength;
|
|
53
|
+
if (originLawyerLength < maxCount) {
|
|
54
|
+
// 중복되지 않은 변호사 리스트 생성
|
|
55
|
+
const additionalLawyers = groupTopTenLawyerList
|
|
56
|
+
.filter(topLawyer => !lawyerData.some(lawyer => lawyer.lawyer_name === topLawyer.lawyer_name))
|
|
57
|
+
.slice(0, sliceCount);
|
|
58
|
+
// 변호사 리스트 업데이트 (중복 방지)
|
|
59
|
+
setRelatedCaseLawyerList([...lawyerData, ...additionalLawyers]);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// 변호사 수가 충분하면 최대 6명만 설정
|
|
63
|
+
setRelatedCaseLawyerList(lawyerData.slice(0, maxCount));
|
|
64
|
+
}
|
|
65
|
+
}, [lawyerData, groupTopTenLawyerList]);
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (template) {
|
|
68
|
+
// 초기화
|
|
69
|
+
setIsFaqActive(false);
|
|
70
|
+
for (const data of template) {
|
|
71
|
+
// console.log("faq 활성화: ", data['active_faq']);
|
|
72
|
+
if (data['active_faq']) {
|
|
73
|
+
setIsFaqActive(true);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}, [template]);
|
|
78
|
+
return (<div itemScope={isFaqActive ? undefined : true} itemType={isFaqActive ? undefined : 'https://schema.org/FAQPage'} ref={printRef}>
|
|
79
|
+
<div id={'sub_contents'}>
|
|
80
|
+
<LawInfoWrapper>
|
|
81
|
+
<PdfPrintCopyLink fileName={template.filter(t => t.tag === 'h1')[0].tag_title} printRef={printRef}/>
|
|
82
|
+
<div className=" relative m-auto mb-[60px] mt-[7em] font-[SUIT] max-sm:mt-[70px] max-xs:mb-[30px] lg:mt-[5em]">
|
|
83
|
+
<div className="m-auto mt-[3em] flex gap-[120px] max-5xl:gap-[80px] max-xl:flex-col max-xl:gap-0 lg:mt-[5em]">
|
|
84
|
+
<div>
|
|
85
|
+
<div>
|
|
86
|
+
<h1 className={'break-keep text-[52.5px] font-[800] tracking-[-2.1px] text-[#285FA7] max-3xl:text-5xl max-md:text-4xl max-xs:text-[28px]'}>
|
|
87
|
+
{h1Title}
|
|
88
|
+
</h1>
|
|
89
|
+
<div className={'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]'}>
|
|
90
|
+
<div id={'ck-content'} dangerouslySetInnerHTML={{
|
|
91
|
+
__html: htmlUrlDecode(h1Description.replace('../../UploadFile', '/SE2/upload'))
|
|
92
|
+
}}/>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<article>
|
|
97
|
+
<ContentList template={template} h2List={h2List ? h2List : []} onScrollToElement={handleScrollToElement}/>
|
|
98
|
+
{h2List &&
|
|
99
|
+
h2List.map((h2Template, index) => (<section className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'} key={'h2영역' + h2Template.idx}>
|
|
100
|
+
<H2Contents h2Template={h2Template} index={index}/>
|
|
101
|
+
{template
|
|
102
|
+
.filter(t => t.parent === h2Template.idx)
|
|
103
|
+
.map((h3Template, h3Index) => {
|
|
104
|
+
return (<>
|
|
105
|
+
<H3Contents h3Template={h3Template} key={'h3영역' + h3Template.idx}/>
|
|
106
|
+
{(h3Template.reference_is_use &&
|
|
107
|
+
referenceLinkList.length > 0) ||
|
|
108
|
+
(h3Template.news_is_use && newsLinkList.length > 0) ? (<span className={'mb-[44px] flex flex-col gap-[26px] px-[10px] sm:mx-[33px] sm:mb-[50px] sm:px-[18px] lg:mb-[78px] ' +
|
|
109
|
+
//520px
|
|
110
|
+
'max-2sm:gap-[16px]'}>
|
|
111
|
+
{h3Template.reference_is_use &&
|
|
112
|
+
referenceLinkList.length > 0 && (<SeoAdditionalLink type={'더보기'} linkList={referenceLinkList.filter(i => i.tag_idx === h3Template.idx)}/>)}
|
|
113
|
+
{h3Template.news_is_use &&
|
|
114
|
+
newsLinkList.length > 0 && (<SeoAdditionalLink type={'관련기사'} linkList={newsLinkList.filter(i => i.tag_idx === h3Template.idx)}/>)}
|
|
115
|
+
</span>) : (<></>)}
|
|
116
|
+
</>);
|
|
117
|
+
})}
|
|
118
|
+
<span className={'flex flex-col gap-[26px] max-2sm:gap-[16px]'}>
|
|
119
|
+
{h2Template.reference_is_use && referenceLinkList.length > 0 && (<SeoAdditionalLink type={'더보기'} linkList={referenceLinkList.filter(i => i.tag_idx === h2Template.idx)}/>)}
|
|
120
|
+
{h2Template.news_is_use && newsLinkList.length > 0 && (<SeoAdditionalLink type={'관련기사'} linkList={newsLinkList.filter(i => i.tag_idx === h2Template.idx)}/>)}
|
|
121
|
+
{h2Template.youtube_is_use && (<>
|
|
122
|
+
{shortsLinkList.length > 0 && (<SeoYoutube type={'shorts'} linkList={shortsLinkList.filter(i => i.tag_idx === h2Template.idx)}/>)}
|
|
123
|
+
{youtubeLinkList.length > 0 && (<SeoYoutube type={'youtube'} linkList={youtubeLinkList.filter(i => i.tag_idx === h2Template.idx)}/>)}
|
|
124
|
+
</>)}
|
|
125
|
+
</span>
|
|
126
|
+
</section>))}
|
|
127
|
+
</article>
|
|
128
|
+
{width >= 1280 ? (<div className={'flex flex-col gap-[60px] lg:mt-[60px]'}>
|
|
129
|
+
<div className={'relative w-full '}>
|
|
130
|
+
<SeoStrength initialData={initialData}/>
|
|
131
|
+
</div>
|
|
132
|
+
<SeoConsulting tel={tel}/>
|
|
133
|
+
<LawInfoContentList contentsList={contentsList} template={template} className={''}/>
|
|
134
|
+
</div>) : (<></>)}
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
{(fieldData.length > 0 || relatedCaseLawyerList.length > 0 || successData.length > 0) && (<span className={'relative mb-[30px] mt-[170px] w-[340px] shrink-0 ' +
|
|
138
|
+
'max-3xl:mt-[150px] max-3xl:w-[300px] ' +
|
|
139
|
+
'max-xl:mt-[50px] max-xl:w-full max-xl:pt-0'}>
|
|
140
|
+
<span id={'fixSideBar'} className={'top-[140px] flex w-[340px] flex-col gap-[50px] xl:sticky ' +
|
|
141
|
+
'max-3xl:w-[300px] max-xl:w-full'}>
|
|
142
|
+
{successData.length > 0 && <SuccessCase successData={successData}/>}
|
|
143
|
+
{fieldData.length > 0 && <FieldCase fieldData={fieldData}/>}
|
|
144
|
+
{relatedCaseLawyerList.length > 0 && (<Lawyer lawyerData={relatedCaseLawyerList}/>)}
|
|
145
|
+
</span>
|
|
146
|
+
</span>)}
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</LawInfoWrapper>
|
|
150
|
+
<LawInfoWrapper className=" m-auto mt-[7em] max-md2:mt-[0] max-xs:mb-[30px] lg:mt-[5em] ">
|
|
151
|
+
<div className="max-4xl: m-auto">
|
|
152
|
+
{width < 1280 ? (<div className="max-4xl: m-auto flex flex-col gap-[60px]">
|
|
153
|
+
<div className={'relative w-full lg:mb-20'}>
|
|
154
|
+
<SeoStrength initialData={initialData}/>
|
|
155
|
+
</div>
|
|
156
|
+
<SeoConsulting tel={tel}/>
|
|
157
|
+
<LawInfoContentList contentsList={contentsList} template={template}/>
|
|
158
|
+
</div>) : (<></>)}
|
|
159
|
+
<div className="m-auto mt-[60px] max-md:mb-[30px]">
|
|
160
|
+
<div className={'flex flex-col items-start justify-between md:mb-[60px] lg:flex-row lg:items-center'}>
|
|
161
|
+
<div className={'mb-6 flex w-full flex-col gap-[8px] lg:mb-0 lg:w-auto lg:flex-row lg:items-center lg:gap-[20px] lg2:gap-[28px]'}>
|
|
162
|
+
<Image src={Arrow} alt={'화살표'} title={'화살표'} width={15} height={15} className={'m-auto hidden lg:block'}/>
|
|
163
|
+
<p className={'shrink-0 text-[18px] text-[#285FA7] '}>이전글</p>
|
|
164
|
+
{prevPost ? (<Link href={prevPost.pathname + String(prevPost.idx)}>
|
|
165
|
+
<p className={'w-full truncate text-[16px] xs:text-[18px] lg:w-[13em] xl:w-[16em] xxl:text-[20px] 4xl:w-[20em] '}>
|
|
166
|
+
{prevPost.title}
|
|
167
|
+
</p>
|
|
168
|
+
</Link>) : (<p className={'truncate text-[16px] lg:w-[13em] xl:w-[16em] xxl:text-[20px] 4xl:w-[20em]'}>
|
|
169
|
+
이전글이 없습니다.
|
|
170
|
+
</p>)}
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<Link href={`/info`} className={'hidden w-[198px] shrink-0 max-xxl:w-[138px] lg:block'}>
|
|
174
|
+
<button className={'rounded-[30px] border-[1px] border-solid border-[#b0b0b0] bg-[#41464C] px-[40px] py-[10px] text-[#fff] xxl:px-[70px] xxl:py-[15px]'}>
|
|
175
|
+
목록보기
|
|
176
|
+
</button>
|
|
177
|
+
</Link>
|
|
178
|
+
|
|
179
|
+
<div className={'flex w-full flex-col justify-end gap-[8px] lg:w-auto lg:flex-row lg:items-center lg:gap-[20px] lg2:gap-[28px]'}>
|
|
180
|
+
<p className={'shrink-0 text-[18px] text-[#285FA7]'}>다음글</p>
|
|
181
|
+
{nextPost ? (<Link href={nextPost.pathname + String(nextPost.idx)}>
|
|
182
|
+
<p className={'w-full truncate text-[16px] xs:text-[18px] lg:w-[13em] xl:w-[16em] xxl:text-[20px] 4xl:w-[20em] '}>
|
|
183
|
+
{nextPost.title}
|
|
184
|
+
</p>
|
|
185
|
+
</Link>) : (<p className={'truncate xs:text-[18px] lg:w-[13em] xl:w-[16em] xxl:text-[20px] 4xl:w-[20em] '}>
|
|
186
|
+
다음글이 없습니다.
|
|
187
|
+
</p>)}
|
|
188
|
+
<Image src={RightArrow} alt={'화살표'} title={'화살표'} width={15} height={15} className={'m-auto hidden lg:block'}/>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</LawInfoWrapper>
|
|
194
|
+
</div>
|
|
195
|
+
</div>);
|
|
196
|
+
};
|
|
197
|
+
export default LawInfoNewView;
|