@daeryun/dr_components 1.1.47 → 1.1.49
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/Seo/Lawyer.jsx +1 -1
- package/dist/components/Seo/Lawyer.tsx +1 -1
- package/dist/components/page/FieldNew/FieldNewView.jsx +43 -5
- package/dist/components/page/FieldNew/FieldNewView.tsx +65 -7
- package/dist/components/page/LawInfoNew/LawInfoNewView.jsx +31 -5
- package/dist/components/page/LawInfoNew/LawInfoNewView.tsx +51 -7
- package/dist/components/page/MyCase/_component/_pagination/PaginationComponent.jsx +1 -1
- package/dist/components/page/MyCase/_component/_pagination/PaginationComponent.tsx +1 -1
- package/dist/components/page/Notice/NoticeList.jsx +16 -11
- package/dist/components/page/Notice/NoticeList.tsx +19 -11
- package/dist/components/page/SuccessNew/SuccessNew.jsx +1 -1
- package/dist/components/page/SuccessNew/SuccessNew.tsx +1 -1
- package/dist/components/page/SuccessNew/SuccessNewView.jsx +43 -5
- package/dist/components/page/SuccessNew/SuccessNewView.tsx +71 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ import SuccessWrapper from './components/SuccessWrapper';
|
|
|
22
22
|
//next15 센터
|
|
23
23
|
const SuccessNewView = ({ data, tel }) => {
|
|
24
24
|
var _a;
|
|
25
|
-
const { template, contentsList, h2List, imgData, lawyerData, fieldData, successData, groupTopTenLawyerList, referenceLinkList, newsLinkList, shortsLinkList, youtubeLinkList, pn, initialData } = data;
|
|
25
|
+
const { template, contentsList, h2List, imgData, lawyerData, fieldData, successData, groupTopTenLawyerList, referenceLinkList, newsLinkList, shortsLinkList, youtubeLinkList, pn, initialData, faqElementMaxCountInContents } = data;
|
|
26
26
|
const { width } = useBrowser(true);
|
|
27
27
|
const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState(lawyerData);
|
|
28
28
|
const [isFaqActive, setIsFaqActive] = useState(false);
|
|
@@ -57,6 +57,32 @@ const SuccessNewView = ({ data, tel }) => {
|
|
|
57
57
|
const imgLocation = (_b = (_a = document.getElementById('img_wrap')) === null || _a === void 0 ? void 0 : _a.offsetTop) !== null && _b !== void 0 ? _b : 0;
|
|
58
58
|
window.scrollTo({ top: imgLocation + (width > 680 ? 300 : 200), behavior: 'smooth' });
|
|
59
59
|
};
|
|
60
|
+
const handleFaqItemType = (isFaqActive, faqElementMaxCountInContents) => {
|
|
61
|
+
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
if (isFaqActive && faqElementMaxCountInContents >= 2) {
|
|
65
|
+
return 'https://schema.org/FAQPage';
|
|
66
|
+
}
|
|
67
|
+
return 'https://schema.org/FAQPage';
|
|
68
|
+
};
|
|
69
|
+
const handleFaqItemScope = (isFaqActive, faqElementMaxCountInContents) => {
|
|
70
|
+
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
if (isFaqActive && faqElementMaxCountInContents >= 2) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
return true;
|
|
77
|
+
};
|
|
78
|
+
const convertFaqItemType = (template) => {
|
|
79
|
+
if (faqElementMaxCountInContents >= 2) {
|
|
80
|
+
// faqElementMaxCountInContents가 두 개 이상일 경우, template 내부에 FAQPage itemtype을 지운다. FAQPage 중복 이슈로 인한 코드임
|
|
81
|
+
template.description = template.description.replaceAll('<div itemscope="" itemtype="https://schema.org/FAQPage">', '<div>');
|
|
82
|
+
return template;
|
|
83
|
+
}
|
|
84
|
+
return template;
|
|
85
|
+
};
|
|
60
86
|
// 변호사 6명 맞추기
|
|
61
87
|
useEffect(() => {
|
|
62
88
|
const originLawyerLength = lawyerData.length;
|
|
@@ -87,7 +113,19 @@ const SuccessNewView = ({ data, tel }) => {
|
|
|
87
113
|
}
|
|
88
114
|
}
|
|
89
115
|
}, [template]);
|
|
90
|
-
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
if (template) {
|
|
118
|
+
// 초기화
|
|
119
|
+
setIsFaqActive(false);
|
|
120
|
+
for (const data of template) {
|
|
121
|
+
// console.log("faq 활성화: ", data['active_faq']);
|
|
122
|
+
if (data['active_faq']) {
|
|
123
|
+
setIsFaqActive(true);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, [template]);
|
|
128
|
+
return (<div id="sub_contents" itemScope={handleFaqItemScope(isFaqActive, faqElementMaxCountInContents)} itemType={handleFaqItemType(isFaqActive, faqElementMaxCountInContents)} ref={printRef}>
|
|
91
129
|
<SuccessWrapper>
|
|
92
130
|
<PdfPrintCopyLink fileName={h1Title} printRef={printRef}/>
|
|
93
131
|
</SuccessWrapper>
|
|
@@ -108,10 +146,10 @@ const SuccessNewView = ({ data, tel }) => {
|
|
|
108
146
|
<article className="w-full max-w-[1076px] overflow-hidden">
|
|
109
147
|
<ContentList template={template} h2List={h2List || []} onImageMove={handleClickGoImg} onScrollToElement={handleScrollToElement}/>
|
|
110
148
|
{h2List === null || h2List === void 0 ? void 0 : h2List.map((h2Template, index) => (<section className="mt-[52px] sm:mt-[62px] lg:mt-[75px]" key={'h2영역' + h2Template.idx}>
|
|
111
|
-
<H2Contents h2Template={h2Template} index={index}/>
|
|
149
|
+
<H2Contents h2Template={convertFaqItemType(h2Template)} index={index} faqCount={h2Template === null || h2Template === void 0 ? void 0 : h2Template.faqCount}/>
|
|
112
150
|
{template
|
|
113
151
|
.filter(t => t.parent === h2Template.idx)
|
|
114
|
-
.map(
|
|
152
|
+
.map(h3Template => {
|
|
115
153
|
const refer_is_use = h3Template.reference_is_use;
|
|
116
154
|
const refer_length = referenceLinkList.length;
|
|
117
155
|
const refer_content_length = referenceLinkList.filter(i => i.tag_idx === h3Template.idx).length;
|
|
@@ -119,7 +157,7 @@ const SuccessNewView = ({ data, tel }) => {
|
|
|
119
157
|
const news_length = newsLinkList.length;
|
|
120
158
|
const news_content_length = newsLinkList.filter(i => i.tag_idx === h3Template.idx).length;
|
|
121
159
|
return (<>
|
|
122
|
-
<H3Contents h3Template={h3Template} key={'h3영역' + h3Template.idx}/>
|
|
160
|
+
<H3Contents h3Template={convertFaqItemType(h3Template)} key={'h3영역' + h3Template.idx} faqCount={h3Template === null || h3Template === void 0 ? void 0 : h3Template.faqCount}/>
|
|
123
161
|
{(refer_is_use && refer_length > 0 && refer_content_length > 0) ||
|
|
124
162
|
(news_is_use && news_length > 0 && news_content_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] ' +
|
|
125
163
|
//520px
|
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
import ContentList from './components/ContentList';
|
|
4
4
|
import { useEffect, useRef, useState } from 'react';
|
|
5
5
|
import useBrowser from '../../hook/useBrowser';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
ILawyerTypes,
|
|
8
|
+
ISuccessTypes,
|
|
9
|
+
ILegalDocumentImageObjectTypes,
|
|
10
|
+
ISuccessNewPageTypes,
|
|
11
|
+
ISeoTemplateTypes
|
|
12
|
+
} from './SuccessNewType';
|
|
7
13
|
import { htmlUrlDecode } from '../../../lib';
|
|
8
14
|
import H2Contents from './components/H2Contents';
|
|
9
15
|
import H3Contents from './components/H3Contents';
|
|
@@ -38,7 +44,8 @@ const SuccessNewView = ({ data, tel }: ISuccessNewPageTypes) => {
|
|
|
38
44
|
shortsLinkList,
|
|
39
45
|
youtubeLinkList,
|
|
40
46
|
pn,
|
|
41
|
-
initialData
|
|
47
|
+
initialData,
|
|
48
|
+
faqElementMaxCountInContents
|
|
42
49
|
} = data;
|
|
43
50
|
const { width } = useBrowser(true);
|
|
44
51
|
const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState<ILawyerTypes[]>(lawyerData);
|
|
@@ -81,6 +88,44 @@ const SuccessNewView = ({ data, tel }: ISuccessNewPageTypes) => {
|
|
|
81
88
|
window.scrollTo({ top: imgLocation + (width > 680 ? 300 : 200), behavior: 'smooth' });
|
|
82
89
|
};
|
|
83
90
|
|
|
91
|
+
const handleFaqItemType = (isFaqActive: boolean, faqElementMaxCountInContents?: number): string | undefined => {
|
|
92
|
+
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (isFaqActive && (faqElementMaxCountInContents as number) >= 2) {
|
|
97
|
+
return 'https://schema.org/FAQPage';
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return 'https://schema.org/FAQPage';
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const handleFaqItemScope = (isFaqActive: boolean, faqElementMaxCountInContents?: number): true | undefined => {
|
|
104
|
+
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (isFaqActive && (faqElementMaxCountInContents as number) >= 2) {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return true;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const convertFaqItemType = (template: ISeoTemplateTypes): ISeoTemplateTypes => {
|
|
116
|
+
if ((faqElementMaxCountInContents as number) >= 2) {
|
|
117
|
+
// faqElementMaxCountInContents가 두 개 이상일 경우, template 내부에 FAQPage itemtype을 지운다. FAQPage 중복 이슈로 인한 코드임
|
|
118
|
+
template.description = template.description.replaceAll(
|
|
119
|
+
'<div itemscope="" itemtype="https://schema.org/FAQPage">',
|
|
120
|
+
'<div>'
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
return template;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return template;
|
|
127
|
+
};
|
|
128
|
+
|
|
84
129
|
// 변호사 6명 맞추기
|
|
85
130
|
useEffect(() => {
|
|
86
131
|
const originLawyerLength = lawyerData.length;
|
|
@@ -115,11 +160,25 @@ const SuccessNewView = ({ data, tel }: ISuccessNewPageTypes) => {
|
|
|
115
160
|
}
|
|
116
161
|
}, [template]);
|
|
117
162
|
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
if (template) {
|
|
165
|
+
// 초기화
|
|
166
|
+
setIsFaqActive(false);
|
|
167
|
+
|
|
168
|
+
for (const data of template) {
|
|
169
|
+
// console.log("faq 활성화: ", data['active_faq']);
|
|
170
|
+
if (data['active_faq']) {
|
|
171
|
+
setIsFaqActive(true);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}, [template]);
|
|
176
|
+
|
|
118
177
|
return (
|
|
119
178
|
<div
|
|
120
179
|
id="sub_contents"
|
|
121
|
-
itemScope={
|
|
122
|
-
itemType={
|
|
180
|
+
itemScope={handleFaqItemScope(isFaqActive, faqElementMaxCountInContents as number)}
|
|
181
|
+
itemType={handleFaqItemType(isFaqActive, faqElementMaxCountInContents as number)}
|
|
123
182
|
ref={printRef}
|
|
124
183
|
>
|
|
125
184
|
<SuccessWrapper>
|
|
@@ -159,10 +218,14 @@ const SuccessNewView = ({ data, tel }: ISuccessNewPageTypes) => {
|
|
|
159
218
|
className="mt-[52px] sm:mt-[62px] lg:mt-[75px]"
|
|
160
219
|
key={'h2영역' + h2Template.idx}
|
|
161
220
|
>
|
|
162
|
-
<H2Contents
|
|
221
|
+
<H2Contents
|
|
222
|
+
h2Template={convertFaqItemType(h2Template)}
|
|
223
|
+
index={index}
|
|
224
|
+
faqCount={h2Template?.faqCount}
|
|
225
|
+
/>
|
|
163
226
|
{template
|
|
164
227
|
.filter(t => t.parent === h2Template.idx)
|
|
165
|
-
.map(
|
|
228
|
+
.map(h3Template => {
|
|
166
229
|
const refer_is_use = h3Template.reference_is_use;
|
|
167
230
|
const refer_length = referenceLinkList.length;
|
|
168
231
|
const refer_content_length = referenceLinkList.filter(
|
|
@@ -178,8 +241,9 @@ const SuccessNewView = ({ data, tel }: ISuccessNewPageTypes) => {
|
|
|
178
241
|
return (
|
|
179
242
|
<>
|
|
180
243
|
<H3Contents
|
|
181
|
-
h3Template={h3Template}
|
|
244
|
+
h3Template={convertFaqItemType(h3Template)}
|
|
182
245
|
key={'h3영역' + h3Template.idx}
|
|
246
|
+
faqCount={h3Template?.faqCount}
|
|
183
247
|
/>
|
|
184
248
|
{(refer_is_use && refer_length > 0 && refer_content_length > 0) ||
|
|
185
249
|
(news_is_use && news_length > 0 && news_content_length > 0) ? (
|