@daeryun/dr_components 0.9.79 → 0.9.81

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.
@@ -74,20 +74,18 @@ const LawInfoNew = ({ data, tel }) => {
74
74
  }
75
75
  }
76
76
  }, [template]);
77
- console.log('faqCount : ', faqCount);
78
77
  const handleFaqItemType = (isFaqActive, faqCount) => {
79
- let isActive = faqCount >= 2 ? true : false;
80
- if (isFaqActive || isActive) {
81
- return 'https://schema.org/FAQPage';
78
+ if (isFaqActive || faqCount >= 2) {
79
+ return undefined;
82
80
  }
83
- return undefined;
81
+ return 'https://schema.org/FAQPage';
84
82
  };
85
83
  const handleFaqItemScope = (isFaqActive, faqCount) => {
86
- let isActive = faqCount >= 2 ? true : false;
87
- if (isFaqActive || isActive) {
88
- return true;
84
+ // isFaqActive가 true이거나 faqCount가 2 이상인 경우
85
+ if (isFaqActive || faqCount >= 2) {
86
+ return undefined;
89
87
  }
90
- return undefined;
88
+ return true;
91
89
  };
92
90
  const convertFaqItemType = (template) => {
93
91
  if (faqCount >= 2) {
@@ -107,6 +105,11 @@ const LawInfoNew = ({ data, tel }) => {
107
105
  }
108
106
  return template;
109
107
  };
108
+ // Microdata 설정 확인
109
+ console.log('isFaqActive:', isFaqActive);
110
+ console.log('faqCount : ', faqCount);
111
+ console.log('itemType:', handleFaqItemType(isFaqActive, faqCount));
112
+ console.log('itemScope:', handleFaqItemScope(isFaqActive, faqCount));
110
113
  return (<div itemScope={handleFaqItemScope(isFaqActive, faqCount)} itemType={handleFaqItemType(isFaqActive, faqCount)} ref={printRef}>
111
114
  <div id={'sub_contents'}>
112
115
  <div className="font-[SUIT]] relative m-auto mb-[60px] w-[90%] max-w-screen-2xl max-xs:mb-[30px]">
@@ -142,7 +145,7 @@ const LawInfoNew = ({ data, tel }) => {
142
145
  {/*h2*/}
143
146
  {h2List &&
144
147
  h2List.map((h2Template, index) => {
145
- return (<section className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'} key={'h2영역' + h2Template.idx}>
148
+ return (<section className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'} key={'h2영역' + h2Template.idx} itemScope={faqCount >= 2 ? undefined : true} itemType={faqCount >= 2 ? undefined : 'https://schema.org/FAQPage'}>
146
149
  <H2Contents h2Template={convertFaqItemType(h2Template)} index={index} faqCount={faqCount}/>
147
150
 
148
151
  {/*h3*/}
@@ -102,26 +102,21 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
102
102
  }
103
103
  }, [template]);
104
104
 
105
- console.log('faqCount : ', faqCount);
106
-
107
105
  const handleFaqItemType = (isFaqActive: boolean, faqCount: number): string | undefined => {
108
- let isActive = faqCount >= 2 ? true : false;
109
-
110
- if (isFaqActive || isActive) {
111
- return 'https://schema.org/FAQPage';
106
+ if (isFaqActive || faqCount >= 2) {
107
+ return undefined;
112
108
  }
113
109
 
114
- return undefined;
110
+ return 'https://schema.org/FAQPage';
115
111
  };
116
112
 
117
- const handleFaqItemScope = (isFaqActive: boolean, faqCount: number): boolean | undefined => {
118
- let isActive = faqCount >= 2 ? true : false;
119
-
120
- if (isFaqActive || isActive) {
121
- return true;
113
+ const handleFaqItemScope = (isFaqActive: boolean, faqCount: number): true | undefined => {
114
+ // isFaqActive가 true이거나 faqCount가 2 이상인 경우
115
+ if (isFaqActive || faqCount >= 2) {
116
+ return undefined;
122
117
  }
123
118
 
124
- return undefined;
119
+ return true;
125
120
  };
126
121
 
127
122
  const convertFaqItemType = (template: ISeoTemplateTypes): ISeoTemplateTypes => {
@@ -145,6 +140,12 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
145
140
  return template;
146
141
  };
147
142
 
143
+ // Microdata 설정 확인
144
+ console.log('isFaqActive:', isFaqActive);
145
+ console.log('faqCount : ', faqCount);
146
+ console.log('itemType:', handleFaqItemType(isFaqActive, faqCount as number));
147
+ console.log('itemScope:', handleFaqItemScope(isFaqActive, faqCount as number));
148
+
148
149
  return (
149
150
  <div
150
151
  itemScope={handleFaqItemScope(isFaqActive, faqCount as number)}
@@ -215,6 +216,8 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
215
216
  <section
216
217
  className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'}
217
218
  key={'h2영역' + h2Template.idx}
219
+ itemScope={faqCount as number >= 2 ? undefined : true}
220
+ itemType={faqCount as number >= 2 ? undefined : 'https://schema.org/FAQPage'}
218
221
  >
219
222
  <H2Contents h2Template={convertFaqItemType(h2Template)} index={index} faqCount={faqCount as number} />
220
223