@daeryun/dr_components 1.0.13 → 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 -30
- package/dist/components/page/LawInfoNew/LawInfoNew.tsx +8 -53
- 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,30 +74,9 @@ const LawInfoNew = ({ data, tel }) => {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}, [template]);
|
|
77
|
-
|
|
78
|
-
if (isFaqActive || faqCount >= 2) {
|
|
79
|
-
return undefined;
|
|
80
|
-
}
|
|
81
|
-
return 'https://schema.org/FAQPage';
|
|
82
|
-
};
|
|
83
|
-
const handleFaqItemScope = (isFaqActive, faqCount) => {
|
|
84
|
-
if (isFaqActive || faqCount >= 2) {
|
|
85
|
-
return undefined;
|
|
86
|
-
}
|
|
87
|
-
return true;
|
|
88
|
-
};
|
|
89
|
-
const convertFaqItemType = (template) => {
|
|
90
|
-
console.log('faqElementMaxCountInContents : ', faqElementMaxCountInContents);
|
|
91
|
-
if (faqElementMaxCountInContents >= 2) {
|
|
92
|
-
// 해당 게시글에 faqElementMaxCountInContents가 두 개 이상일 경우, template 내부에 FAQPage itemtype을 지운다. FAQPage 중복 이슈로 인한 코드임
|
|
93
|
-
template.description = template.description.replaceAll('<div itemscope="" itemtype="https://schema.org/FAQPage">', '<div>');
|
|
94
|
-
return template;
|
|
95
|
-
}
|
|
96
|
-
return template;
|
|
97
|
-
};
|
|
98
|
-
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}>
|
|
99
78
|
<div id={'sub_contents'}>
|
|
100
|
-
<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]">
|
|
101
80
|
<div className={'m-auto mt-[100px] flex gap-[120px] lg:mt-[5em] ' +
|
|
102
81
|
//1700px
|
|
103
82
|
'max-5xl:gap-[80px] ' +
|
|
@@ -123,18 +102,15 @@ const LawInfoNew = ({ data, tel }) => {
|
|
|
123
102
|
</div>
|
|
124
103
|
</div>
|
|
125
104
|
|
|
126
|
-
<article
|
|
127
|
-
? undefined
|
|
128
|
-
: 'https://schema.org/FAQPage'}>
|
|
105
|
+
<article>
|
|
129
106
|
{/*목차*/}
|
|
130
107
|
<ContentList template={template} h2List={h2List ? h2List : []} onScrollToElement={handleScrollToElement}/>
|
|
131
108
|
|
|
132
109
|
{/*h2*/}
|
|
133
110
|
{h2List &&
|
|
134
111
|
h2List.map((h2Template, index) => {
|
|
135
|
-
console.log('h2Template.faqCount : ', h2Template === null || h2Template === void 0 ? void 0 : h2Template.faqCount);
|
|
136
112
|
return (<section className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'} key={'h2영역' + h2Template.idx}>
|
|
137
|
-
<H2Contents h2Template={
|
|
113
|
+
<H2Contents h2Template={h2Template} index={index}/>
|
|
138
114
|
|
|
139
115
|
{/*h3*/}
|
|
140
116
|
{template
|
|
@@ -147,7 +123,7 @@ const LawInfoNew = ({ data, tel }) => {
|
|
|
147
123
|
const news_length = newsLinkList.length;
|
|
148
124
|
const news_content_length = newsLinkList.filter(i => i.tag_idx === h3Template.idx).length;
|
|
149
125
|
return (<>
|
|
150
|
-
<H3Contents h3Template={
|
|
126
|
+
<H3Contents h3Template={h3Template} key={'h3영역' + h3Template.idx}/>
|
|
151
127
|
{(refer_is_use &&
|
|
152
128
|
refer_length > 0 &&
|
|
153
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,45 +101,14 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
102
101
|
}
|
|
103
102
|
}, [template]);
|
|
104
103
|
|
|
105
|
-
const handleFaqItemType = (isFaqActive: boolean, faqCount: number): string | undefined => {
|
|
106
|
-
if (isFaqActive || faqCount >= 2) {
|
|
107
|
-
return undefined;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return 'https://schema.org/FAQPage';
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const handleFaqItemScope = (isFaqActive: boolean, faqCount: number): true | undefined => {
|
|
114
|
-
if (isFaqActive || faqCount >= 2) {
|
|
115
|
-
return undefined;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return true;
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const convertFaqItemType = (template: ISeoTemplateTypes): ISeoTemplateTypes => {
|
|
122
|
-
console.log('faqElementMaxCountInContents : ', faqElementMaxCountInContents);
|
|
123
|
-
if ((faqElementMaxCountInContents as number) >= 2) {
|
|
124
|
-
// 해당 게시글에 faqElementMaxCountInContents가 두 개 이상일 경우, template 내부에 FAQPage itemtype을 지운다. FAQPage 중복 이슈로 인한 코드임
|
|
125
|
-
template.description = template.description.replaceAll(
|
|
126
|
-
'<div itemscope="" itemtype="https://schema.org/FAQPage">',
|
|
127
|
-
'<div>'
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
return template;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return template;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
104
|
return (
|
|
137
105
|
<div
|
|
138
|
-
itemScope={
|
|
139
|
-
itemType={
|
|
106
|
+
itemScope={isFaqActive ? undefined : true}
|
|
107
|
+
itemType={isFaqActive ? undefined : 'https://schema.org/FAQPage'}
|
|
140
108
|
ref={printRef}
|
|
141
109
|
>
|
|
142
110
|
<div id={'sub_contents'}>
|
|
143
|
-
<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]">
|
|
144
112
|
<div
|
|
145
113
|
className={
|
|
146
114
|
'm-auto mt-[100px] flex gap-[120px] lg:mt-[5em] ' +
|
|
@@ -188,14 +156,7 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
188
156
|
</div>
|
|
189
157
|
</div>
|
|
190
158
|
|
|
191
|
-
<article
|
|
192
|
-
itemScope={(faqElementMaxCountInContents as number) >= 1 ? undefined : true}
|
|
193
|
-
itemType={
|
|
194
|
-
(faqElementMaxCountInContents as number) >= 1
|
|
195
|
-
? undefined
|
|
196
|
-
: 'https://schema.org/FAQPage'
|
|
197
|
-
}
|
|
198
|
-
>
|
|
159
|
+
<article>
|
|
199
160
|
{/*목차*/}
|
|
200
161
|
<ContentList
|
|
201
162
|
template={template}
|
|
@@ -206,17 +167,12 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
206
167
|
{/*h2*/}
|
|
207
168
|
{h2List &&
|
|
208
169
|
h2List.map((h2Template, index) => {
|
|
209
|
-
console.log('h2Template.faqCount : ', h2Template?.faqCount);
|
|
210
170
|
return (
|
|
211
171
|
<section
|
|
212
172
|
className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'}
|
|
213
173
|
key={'h2영역' + h2Template.idx}
|
|
214
174
|
>
|
|
215
|
-
<H2Contents
|
|
216
|
-
h2Template={convertFaqItemType(h2Template)}
|
|
217
|
-
index={index}
|
|
218
|
-
faqCount={h2Template.faqCount}
|
|
219
|
-
/>
|
|
175
|
+
<H2Contents h2Template={h2Template} index={index} />
|
|
220
176
|
|
|
221
177
|
{/*h3*/}
|
|
222
178
|
{template
|
|
@@ -237,9 +193,8 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
237
193
|
return (
|
|
238
194
|
<>
|
|
239
195
|
<H3Contents
|
|
240
|
-
h3Template={
|
|
196
|
+
h3Template={h3Template}
|
|
241
197
|
key={'h3영역' + h3Template.idx}
|
|
242
|
-
faqCount={h3Template.faqCount}
|
|
243
198
|
/>
|
|
244
199
|
{(refer_is_use &&
|
|
245
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'))
|