@daeryun/dr_components 1.0.14 → 1.0.15
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/page/LawInfoNew/LawInfoNew.jsx +6 -36
- package/dist/components/page/LawInfoNew/LawInfoNew.tsx +8 -61
- package/dist/components/page/SuccessNew/components/H2Contents.d.ts +1 -2
- package/dist/components/page/SuccessNew/components/H2Contents.jsx +6 -44
- package/dist/components/page/SuccessNew/components/H2Contents.tsx +12 -64
- package/dist/components/page/SuccessNew/components/H3Contents.d.ts +1 -2
- package/dist/components/page/SuccessNew/components/H3Contents.jsx +5 -43
- package/dist/components/page/SuccessNew/components/H3Contents.tsx +9 -57
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ import Image from 'next/image';
|
|
|
19
19
|
import Arrow from '../../../asset/images/success_new/left.webp';
|
|
20
20
|
import RightArrow from '../../../asset/images/success_new/right.webp';
|
|
21
21
|
const LawInfoNew = ({ data, tel }) => {
|
|
22
|
-
const { template, contentsList, h2List, lawyerData, fieldData, successData, groupTopTenLawyerList, referenceLinkList, newsLinkList, shortsLinkList, youtubeLinkList, initialData, nextPost, prevPost
|
|
22
|
+
const { template, contentsList, h2List, lawyerData, fieldData, successData, groupTopTenLawyerList, referenceLinkList, newsLinkList, shortsLinkList, youtubeLinkList, initialData, nextPost, prevPost } = data;
|
|
23
23
|
const { width } = useBrowser(true);
|
|
24
24
|
const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState(lawyerData);
|
|
25
25
|
const [isFaqActive, setIsFaqActive] = useState(false);
|
|
@@ -74,36 +74,9 @@ const LawInfoNew = ({ data, tel }) => {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}, [template]);
|
|
77
|
-
|
|
78
|
-
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
79
|
-
return undefined;
|
|
80
|
-
}
|
|
81
|
-
if (isFaqActive && faqElementMaxCountInContents >= 2) {
|
|
82
|
-
return 'https://schema.org/FAQPage';
|
|
83
|
-
}
|
|
84
|
-
return 'https://schema.org/FAQPage';
|
|
85
|
-
};
|
|
86
|
-
const handleFaqItemScope = (isFaqActive, faqElementMaxCountInContents) => {
|
|
87
|
-
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
88
|
-
return undefined;
|
|
89
|
-
}
|
|
90
|
-
if (isFaqActive && faqElementMaxCountInContents >= 2) {
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
return true;
|
|
94
|
-
};
|
|
95
|
-
const convertFaqItemType = (template) => {
|
|
96
|
-
console.log('faqElementMaxCountInContents : ', faqElementMaxCountInContents);
|
|
97
|
-
if (faqElementMaxCountInContents >= 2) {
|
|
98
|
-
// 해당 게시글에 faqElementMaxCountInContents가 두 개 이상일 경우, template 내부에 FAQPage itemtype을 지운다. FAQPage 중복 이슈로 인한 코드임
|
|
99
|
-
template.description = template.description.replaceAll('<div itemscope="" itemtype="https://schema.org/FAQPage">', '<div>');
|
|
100
|
-
return template;
|
|
101
|
-
}
|
|
102
|
-
return template;
|
|
103
|
-
};
|
|
104
|
-
return (<div itemScope={handleFaqItemScope(isFaqActive, faqElementMaxCountInContents)} itemType={handleFaqItemType(isFaqActive, faqElementMaxCountInContents)} ref={printRef}>
|
|
77
|
+
return (<div itemScope={isFaqActive ? undefined : true} itemType={isFaqActive ? undefined : 'https://schema.org/FAQPage'} ref={printRef}>
|
|
105
78
|
<div id={'sub_contents'}>
|
|
106
|
-
<div className="relative m-auto mb-[60px] w-[90%] max-w-screen-2xl
|
|
79
|
+
<div className="font-[SUIT]] relative m-auto mb-[60px] w-[90%] max-w-screen-2xl max-xs:mb-[30px]">
|
|
107
80
|
<div className={'m-auto mt-[100px] flex gap-[120px] lg:mt-[5em] ' +
|
|
108
81
|
//1700px
|
|
109
82
|
'max-5xl:gap-[80px] ' +
|
|
@@ -129,18 +102,15 @@ const LawInfoNew = ({ data, tel }) => {
|
|
|
129
102
|
</div>
|
|
130
103
|
</div>
|
|
131
104
|
|
|
132
|
-
<article
|
|
133
|
-
? undefined
|
|
134
|
-
: 'https://schema.org/FAQPage'}>
|
|
105
|
+
<article>
|
|
135
106
|
{/*목차*/}
|
|
136
107
|
<ContentList template={template} h2List={h2List ? h2List : []} onScrollToElement={handleScrollToElement}/>
|
|
137
108
|
|
|
138
109
|
{/*h2*/}
|
|
139
110
|
{h2List &&
|
|
140
111
|
h2List.map((h2Template, index) => {
|
|
141
|
-
console.log('h2Template.faqCount : ', h2Template === null || h2Template === void 0 ? void 0 : h2Template.faqCount);
|
|
142
112
|
return (<section className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'} key={'h2영역' + h2Template.idx}>
|
|
143
|
-
<H2Contents h2Template={
|
|
113
|
+
<H2Contents h2Template={h2Template} index={index}/>
|
|
144
114
|
|
|
145
115
|
{/*h3*/}
|
|
146
116
|
{template
|
|
@@ -153,7 +123,7 @@ const LawInfoNew = ({ data, tel }) => {
|
|
|
153
123
|
const news_length = newsLinkList.length;
|
|
154
124
|
const news_content_length = newsLinkList.filter(i => i.tag_idx === h3Template.idx).length;
|
|
155
125
|
return (<>
|
|
156
|
-
<H3Contents h3Template={
|
|
126
|
+
<H3Contents h3Template={h3Template} key={'h3영역' + h3Template.idx}/>
|
|
157
127
|
{(refer_is_use &&
|
|
158
128
|
refer_length > 0 &&
|
|
159
129
|
refer_content_length > 0) ||
|
|
@@ -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
|
|
6
|
+
import { ILawyerTypes } 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,8 +38,7 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
38
38
|
youtubeLinkList,
|
|
39
39
|
initialData,
|
|
40
40
|
nextPost,
|
|
41
|
-
prevPost
|
|
42
|
-
faqElementMaxCountInContents
|
|
41
|
+
prevPost
|
|
43
42
|
} = data;
|
|
44
43
|
const { width } = useBrowser(true);
|
|
45
44
|
const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState<ILawyerTypes[]>(lawyerData);
|
|
@@ -102,53 +101,14 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
102
101
|
}
|
|
103
102
|
}, [template]);
|
|
104
103
|
|
|
105
|
-
const handleFaqItemType = (isFaqActive: boolean, faqElementMaxCountInContents: number): string | undefined => {
|
|
106
|
-
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
107
|
-
return undefined;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (isFaqActive && faqElementMaxCountInContents >= 2) {
|
|
111
|
-
return 'https://schema.org/FAQPage';
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return 'https://schema.org/FAQPage';
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
const handleFaqItemScope = (isFaqActive: boolean, faqElementMaxCountInContents: number): true | undefined => {
|
|
118
|
-
if (isFaqActive && faqElementMaxCountInContents === 0) {
|
|
119
|
-
return undefined;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (isFaqActive && faqElementMaxCountInContents >= 2) {
|
|
123
|
-
return true;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return true;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
const convertFaqItemType = (template: ISeoTemplateTypes): ISeoTemplateTypes => {
|
|
130
|
-
console.log('faqElementMaxCountInContents : ', faqElementMaxCountInContents);
|
|
131
|
-
if ((faqElementMaxCountInContents as number) >= 2) {
|
|
132
|
-
// 해당 게시글에 faqElementMaxCountInContents가 두 개 이상일 경우, template 내부에 FAQPage itemtype을 지운다. FAQPage 중복 이슈로 인한 코드임
|
|
133
|
-
template.description = template.description.replaceAll(
|
|
134
|
-
'<div itemscope="" itemtype="https://schema.org/FAQPage">',
|
|
135
|
-
'<div>'
|
|
136
|
-
);
|
|
137
|
-
|
|
138
|
-
return template;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return template;
|
|
142
|
-
};
|
|
143
|
-
|
|
144
104
|
return (
|
|
145
105
|
<div
|
|
146
|
-
itemScope={
|
|
147
|
-
itemType={
|
|
106
|
+
itemScope={isFaqActive ? undefined : true}
|
|
107
|
+
itemType={isFaqActive ? undefined : 'https://schema.org/FAQPage'}
|
|
148
108
|
ref={printRef}
|
|
149
109
|
>
|
|
150
110
|
<div id={'sub_contents'}>
|
|
151
|
-
<div className="relative m-auto mb-[60px] w-[90%] max-w-screen-2xl
|
|
111
|
+
<div className="font-[SUIT]] relative m-auto mb-[60px] w-[90%] max-w-screen-2xl max-xs:mb-[30px]">
|
|
152
112
|
<div
|
|
153
113
|
className={
|
|
154
114
|
'm-auto mt-[100px] flex gap-[120px] lg:mt-[5em] ' +
|
|
@@ -196,14 +156,7 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
196
156
|
</div>
|
|
197
157
|
</div>
|
|
198
158
|
|
|
199
|
-
<article
|
|
200
|
-
itemScope={(faqElementMaxCountInContents as number) >= 1 ? undefined : true}
|
|
201
|
-
itemType={
|
|
202
|
-
(faqElementMaxCountInContents as number) >= 1
|
|
203
|
-
? undefined
|
|
204
|
-
: 'https://schema.org/FAQPage'
|
|
205
|
-
}
|
|
206
|
-
>
|
|
159
|
+
<article>
|
|
207
160
|
{/*목차*/}
|
|
208
161
|
<ContentList
|
|
209
162
|
template={template}
|
|
@@ -214,17 +167,12 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
214
167
|
{/*h2*/}
|
|
215
168
|
{h2List &&
|
|
216
169
|
h2List.map((h2Template, index) => {
|
|
217
|
-
console.log('h2Template.faqCount : ', h2Template?.faqCount);
|
|
218
170
|
return (
|
|
219
171
|
<section
|
|
220
172
|
className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'}
|
|
221
173
|
key={'h2영역' + h2Template.idx}
|
|
222
174
|
>
|
|
223
|
-
<H2Contents
|
|
224
|
-
h2Template={convertFaqItemType(h2Template)}
|
|
225
|
-
index={index}
|
|
226
|
-
faqCount={h2Template.faqCount}
|
|
227
|
-
/>
|
|
175
|
+
<H2Contents h2Template={h2Template} index={index} />
|
|
228
176
|
|
|
229
177
|
{/*h3*/}
|
|
230
178
|
{template
|
|
@@ -245,9 +193,8 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
245
193
|
return (
|
|
246
194
|
<>
|
|
247
195
|
<H3Contents
|
|
248
|
-
h3Template={
|
|
196
|
+
h3Template={h3Template}
|
|
249
197
|
key={'h3영역' + h3Template.idx}
|
|
250
|
-
faqCount={h3Template.faqCount}
|
|
251
198
|
/>
|
|
252
199
|
{(refer_is_use &&
|
|
253
200
|
refer_length > 0 &&
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ISeoTemplateTypes } from '../SuccessNewType';
|
|
3
|
-
declare const H2Contents: ({ h2Template, index
|
|
3
|
+
declare const H2Contents: ({ h2Template, index }: {
|
|
4
4
|
h2Template: ISeoTemplateTypes;
|
|
5
5
|
index: number;
|
|
6
|
-
faqCount?: number;
|
|
7
6
|
}) => React.JSX.Element;
|
|
8
7
|
export default H2Contents;
|
|
@@ -1,55 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { htmlUrlDecode } from '../../../../lib';
|
|
3
|
-
const H2Contents = ({ h2Template, index
|
|
3
|
+
const H2Contents = ({ h2Template, index }) => {
|
|
4
4
|
const { active_faq } = h2Template;
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
};
|
|
43
|
-
return (<div itemScope={getItemScope()} itemProp={getItemProp('mainEntity')} itemType={getItemType('question')}>
|
|
44
|
-
<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')}>
|
|
5
|
+
return (<div itemScope={active_faq ? undefined : true} itemProp={active_faq ? '' : 'mainEntity'} itemType={active_faq ? '' : 'https://schema.org/Question'}>
|
|
6
|
+
<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={active_faq ? '' : 'name'}>
|
|
45
7
|
{index + 1}. {h2Template.tag_title}
|
|
46
8
|
</h2>
|
|
47
9
|
<div className={'px-[10px] sm:px-[18px]'}>
|
|
48
10
|
{/*h2 설명글*/}
|
|
49
|
-
<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={
|
|
50
|
-
{h2Template.is_editor ? (<div itemProp={
|
|
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={active_faq ? undefined : true} itemProp={active_faq ? '' : 'acceptedAnswer'} itemType={active_faq ? '' : 'https://schema.org/Answer'}>
|
|
12
|
+
{h2Template.is_editor ? (<div itemProp={active_faq ? '' : 'text'} id={'ck-content'} dangerouslySetInnerHTML={{
|
|
51
13
|
__html: htmlUrlDecode(h2Template.description.replace('../../UploadFile', '/SE2/upload'))
|
|
52
|
-
}}/>) : (<div itemProp={
|
|
14
|
+
}}/>) : (<div itemProp={active_faq ? '' : 'text'}>{h2Template.description}</div>)}
|
|
53
15
|
</div>
|
|
54
16
|
</div>
|
|
55
17
|
</div>);
|
|
@@ -1,73 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ISeoTemplateTypes } from '../SuccessNewType';
|
|
3
3
|
import { htmlUrlDecode } from '../../../../lib';
|
|
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
|
-
}) => {
|
|
4
|
+
const H2Contents = ({ h2Template, index }: { h2Template: ISeoTemplateTypes; index: number }) => {
|
|
17
5
|
const { active_faq } = h2Template;
|
|
18
|
-
console.log('h2 active_faq :', active_faq);
|
|
19
|
-
console.log('h2 faqCount :', faqCount);
|
|
20
|
-
|
|
21
|
-
const getItemScope = (): boolean | undefined => {
|
|
22
|
-
if (active_faq === false && ((faqCount as number) === 0 || faqCount === undefined)) {
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return undefined;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const getItemProp = (category: ItemPropTypes): string | undefined => {
|
|
30
|
-
if (active_faq === false && ((faqCount as number) === 0 || faqCount === undefined)) {
|
|
31
|
-
switch (category) {
|
|
32
|
-
case 'mainEntity':
|
|
33
|
-
return 'mainEntity';
|
|
34
|
-
case 'acceptedAnswer':
|
|
35
|
-
return 'acceptedAnswer';
|
|
36
|
-
case 'name':
|
|
37
|
-
return 'name';
|
|
38
|
-
case 'text':
|
|
39
|
-
return 'text';
|
|
40
|
-
default:
|
|
41
|
-
undefined;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return undefined;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const getItemType = (category: ItemTypes): string | undefined => {
|
|
49
|
-
if (active_faq === false && ((faqCount as number) === 0 || faqCount === undefined)) {
|
|
50
|
-
switch (category) {
|
|
51
|
-
case 'question':
|
|
52
|
-
return 'https://schema.org/Question';
|
|
53
|
-
case 'answer':
|
|
54
|
-
return 'https://schema.org/Answer';
|
|
55
|
-
default:
|
|
56
|
-
undefined;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return undefined;
|
|
61
|
-
};
|
|
62
6
|
|
|
63
7
|
return (
|
|
64
|
-
<div
|
|
8
|
+
<div
|
|
9
|
+
itemScope={active_faq ? undefined : true}
|
|
10
|
+
itemProp={active_faq ? '' : 'mainEntity'}
|
|
11
|
+
itemType={active_faq ? '' : 'https://schema.org/Question'}
|
|
12
|
+
>
|
|
65
13
|
<h2
|
|
66
14
|
className={
|
|
67
15
|
'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]'
|
|
68
16
|
}
|
|
69
17
|
id={h2Template.idx.toString()}
|
|
70
|
-
itemProp={
|
|
18
|
+
itemProp={active_faq ? '' : 'name'}
|
|
71
19
|
>
|
|
72
20
|
{index + 1}. {h2Template.tag_title}
|
|
73
21
|
</h2>
|
|
@@ -77,20 +25,20 @@ const H2Contents = ({
|
|
|
77
25
|
className={
|
|
78
26
|
'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]'
|
|
79
27
|
}
|
|
80
|
-
itemScope={
|
|
81
|
-
itemProp={
|
|
82
|
-
itemType={
|
|
28
|
+
itemScope={active_faq ? undefined : true}
|
|
29
|
+
itemProp={active_faq ? '' : 'acceptedAnswer'}
|
|
30
|
+
itemType={active_faq ? '' : 'https://schema.org/Answer'}
|
|
83
31
|
>
|
|
84
32
|
{h2Template.is_editor ? (
|
|
85
33
|
<div
|
|
86
|
-
itemProp={
|
|
34
|
+
itemProp={active_faq ? '' : 'text'}
|
|
87
35
|
id={'ck-content'}
|
|
88
36
|
dangerouslySetInnerHTML={{
|
|
89
37
|
__html: htmlUrlDecode(h2Template.description.replace('../../UploadFile', '/SE2/upload'))
|
|
90
38
|
}}
|
|
91
39
|
/>
|
|
92
40
|
) : (
|
|
93
|
-
<div itemProp={
|
|
41
|
+
<div itemProp={active_faq ? '' : 'text'}>{h2Template.description}</div>
|
|
94
42
|
)}
|
|
95
43
|
</div>
|
|
96
44
|
</div>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ISeoTemplateTypes } from '../SuccessNewType';
|
|
3
|
-
declare const H3Contents: ({ h3Template
|
|
3
|
+
declare const H3Contents: ({ h3Template }: {
|
|
4
4
|
h3Template: ISeoTemplateTypes;
|
|
5
|
-
faqCount?: number;
|
|
6
5
|
}) => React.JSX.Element;
|
|
7
6
|
export default H3Contents;
|
|
@@ -2,57 +2,19 @@ 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 }) => {
|
|
6
6
|
const { active_faq } = h3Template;
|
|
7
|
-
console.log('h3 active_faq :', active_faq);
|
|
8
|
-
console.log('h3 faqCount :', faqCount);
|
|
9
|
-
const getItemScope = () => {
|
|
10
|
-
if (active_faq === false && (faqCount === 0 || faqCount === undefined)) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
return undefined;
|
|
14
|
-
};
|
|
15
|
-
const getItemProp = (category) => {
|
|
16
|
-
if (active_faq === false && (faqCount === 0 || faqCount === undefined)) {
|
|
17
|
-
switch (category) {
|
|
18
|
-
case 'mainEntity':
|
|
19
|
-
return 'mainEntity';
|
|
20
|
-
case 'acceptedAnswer':
|
|
21
|
-
return 'acceptedAnswer';
|
|
22
|
-
case 'name':
|
|
23
|
-
return 'name';
|
|
24
|
-
case 'text':
|
|
25
|
-
return 'text';
|
|
26
|
-
default:
|
|
27
|
-
undefined;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return undefined;
|
|
31
|
-
};
|
|
32
|
-
const getItemType = (category) => {
|
|
33
|
-
if (active_faq === false && (faqCount === 0 || faqCount === undefined)) {
|
|
34
|
-
switch (category) {
|
|
35
|
-
case 'question':
|
|
36
|
-
return 'https://schema.org/Question';
|
|
37
|
-
case 'answer':
|
|
38
|
-
return 'https://schema.org/Answer';
|
|
39
|
-
default:
|
|
40
|
-
undefined;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return undefined;
|
|
44
|
-
};
|
|
45
7
|
return (<>
|
|
46
|
-
<div className={'px-[10px] sm:px-[18px]'} key={'h3영역' + h3Template.idx} itemScope={
|
|
8
|
+
<div className={'px-[10px] sm:px-[18px]'} key={'h3영역' + h3Template.idx} itemScope={active_faq ? undefined : true} itemProp={active_faq ? '' : 'mainEntity'} itemType={active_faq ? '' : 'https://schema.org/Question'}>
|
|
47
9
|
{/*h3*/}
|
|
48
|
-
<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={
|
|
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={active_faq ? '' : 'name'}>
|
|
49
11
|
{/*모든 seo 체크로 변경*/}
|
|
50
12
|
<Image src={FieldIcon} alt={'h3 img'} width={27} height={26} className={'mr-[8px] h-auto max-sm:w-[22px]'}/>
|
|
51
13
|
{h3Template.tag_title}
|
|
52
14
|
</h3>
|
|
53
15
|
{/*h3 설명글*/}
|
|
54
|
-
<div itemScope={
|
|
55
|
-
<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={
|
|
16
|
+
<div itemScope={active_faq ? undefined : true} itemProp={active_faq ? '' : 'acceptedAnswer'} itemType={active_faq ? '' : 'https://schema.org/Answer'}>
|
|
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={active_faq ? '' : 'text'} id={'ck-content'} dangerouslySetInnerHTML={{
|
|
56
18
|
__html: htmlUrlDecode(h3Template.description.replace('../../UploadFile', '/SE2/upload'))
|
|
57
19
|
}}></div>
|
|
58
20
|
</div>
|
|
@@ -3,65 +3,17 @@ 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
|
-
|
|
7
|
-
type ItemPropTypes = 'mainEntity' | 'acceptedAnswer' | 'name' | 'text';
|
|
8
|
-
type ItemTypes = 'question' | 'answer';
|
|
9
|
-
|
|
10
|
-
const H3Contents = ({ h3Template, faqCount }: { h3Template: ISeoTemplateTypes; faqCount?: number }) => {
|
|
6
|
+
const H3Contents = ({ h3Template }: { h3Template: ISeoTemplateTypes }) => {
|
|
11
7
|
const { active_faq } = h3Template;
|
|
12
|
-
console.log('h3 active_faq :', active_faq);
|
|
13
|
-
console.log('h3 faqCount :', faqCount);
|
|
14
|
-
|
|
15
|
-
const getItemScope = (): boolean | undefined => {
|
|
16
|
-
if (active_faq === false && ((faqCount as number) === 0 || faqCount === undefined)) {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return undefined;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const getItemProp = (category: ItemPropTypes): string | undefined => {
|
|
24
|
-
if (active_faq === false && ((faqCount as number) === 0 || faqCount === undefined)) {
|
|
25
|
-
switch (category) {
|
|
26
|
-
case 'mainEntity':
|
|
27
|
-
return 'mainEntity';
|
|
28
|
-
case 'acceptedAnswer':
|
|
29
|
-
return 'acceptedAnswer';
|
|
30
|
-
case 'name':
|
|
31
|
-
return 'name';
|
|
32
|
-
case 'text':
|
|
33
|
-
return 'text';
|
|
34
|
-
default:
|
|
35
|
-
undefined;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return undefined;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const getItemType = (category: ItemTypes): string | undefined => {
|
|
43
|
-
if (active_faq === false && ((faqCount as number) === 0 || faqCount === undefined)) {
|
|
44
|
-
switch (category) {
|
|
45
|
-
case 'question':
|
|
46
|
-
return 'https://schema.org/Question';
|
|
47
|
-
case 'answer':
|
|
48
|
-
return 'https://schema.org/Answer';
|
|
49
|
-
default:
|
|
50
|
-
undefined;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return undefined;
|
|
55
|
-
};
|
|
56
8
|
|
|
57
9
|
return (
|
|
58
10
|
<>
|
|
59
11
|
<div
|
|
60
12
|
className={'px-[10px] sm:px-[18px]'}
|
|
61
13
|
key={'h3영역' + h3Template.idx}
|
|
62
|
-
itemScope={
|
|
63
|
-
itemProp={
|
|
64
|
-
itemType={
|
|
14
|
+
itemScope={active_faq ? undefined : true}
|
|
15
|
+
itemProp={active_faq ? '' : 'mainEntity'}
|
|
16
|
+
itemType={active_faq ? '' : 'https://schema.org/Question'}
|
|
65
17
|
>
|
|
66
18
|
{/*h3*/}
|
|
67
19
|
<h3
|
|
@@ -69,7 +21,7 @@ const H3Contents = ({ h3Template, faqCount }: { h3Template: ISeoTemplateTypes; f
|
|
|
69
21
|
'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]'
|
|
70
22
|
}
|
|
71
23
|
id={h3Template.idx.toString()}
|
|
72
|
-
itemProp={
|
|
24
|
+
itemProp={active_faq ? '' : 'name'}
|
|
73
25
|
>
|
|
74
26
|
{/*모든 seo 체크로 변경*/}
|
|
75
27
|
<Image
|
|
@@ -83,15 +35,15 @@ const H3Contents = ({ h3Template, faqCount }: { h3Template: ISeoTemplateTypes; f
|
|
|
83
35
|
</h3>
|
|
84
36
|
{/*h3 설명글*/}
|
|
85
37
|
<div
|
|
86
|
-
itemScope={
|
|
87
|
-
itemProp={
|
|
88
|
-
itemType={
|
|
38
|
+
itemScope={active_faq ? undefined : true}
|
|
39
|
+
itemProp={active_faq ? '' : 'acceptedAnswer'}
|
|
40
|
+
itemType={active_faq ? '' : 'https://schema.org/Answer'}
|
|
89
41
|
>
|
|
90
42
|
<div
|
|
91
43
|
className={
|
|
92
44
|
'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]'
|
|
93
45
|
}
|
|
94
|
-
itemProp={
|
|
46
|
+
itemProp={active_faq ? '' : 'text'}
|
|
95
47
|
id={'ck-content'}
|
|
96
48
|
dangerouslySetInnerHTML={{
|
|
97
49
|
__html: htmlUrlDecode(h3Template.description.replace('../../UploadFile', '/SE2/upload'))
|