@daeryun/dr_components 0.9.76 → 0.9.77
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.
|
@@ -82,6 +82,13 @@ const LawInfoNew = ({ data, tel }) => {
|
|
|
82
82
|
}
|
|
83
83
|
return undefined;
|
|
84
84
|
};
|
|
85
|
+
const handleFaqItemScope = (isFaqActive, faqCount) => {
|
|
86
|
+
let isActive = faqCount >= 2 ? true : false;
|
|
87
|
+
if (isFaqActive || isActive) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
return undefined;
|
|
91
|
+
};
|
|
85
92
|
const convertFaqItemType = (template) => {
|
|
86
93
|
if (faqCount >= 2) {
|
|
87
94
|
template.description = template.description.replaceAll('itemtype="https://schema.org/FAQPage"', '');
|
|
@@ -90,7 +97,7 @@ const LawInfoNew = ({ data, tel }) => {
|
|
|
90
97
|
}
|
|
91
98
|
return template;
|
|
92
99
|
};
|
|
93
|
-
return (<div itemScope={isFaqActive
|
|
100
|
+
return (<div itemScope={handleFaqItemScope(isFaqActive, faqCount)} itemType={handleFaqItemType(isFaqActive, faqCount)} ref={printRef}>
|
|
94
101
|
<div id={'sub_contents'}>
|
|
95
102
|
<div className="font-[SUIT]] relative m-auto mb-[60px] w-[90%] max-w-screen-2xl max-xs:mb-[30px]">
|
|
96
103
|
<div className={'m-auto mt-[100px] flex gap-[120px] lg:mt-[5em] ' +
|
|
@@ -104,7 +104,7 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
104
104
|
|
|
105
105
|
console.log('faqCount : ', faqCount);
|
|
106
106
|
|
|
107
|
-
const handleFaqItemType = (isFaqActive: boolean, faqCount: number) => {
|
|
107
|
+
const handleFaqItemType = (isFaqActive: boolean, faqCount: number): string | undefined => {
|
|
108
108
|
let isActive = faqCount >= 2 ? true : false;
|
|
109
109
|
|
|
110
110
|
if (isFaqActive || isActive) {
|
|
@@ -114,7 +114,17 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
114
114
|
return undefined;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
const
|
|
117
|
+
const handleFaqItemScope = (isFaqActive: boolean, faqCount: number): boolean | undefined => {
|
|
118
|
+
let isActive = faqCount >= 2 ? true : false;
|
|
119
|
+
|
|
120
|
+
if (isFaqActive || isActive) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return undefined;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const convertFaqItemType = (template: ISeoTemplateTypes): ISeoTemplateTypes => {
|
|
118
128
|
if (faqCount as number >= 2) {
|
|
119
129
|
template.description = template.description.replaceAll('itemtype="https://schema.org/FAQPage"', '');
|
|
120
130
|
console.log('변경된 template : ', template);
|
|
@@ -126,7 +136,7 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
126
136
|
|
|
127
137
|
return (
|
|
128
138
|
<div
|
|
129
|
-
itemScope={isFaqActive
|
|
139
|
+
itemScope={handleFaqItemScope(isFaqActive, faqCount as number)}
|
|
130
140
|
itemType={handleFaqItemType(isFaqActive, faqCount as number)}
|
|
131
141
|
ref={printRef}
|
|
132
142
|
>
|