@daeryun/dr_components 1.0.16 → 1.0.18
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/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/components/page/FieldNew/FieldNew.jsx +30 -4
- package/dist/components/page/FieldNew/FieldNew.tsx +50 -6
- package/dist/components/page/FieldNew/FieldNewTypes.d.ts +1 -0
- package/dist/components/page/FieldNew/FieldNewTypes.ts +1 -0
- package/dist/components/page/LawInfoNew/LawInfoNew.jsx +31 -5
- package/dist/components/page/LawInfoNew/LawInfoNew.tsx +51 -7
- package/dist/components/page/SuccessNew/SuccessNew.jsx +30 -4
- package/dist/components/page/SuccessNew/SuccessNew.tsx +56 -6
- package/dist/components/page/SuccessNew/SuccessNewType.d.ts +1 -0
- package/dist/components/page/SuccessNew/SuccessNewType.ts +1 -0
- package/dist/components/page/SuccessNew/components/H2Contents.d.ts +2 -1
- package/dist/components/page/SuccessNew/components/H2Contents.jsx +42 -6
- package/dist/components/page/SuccessNew/components/H2Contents.tsx +62 -12
- package/dist/components/page/SuccessNew/components/H3Contents.d.ts +2 -1
- package/dist/components/page/SuccessNew/components/H3Contents.jsx +41 -5
- package/dist/components/page/SuccessNew/components/H3Contents.tsx +55 -9
- package/dist/styles/globals.css +346 -346
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import ContentList from '../SuccessNew/components/ContentList';
|
|
4
4
|
import { useEffect, useRef, useState } from 'react';
|
|
5
5
|
import useBrowser from '../../hook/useBrowser';
|
|
6
|
-
import { ILawyerTypes } from '../SuccessNew/SuccessNewType';
|
|
6
|
+
import { ILawyerTypes, ISeoTemplateTypes } from '../SuccessNew/SuccessNewType';
|
|
7
7
|
import { htmlUrlDecode } from '../../../lib';
|
|
8
8
|
import H2Contents from '../SuccessNew/components/H2Contents';
|
|
9
9
|
import H3Contents from '../SuccessNew/components/H3Contents';
|
|
@@ -38,7 +38,8 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
38
38
|
youtubeLinkList,
|
|
39
39
|
initialData,
|
|
40
40
|
nextPost,
|
|
41
|
-
prevPost
|
|
41
|
+
prevPost,
|
|
42
|
+
faqElementMaxCountInContents
|
|
42
43
|
} = data;
|
|
43
44
|
const { width } = useBrowser(true);
|
|
44
45
|
const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState<ILawyerTypes[]>(lawyerData);
|
|
@@ -67,6 +68,44 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
67
68
|
}
|
|
68
69
|
};
|
|
69
70
|
|
|
71
|
+
const handleFaqItemType = (isFaqActive: boolean, faqElementMaxCountInContents?: number): string | undefined => {
|
|
72
|
+
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (isFaqActive && (faqElementMaxCountInContents as number) >= 2) {
|
|
77
|
+
return 'https://schema.org/FAQPage';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return 'https://schema.org/FAQPage';
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const handleFaqItemScope = (isFaqActive: boolean, faqElementMaxCountInContents?: number): true | undefined => {
|
|
84
|
+
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (isFaqActive && (faqElementMaxCountInContents as number) >= 2) {
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return true;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const convertFaqItemType = (template: ISeoTemplateTypes): ISeoTemplateTypes => {
|
|
96
|
+
if ((faqElementMaxCountInContents as number) >= 2) {
|
|
97
|
+
// faqElementMaxCountInContents가 두 개 이상일 경우, template 내부에 FAQPage itemtype을 지운다. FAQPage 중복 이슈로 인한 코드임
|
|
98
|
+
template.description = template.description.replaceAll(
|
|
99
|
+
'<div itemscope="" itemtype="https://schema.org/FAQPage">',
|
|
100
|
+
'<div>'
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
return template;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return template;
|
|
107
|
+
};
|
|
108
|
+
|
|
70
109
|
// 변호사 6명 맞추기
|
|
71
110
|
useEffect(() => {
|
|
72
111
|
const originLawyerLength = lawyerData.length;
|
|
@@ -103,12 +142,12 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
103
142
|
|
|
104
143
|
return (
|
|
105
144
|
<div
|
|
106
|
-
itemScope={isFaqActive
|
|
107
|
-
itemType={isFaqActive
|
|
145
|
+
itemScope={handleFaqItemScope(isFaqActive, faqElementMaxCountInContents as number)}
|
|
146
|
+
itemType={handleFaqItemType(isFaqActive, faqElementMaxCountInContents as number)}
|
|
108
147
|
ref={printRef}
|
|
109
148
|
>
|
|
110
149
|
<div id={'sub_contents'}>
|
|
111
|
-
<div className="
|
|
150
|
+
<div className="relative m-auto mb-[60px] w-[90%] max-w-screen-2xl font-[SUIT] max-xs:mb-[30px]">
|
|
112
151
|
<div
|
|
113
152
|
className={
|
|
114
153
|
'm-auto mt-[100px] flex gap-[120px] lg:mt-[5em] ' +
|
|
@@ -172,7 +211,11 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
172
211
|
className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'}
|
|
173
212
|
key={'h2영역' + h2Template.idx}
|
|
174
213
|
>
|
|
175
|
-
<H2Contents
|
|
214
|
+
<H2Contents
|
|
215
|
+
h2Template={convertFaqItemType(h2Template)}
|
|
216
|
+
index={index}
|
|
217
|
+
faqCount={h2Template?.faqCount}
|
|
218
|
+
/>
|
|
176
219
|
|
|
177
220
|
{/*h3*/}
|
|
178
221
|
{template
|
|
@@ -193,8 +236,9 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
193
236
|
return (
|
|
194
237
|
<>
|
|
195
238
|
<H3Contents
|
|
196
|
-
h3Template={h3Template}
|
|
239
|
+
h3Template={convertFaqItemType(h3Template)}
|
|
197
240
|
key={'h3영역' + h3Template.idx}
|
|
241
|
+
faqCount={h3Template?.faqCount}
|
|
198
242
|
/>
|
|
199
243
|
{(refer_is_use &&
|
|
200
244
|
refer_length > 0 &&
|
|
@@ -20,7 +20,7 @@ import { SuccessCase } from './components/SuccessCase';
|
|
|
20
20
|
import { FieldCase } from './components/FieldCase';
|
|
21
21
|
const SuccessNew = ({ data, tel }) => {
|
|
22
22
|
var _a;
|
|
23
|
-
const { template, contentsList, h2List, imgData, lawyerData, fieldData, successData, groupTopTenLawyerList, referenceLinkList, newsLinkList, shortsLinkList, youtubeLinkList, pn, initialData } = data;
|
|
23
|
+
const { template, contentsList, h2List, imgData, lawyerData, fieldData, successData, groupTopTenLawyerList, referenceLinkList, newsLinkList, shortsLinkList, youtubeLinkList, pn, initialData, faqElementMaxCountInContents } = data;
|
|
24
24
|
const { width } = useBrowser(true);
|
|
25
25
|
const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState(lawyerData);
|
|
26
26
|
const [isFaqActive, setIsFaqActive] = useState(false);
|
|
@@ -55,6 +55,32 @@ const SuccessNew = ({ data, tel }) => {
|
|
|
55
55
|
const imgLocation = (_b = (_a = document.getElementById('img_wrap')) === null || _a === void 0 ? void 0 : _a.offsetTop) !== null && _b !== void 0 ? _b : 0;
|
|
56
56
|
window.scrollTo({ top: imgLocation + (width > 680 ? 300 : 200), behavior: 'smooth' });
|
|
57
57
|
};
|
|
58
|
+
const handleFaqItemType = (isFaqActive, faqElementMaxCountInContents) => {
|
|
59
|
+
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
if (isFaqActive && faqElementMaxCountInContents >= 2) {
|
|
63
|
+
return 'https://schema.org/FAQPage';
|
|
64
|
+
}
|
|
65
|
+
return 'https://schema.org/FAQPage';
|
|
66
|
+
};
|
|
67
|
+
const handleFaqItemScope = (isFaqActive, faqElementMaxCountInContents) => {
|
|
68
|
+
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
if (isFaqActive && faqElementMaxCountInContents >= 2) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
};
|
|
76
|
+
const convertFaqItemType = (template) => {
|
|
77
|
+
if (faqElementMaxCountInContents >= 2) {
|
|
78
|
+
// faqElementMaxCountInContents가 두 개 이상일 경우, template 내부에 FAQPage itemtype을 지운다. FAQPage 중복 이슈로 인한 코드임
|
|
79
|
+
template.description = template.description.replaceAll('<div itemscope="" itemtype="https://schema.org/FAQPage">', '<div>');
|
|
80
|
+
return template;
|
|
81
|
+
}
|
|
82
|
+
return template;
|
|
83
|
+
};
|
|
58
84
|
// 변호사 6명 맞추기
|
|
59
85
|
useEffect(() => {
|
|
60
86
|
const originLawyerLength = lawyerData.length;
|
|
@@ -85,7 +111,7 @@ const SuccessNew = ({ data, tel }) => {
|
|
|
85
111
|
}
|
|
86
112
|
}
|
|
87
113
|
}, [template]);
|
|
88
|
-
return (<div itemScope={isFaqActive
|
|
114
|
+
return (<div itemScope={handleFaqItemScope(isFaqActive, faqElementMaxCountInContents)} itemType={handleFaqItemType(isFaqActive, faqElementMaxCountInContents)} ref={printRef}>
|
|
89
115
|
<div className="relative m-auto mb-[100px] w-[90%] max-w-screen-2xl font-[SUIT] max-md2:mb-[40px] max-xs:mb-[30px]">
|
|
90
116
|
<div className={'m-auto mt-[100px] flex gap-[120px] ' +
|
|
91
117
|
//1700px
|
|
@@ -122,7 +148,7 @@ const SuccessNew = ({ data, tel }) => {
|
|
|
122
148
|
{h2List &&
|
|
123
149
|
h2List.map((h2Template, index) => {
|
|
124
150
|
return (<section className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'} key={'h2영역' + h2Template.idx}>
|
|
125
|
-
<H2Contents h2Template={h2Template} index={index}/>
|
|
151
|
+
<H2Contents h2Template={convertFaqItemType(h2Template)} index={index} faqCount={h2Template === null || h2Template === void 0 ? void 0 : h2Template.faqCount}/>
|
|
126
152
|
|
|
127
153
|
{/*h3*/}
|
|
128
154
|
{template
|
|
@@ -135,7 +161,7 @@ const SuccessNew = ({ data, tel }) => {
|
|
|
135
161
|
const news_length = newsLinkList.length;
|
|
136
162
|
const news_content_length = newsLinkList.filter(i => i.tag_idx === h3Template.idx).length;
|
|
137
163
|
return (<>
|
|
138
|
-
<H3Contents h3Template={h3Template} key={'h3영역' + h3Template.idx}/>
|
|
164
|
+
<H3Contents h3Template={convertFaqItemType(h3Template)} key={'h3영역' + h3Template.idx} faqCount={h3Template === null || h3Template === void 0 ? void 0 : h3Template.faqCount}/>
|
|
139
165
|
{(refer_is_use &&
|
|
140
166
|
refer_length > 0 &&
|
|
141
167
|
refer_content_length > 0) ||
|
|
@@ -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';
|
|
@@ -35,7 +41,8 @@ const SuccessNew = ({ data, tel }: ISuccessNewPageTypes) => {
|
|
|
35
41
|
shortsLinkList,
|
|
36
42
|
youtubeLinkList,
|
|
37
43
|
pn,
|
|
38
|
-
initialData
|
|
44
|
+
initialData,
|
|
45
|
+
faqElementMaxCountInContents
|
|
39
46
|
} = data;
|
|
40
47
|
const { width } = useBrowser(true);
|
|
41
48
|
const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState<ILawyerTypes[]>(lawyerData);
|
|
@@ -78,6 +85,44 @@ const SuccessNew = ({ data, tel }: ISuccessNewPageTypes) => {
|
|
|
78
85
|
window.scrollTo({ top: imgLocation + (width > 680 ? 300 : 200), behavior: 'smooth' });
|
|
79
86
|
};
|
|
80
87
|
|
|
88
|
+
const handleFaqItemType = (isFaqActive: boolean, faqElementMaxCountInContents?: number): string | undefined => {
|
|
89
|
+
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (isFaqActive && (faqElementMaxCountInContents as number) >= 2) {
|
|
94
|
+
return 'https://schema.org/FAQPage';
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return 'https://schema.org/FAQPage';
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const handleFaqItemScope = (isFaqActive: boolean, faqElementMaxCountInContents?: number): true | undefined => {
|
|
101
|
+
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (isFaqActive && (faqElementMaxCountInContents as number) >= 2) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return true;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const convertFaqItemType = (template: ISeoTemplateTypes): ISeoTemplateTypes => {
|
|
113
|
+
if ((faqElementMaxCountInContents as number) >= 2) {
|
|
114
|
+
// faqElementMaxCountInContents가 두 개 이상일 경우, template 내부에 FAQPage itemtype을 지운다. FAQPage 중복 이슈로 인한 코드임
|
|
115
|
+
template.description = template.description.replaceAll(
|
|
116
|
+
'<div itemscope="" itemtype="https://schema.org/FAQPage">',
|
|
117
|
+
'<div>'
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
return template;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return template;
|
|
124
|
+
};
|
|
125
|
+
|
|
81
126
|
// 변호사 6명 맞추기
|
|
82
127
|
useEffect(() => {
|
|
83
128
|
const originLawyerLength = lawyerData.length;
|
|
@@ -114,8 +159,8 @@ const SuccessNew = ({ data, tel }: ISuccessNewPageTypes) => {
|
|
|
114
159
|
|
|
115
160
|
return (
|
|
116
161
|
<div
|
|
117
|
-
itemScope={isFaqActive
|
|
118
|
-
itemType={isFaqActive
|
|
162
|
+
itemScope={handleFaqItemScope(isFaqActive, faqElementMaxCountInContents as number)}
|
|
163
|
+
itemType={handleFaqItemType(isFaqActive, faqElementMaxCountInContents as number)}
|
|
119
164
|
ref={printRef}
|
|
120
165
|
>
|
|
121
166
|
<div className="relative m-auto mb-[100px] w-[90%] max-w-screen-2xl font-[SUIT] max-md2:mb-[40px] max-xs:mb-[30px]">
|
|
@@ -183,7 +228,11 @@ const SuccessNew = ({ data, tel }: ISuccessNewPageTypes) => {
|
|
|
183
228
|
className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'}
|
|
184
229
|
key={'h2영역' + h2Template.idx}
|
|
185
230
|
>
|
|
186
|
-
<H2Contents
|
|
231
|
+
<H2Contents
|
|
232
|
+
h2Template={convertFaqItemType(h2Template)}
|
|
233
|
+
index={index}
|
|
234
|
+
faqCount={h2Template?.faqCount}
|
|
235
|
+
/>
|
|
187
236
|
|
|
188
237
|
{/*h3*/}
|
|
189
238
|
{template
|
|
@@ -204,8 +253,9 @@ const SuccessNew = ({ data, tel }: ISuccessNewPageTypes) => {
|
|
|
204
253
|
return (
|
|
205
254
|
<>
|
|
206
255
|
<H3Contents
|
|
207
|
-
h3Template={h3Template}
|
|
256
|
+
h3Template={convertFaqItemType(h3Template)}
|
|
208
257
|
key={'h3영역' + h3Template.idx}
|
|
258
|
+
faqCount={h3Template?.faqCount}
|
|
209
259
|
/>
|
|
210
260
|
{(refer_is_use &&
|
|
211
261
|
refer_length > 0 &&
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ISeoTemplateTypes } from '../SuccessNewType';
|
|
3
|
-
declare const H2Contents: ({ h2Template, index }: {
|
|
3
|
+
declare const H2Contents: ({ h2Template, index, faqCount }: {
|
|
4
4
|
h2Template: ISeoTemplateTypes;
|
|
5
5
|
index: number;
|
|
6
|
+
faqCount?: number;
|
|
6
7
|
}) => React.JSX.Element;
|
|
7
8
|
export default H2Contents;
|
|
@@ -1,17 +1,53 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { htmlUrlDecode } from '../../../../lib';
|
|
3
|
-
const H2Contents = ({ h2Template, index }) => {
|
|
3
|
+
const H2Contents = ({ h2Template, index, faqCount }) => {
|
|
4
4
|
const { active_faq } = h2Template;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const getItemScope = () => {
|
|
6
|
+
if (active_faq === false && (faqCount === 0 || faqCount === undefined)) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
return undefined;
|
|
10
|
+
};
|
|
11
|
+
const getItemProp = (category) => {
|
|
12
|
+
if (active_faq === false && (faqCount === 0 || faqCount === undefined)) {
|
|
13
|
+
switch (category) {
|
|
14
|
+
case 'mainEntity':
|
|
15
|
+
return 'mainEntity';
|
|
16
|
+
case 'acceptedAnswer':
|
|
17
|
+
return 'acceptedAnswer';
|
|
18
|
+
case 'name':
|
|
19
|
+
return 'name';
|
|
20
|
+
case 'text':
|
|
21
|
+
return 'text';
|
|
22
|
+
default:
|
|
23
|
+
undefined;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
};
|
|
28
|
+
const getItemType = (category) => {
|
|
29
|
+
if (active_faq === false && (faqCount === 0 || faqCount === undefined)) {
|
|
30
|
+
switch (category) {
|
|
31
|
+
case 'question':
|
|
32
|
+
return 'https://schema.org/Question';
|
|
33
|
+
case 'answer':
|
|
34
|
+
return 'https://schema.org/Answer';
|
|
35
|
+
default:
|
|
36
|
+
undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
};
|
|
41
|
+
return (<div itemScope={getItemScope()} itemProp={getItemProp('mainEntity')} itemType={getItemType('question')}>
|
|
42
|
+
<h2 className={'flex h-fit w-full items-center break-keep rounded-[40px] bg-[#285FA7] py-[6.75px] pl-[40px] pr-[20px] -indent-[20px] text-[20px] font-bold leading-[28px] tracking-tight text-white sm:pl-[46px] sm:pr-[26px] sm:text-[26px] sm:leading-[34px] lg:pl-[53px] lg:pr-[33px] lg:text-[31.5px] lg:leading-[38px]'} id={h2Template.idx.toString()} itemProp={getItemProp('name')}>
|
|
7
43
|
{index + 1}. {h2Template.tag_title}
|
|
8
44
|
</h2>
|
|
9
45
|
<div className={'px-[10px] sm:px-[18px]'}>
|
|
10
46
|
{/*h2 설명글*/}
|
|
11
|
-
<div className={'lg::mt-[37.5px] mb-[44px] mt-[26px] whitespace-break-spaces text-[16px] tracking-[-0.69px] sm:mx-[20px] sm:mx-[33px] sm:mb-[50px] sm:mt-[32px] sm:text-[17.25px] lg:mb-[78px]'} itemScope={
|
|
12
|
-
{h2Template.is_editor ? (<div itemProp={
|
|
47
|
+
<div className={'lg::mt-[37.5px] mb-[44px] mt-[26px] whitespace-break-spaces text-[16px] tracking-[-0.69px] sm:mx-[20px] sm:mx-[33px] sm:mb-[50px] sm:mt-[32px] sm:text-[17.25px] lg:mb-[78px]'} itemScope={getItemScope()} itemProp={getItemProp('acceptedAnswer')} itemType={getItemType('answer')}>
|
|
48
|
+
{h2Template.is_editor ? (<div itemProp={getItemProp('text')} id={'ck-content'} dangerouslySetInnerHTML={{
|
|
13
49
|
__html: htmlUrlDecode(h2Template.description.replace('../../UploadFile', '/SE2/upload'))
|
|
14
|
-
}}/>) : (<div itemProp={
|
|
50
|
+
}}/>) : (<div itemProp={getItemProp('text')}>{h2Template.description}</div>)}
|
|
15
51
|
</div>
|
|
16
52
|
</div>
|
|
17
53
|
</div>);
|
|
@@ -1,21 +1,71 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ISeoTemplateTypes } from '../SuccessNewType';
|
|
3
3
|
import { htmlUrlDecode } from '../../../../lib';
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
type ItemPropTypes = 'mainEntity' | 'acceptedAnswer' | 'name' | 'text';
|
|
6
|
+
type ItemTypes = 'question' | 'answer';
|
|
7
|
+
|
|
8
|
+
const H2Contents = ({
|
|
9
|
+
h2Template,
|
|
10
|
+
index,
|
|
11
|
+
faqCount
|
|
12
|
+
}: {
|
|
13
|
+
h2Template: ISeoTemplateTypes;
|
|
14
|
+
index: number;
|
|
15
|
+
faqCount?: number;
|
|
16
|
+
}) => {
|
|
5
17
|
const { active_faq } = h2Template;
|
|
6
18
|
|
|
19
|
+
const getItemScope = (): boolean | undefined => {
|
|
20
|
+
if (active_faq === false && ((faqCount as number) === 0 || faqCount === undefined)) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return undefined;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const getItemProp = (category: ItemPropTypes): string | undefined => {
|
|
28
|
+
if (active_faq === false && ((faqCount as number) === 0 || faqCount === undefined)) {
|
|
29
|
+
switch (category) {
|
|
30
|
+
case 'mainEntity':
|
|
31
|
+
return 'mainEntity';
|
|
32
|
+
case 'acceptedAnswer':
|
|
33
|
+
return 'acceptedAnswer';
|
|
34
|
+
case 'name':
|
|
35
|
+
return 'name';
|
|
36
|
+
case 'text':
|
|
37
|
+
return 'text';
|
|
38
|
+
default:
|
|
39
|
+
undefined;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return undefined;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const getItemType = (category: ItemTypes): string | undefined => {
|
|
47
|
+
if (active_faq === false && ((faqCount as number) === 0 || faqCount === undefined)) {
|
|
48
|
+
switch (category) {
|
|
49
|
+
case 'question':
|
|
50
|
+
return 'https://schema.org/Question';
|
|
51
|
+
case 'answer':
|
|
52
|
+
return 'https://schema.org/Answer';
|
|
53
|
+
default:
|
|
54
|
+
undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return undefined;
|
|
59
|
+
};
|
|
60
|
+
|
|
7
61
|
return (
|
|
8
|
-
<div
|
|
9
|
-
itemScope={active_faq ? undefined : true}
|
|
10
|
-
itemProp={active_faq ? '' : 'mainEntity'}
|
|
11
|
-
itemType={active_faq ? '' : 'https://schema.org/Question'}
|
|
12
|
-
>
|
|
62
|
+
<div itemScope={getItemScope()} itemProp={getItemProp('mainEntity')} itemType={getItemType('question')}>
|
|
13
63
|
<h2
|
|
14
64
|
className={
|
|
15
65
|
'flex h-fit w-full items-center break-keep rounded-[40px] bg-[#285FA7] py-[6.75px] pl-[40px] pr-[20px] -indent-[20px] text-[20px] font-bold leading-[28px] tracking-tight text-white sm:pl-[46px] sm:pr-[26px] sm:text-[26px] sm:leading-[34px] lg:pl-[53px] lg:pr-[33px] lg:text-[31.5px] lg:leading-[38px]'
|
|
16
66
|
}
|
|
17
67
|
id={h2Template.idx.toString()}
|
|
18
|
-
itemProp={
|
|
68
|
+
itemProp={getItemProp('name')}
|
|
19
69
|
>
|
|
20
70
|
{index + 1}. {h2Template.tag_title}
|
|
21
71
|
</h2>
|
|
@@ -25,20 +75,20 @@ const H2Contents = ({ h2Template, index }: { h2Template: ISeoTemplateTypes; inde
|
|
|
25
75
|
className={
|
|
26
76
|
'lg::mt-[37.5px] mb-[44px] mt-[26px] whitespace-break-spaces text-[16px] tracking-[-0.69px] sm:mx-[20px] sm:mx-[33px] sm:mb-[50px] sm:mt-[32px] sm:text-[17.25px] lg:mb-[78px]'
|
|
27
77
|
}
|
|
28
|
-
itemScope={
|
|
29
|
-
itemProp={
|
|
30
|
-
itemType={
|
|
78
|
+
itemScope={getItemScope()}
|
|
79
|
+
itemProp={getItemProp('acceptedAnswer')}
|
|
80
|
+
itemType={getItemType('answer')}
|
|
31
81
|
>
|
|
32
82
|
{h2Template.is_editor ? (
|
|
33
83
|
<div
|
|
34
|
-
itemProp={
|
|
84
|
+
itemProp={getItemProp('text')}
|
|
35
85
|
id={'ck-content'}
|
|
36
86
|
dangerouslySetInnerHTML={{
|
|
37
87
|
__html: htmlUrlDecode(h2Template.description.replace('../../UploadFile', '/SE2/upload'))
|
|
38
88
|
}}
|
|
39
89
|
/>
|
|
40
90
|
) : (
|
|
41
|
-
<div itemProp={
|
|
91
|
+
<div itemProp={getItemProp('text')}>{h2Template.description}</div>
|
|
42
92
|
)}
|
|
43
93
|
</div>
|
|
44
94
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ISeoTemplateTypes } from '../SuccessNewType';
|
|
3
|
-
declare const H3Contents: ({ h3Template }: {
|
|
3
|
+
declare const H3Contents: ({ h3Template, faqCount }: {
|
|
4
4
|
h3Template: ISeoTemplateTypes;
|
|
5
|
+
faqCount?: number;
|
|
5
6
|
}) => React.JSX.Element;
|
|
6
7
|
export default H3Contents;
|
|
@@ -2,19 +2,55 @@ import React from 'react';
|
|
|
2
2
|
import Image from 'next/image';
|
|
3
3
|
import { htmlUrlDecode } from '../../../../lib';
|
|
4
4
|
import FieldIcon from '../../../../asset/images/success_new/field_icon.webp';
|
|
5
|
-
const H3Contents = ({ h3Template }) => {
|
|
5
|
+
const H3Contents = ({ h3Template, faqCount }) => {
|
|
6
6
|
const { active_faq } = h3Template;
|
|
7
|
+
const getItemScope = () => {
|
|
8
|
+
if (active_faq === false && (faqCount === 0 || faqCount === undefined)) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
return undefined;
|
|
12
|
+
};
|
|
13
|
+
const getItemProp = (category) => {
|
|
14
|
+
if (active_faq === false && (faqCount === 0 || faqCount === undefined)) {
|
|
15
|
+
switch (category) {
|
|
16
|
+
case 'mainEntity':
|
|
17
|
+
return 'mainEntity';
|
|
18
|
+
case 'acceptedAnswer':
|
|
19
|
+
return 'acceptedAnswer';
|
|
20
|
+
case 'name':
|
|
21
|
+
return 'name';
|
|
22
|
+
case 'text':
|
|
23
|
+
return 'text';
|
|
24
|
+
default:
|
|
25
|
+
undefined;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
};
|
|
30
|
+
const getItemType = (category) => {
|
|
31
|
+
if (active_faq === false && (faqCount === 0 || faqCount === undefined)) {
|
|
32
|
+
switch (category) {
|
|
33
|
+
case 'question':
|
|
34
|
+
return 'https://schema.org/Question';
|
|
35
|
+
case 'answer':
|
|
36
|
+
return 'https://schema.org/Answer';
|
|
37
|
+
default:
|
|
38
|
+
undefined;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return undefined;
|
|
42
|
+
};
|
|
7
43
|
return (<>
|
|
8
|
-
<div className={'px-[10px] sm:px-[18px]'} key={'h3영역' + h3Template.idx} itemScope={
|
|
44
|
+
<div className={'px-[10px] sm:px-[18px]'} key={'h3영역' + h3Template.idx} itemScope={getItemScope()} itemProp={getItemProp('mainEntity')} itemType={getItemType('question')}>
|
|
9
45
|
{/*h3*/}
|
|
10
|
-
<h3 className={'mb-[16px] flex items-center break-keep text-[18px] font-bold tracking-[-0.96px] text-[#285FA7] sm:mb-[18px] sm:text-[22px] lg:mb-[22.5px] lg:text-[24px]'} id={h3Template.idx.toString()} itemProp={
|
|
46
|
+
<h3 className={'mb-[16px] flex items-center break-keep text-[18px] font-bold tracking-[-0.96px] text-[#285FA7] sm:mb-[18px] sm:text-[22px] lg:mb-[22.5px] lg:text-[24px]'} id={h3Template.idx.toString()} itemProp={getItemProp('name')}>
|
|
11
47
|
{/*모든 seo 체크로 변경*/}
|
|
12
48
|
<Image src={FieldIcon} alt={'h3 img'} width={27} height={26} className={'mr-[8px] h-auto max-sm:w-[22px]'}/>
|
|
13
49
|
{h3Template.tag_title}
|
|
14
50
|
</h3>
|
|
15
51
|
{/*h3 설명글*/}
|
|
16
|
-
<div itemScope={
|
|
17
|
-
<div className={'mb-[44px] whitespace-break-spaces text-[16px] tracking-[-0.69px] sm:mx-[20px] sm:mx-[33px] sm:mb-[50px] sm:text-[17.25px] lg:mb-[78px]'} itemProp={
|
|
52
|
+
<div itemScope={getItemScope()} itemProp={getItemProp('acceptedAnswer')} itemType={getItemType('answer')}>
|
|
53
|
+
<div className={'mb-[44px] whitespace-break-spaces text-[16px] tracking-[-0.69px] sm:mx-[20px] sm:mx-[33px] sm:mb-[50px] sm:text-[17.25px] lg:mb-[78px]'} itemProp={getItemProp('text')} id={'ck-content'} dangerouslySetInnerHTML={{
|
|
18
54
|
__html: htmlUrlDecode(h3Template.description.replace('../../UploadFile', '/SE2/upload'))
|
|
19
55
|
}}></div>
|
|
20
56
|
</div>
|
|
@@ -3,17 +3,63 @@ import Image from 'next/image';
|
|
|
3
3
|
import { ISeoTemplateTypes } from '../SuccessNewType';
|
|
4
4
|
import { htmlUrlDecode } from '../../../../lib';
|
|
5
5
|
import FieldIcon from '../../../../asset/images/success_new/field_icon.webp';
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
type ItemPropTypes = 'mainEntity' | 'acceptedAnswer' | 'name' | 'text';
|
|
8
|
+
type ItemTypes = 'question' | 'answer';
|
|
9
|
+
|
|
10
|
+
const H3Contents = ({ h3Template, faqCount }: { h3Template: ISeoTemplateTypes; faqCount?: number }) => {
|
|
7
11
|
const { active_faq } = h3Template;
|
|
8
12
|
|
|
13
|
+
const getItemScope = (): boolean | undefined => {
|
|
14
|
+
if (active_faq === false && ((faqCount as number) === 0 || faqCount === undefined)) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return undefined;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const getItemProp = (category: ItemPropTypes): string | undefined => {
|
|
22
|
+
if (active_faq === false && ((faqCount as number) === 0 || faqCount === undefined)) {
|
|
23
|
+
switch (category) {
|
|
24
|
+
case 'mainEntity':
|
|
25
|
+
return 'mainEntity';
|
|
26
|
+
case 'acceptedAnswer':
|
|
27
|
+
return 'acceptedAnswer';
|
|
28
|
+
case 'name':
|
|
29
|
+
return 'name';
|
|
30
|
+
case 'text':
|
|
31
|
+
return 'text';
|
|
32
|
+
default:
|
|
33
|
+
undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return undefined;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const getItemType = (category: ItemTypes): string | undefined => {
|
|
41
|
+
if (active_faq === false && ((faqCount as number) === 0 || faqCount === undefined)) {
|
|
42
|
+
switch (category) {
|
|
43
|
+
case 'question':
|
|
44
|
+
return 'https://schema.org/Question';
|
|
45
|
+
case 'answer':
|
|
46
|
+
return 'https://schema.org/Answer';
|
|
47
|
+
default:
|
|
48
|
+
undefined;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return undefined;
|
|
53
|
+
};
|
|
54
|
+
|
|
9
55
|
return (
|
|
10
56
|
<>
|
|
11
57
|
<div
|
|
12
58
|
className={'px-[10px] sm:px-[18px]'}
|
|
13
59
|
key={'h3영역' + h3Template.idx}
|
|
14
|
-
itemScope={
|
|
15
|
-
itemProp={
|
|
16
|
-
itemType={
|
|
60
|
+
itemScope={getItemScope()}
|
|
61
|
+
itemProp={getItemProp('mainEntity')}
|
|
62
|
+
itemType={getItemType('question')}
|
|
17
63
|
>
|
|
18
64
|
{/*h3*/}
|
|
19
65
|
<h3
|
|
@@ -21,7 +67,7 @@ const H3Contents = ({ h3Template }: { h3Template: ISeoTemplateTypes }) => {
|
|
|
21
67
|
'mb-[16px] flex items-center break-keep text-[18px] font-bold tracking-[-0.96px] text-[#285FA7] sm:mb-[18px] sm:text-[22px] lg:mb-[22.5px] lg:text-[24px]'
|
|
22
68
|
}
|
|
23
69
|
id={h3Template.idx.toString()}
|
|
24
|
-
itemProp={
|
|
70
|
+
itemProp={getItemProp('name')}
|
|
25
71
|
>
|
|
26
72
|
{/*모든 seo 체크로 변경*/}
|
|
27
73
|
<Image
|
|
@@ -35,15 +81,15 @@ const H3Contents = ({ h3Template }: { h3Template: ISeoTemplateTypes }) => {
|
|
|
35
81
|
</h3>
|
|
36
82
|
{/*h3 설명글*/}
|
|
37
83
|
<div
|
|
38
|
-
itemScope={
|
|
39
|
-
itemProp={
|
|
40
|
-
itemType={
|
|
84
|
+
itemScope={getItemScope()}
|
|
85
|
+
itemProp={getItemProp('acceptedAnswer')}
|
|
86
|
+
itemType={getItemType('answer')}
|
|
41
87
|
>
|
|
42
88
|
<div
|
|
43
89
|
className={
|
|
44
90
|
'mb-[44px] whitespace-break-spaces text-[16px] tracking-[-0.69px] sm:mx-[20px] sm:mx-[33px] sm:mb-[50px] sm:text-[17.25px] lg:mb-[78px]'
|
|
45
91
|
}
|
|
46
|
-
itemProp={
|
|
92
|
+
itemProp={getItemProp('text')}
|
|
47
93
|
id={'ck-content'}
|
|
48
94
|
dangerouslySetInnerHTML={{
|
|
49
95
|
__html: htmlUrlDecode(h3Template.description.replace('../../UploadFile', '/SE2/upload'))
|