@daeryun/dr_components 0.9.89 → 0.9.91

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.
@@ -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, faqCount } = data;
22
+ const { template, contentsList, h2List, lawyerData, fieldData, successData, groupTopTenLawyerList, referenceLinkList, newsLinkList, shortsLinkList, youtubeLinkList, initialData, nextPost, prevPost, faqElementMaxCountInContents } = data;
23
23
  const { width } = useBrowser(true);
24
24
  const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState(lawyerData);
25
25
  const [isFaqActive, setIsFaqActive] = useState(false);
@@ -88,13 +88,14 @@ const LawInfoNew = ({ data, tel }) => {
88
88
  return true;
89
89
  };
90
90
  const convertFaqItemType = (template) => {
91
- if (faqCount >= 2) {
91
+ console.log('faqElementMaxCountInContents : ', faqElementMaxCountInContents);
92
+ if (faqElementMaxCountInContents >= 2) {
92
93
  template.description = template.description.replace(/itemtype\s*=\s*["']https:\/\/schema\.org\/FAQPage["']/gi, '');
93
94
  return template;
94
95
  }
95
96
  return template;
96
97
  };
97
- return (<div itemScope={handleFaqItemScope(isFaqActive, faqCount)} itemType={handleFaqItemType(isFaqActive, faqCount)} ref={printRef}>
98
+ return (<div itemScope={handleFaqItemScope(isFaqActive, faqElementMaxCountInContents)} itemType={handleFaqItemType(isFaqActive, faqElementMaxCountInContents)} ref={printRef}>
98
99
  <div id={'sub_contents'}>
99
100
  <div className="relative m-auto mb-[60px] w-[90%] max-w-screen-2xl font-[SUIT] max-xs:mb-[30px]">
100
101
  <div className={'m-auto mt-[100px] flex gap-[120px] lg:mt-[5em] ' +
@@ -122,7 +123,9 @@ const LawInfoNew = ({ data, tel }) => {
122
123
  </div>
123
124
  </div>
124
125
 
125
- <article>
126
+ <article itemScope={faqElementMaxCountInContents >= 2 ? true : undefined} itemType={faqElementMaxCountInContents >= 2
127
+ ? 'https://schema.org/FAQPage'
128
+ : undefined}>
126
129
  {/*목차*/}
127
130
  <ContentList template={template} h2List={h2List ? h2List : []} onScrollToElement={handleScrollToElement}/>
128
131
 
@@ -130,10 +133,8 @@ const LawInfoNew = ({ data, tel }) => {
130
133
  {h2List &&
131
134
  h2List.map((h2Template, index) => {
132
135
  console.log('h2Template.faqCount : ', h2Template.faqCount);
133
- return (<section className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'} key={'h2영역' + h2Template.idx} itemScope={h2Template.faqCount >= 2 ? true : undefined} itemType={h2Template.faqCount >= 2
134
- ? 'https://schema.org/FAQPage'
135
- : undefined}>
136
- <H2Contents h2Template={convertFaqItemType(h2Template)} index={index} faqCount={faqCount}/>
136
+ return (<section className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'} key={'h2영역' + h2Template.idx}>
137
+ <H2Contents h2Template={convertFaqItemType(h2Template)} index={index} faqCount={faqElementMaxCountInContents}/>
137
138
 
138
139
  {/*h3*/}
139
140
  {template
@@ -146,7 +147,7 @@ const LawInfoNew = ({ data, tel }) => {
146
147
  const news_length = newsLinkList.length;
147
148
  const news_content_length = newsLinkList.filter(i => i.tag_idx === h3Template.idx).length;
148
149
  return (<>
149
- <H3Contents h3Template={convertFaqItemType(h3Template)} key={'h3영역' + h3Template.idx} faqCount={faqCount}/>
150
+ <H3Contents h3Template={convertFaqItemType(h3Template)} key={'h3영역' + h3Template.idx} faqCount={faqElementMaxCountInContents}/>
150
151
  {(refer_is_use &&
151
152
  refer_length > 0 &&
152
153
  refer_content_length > 0) ||
@@ -39,7 +39,7 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
39
39
  initialData,
40
40
  nextPost,
41
41
  prevPost,
42
- faqCount
42
+ faqElementMaxCountInContents
43
43
  } = data;
44
44
  const { width } = useBrowser(true);
45
45
  const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState<ILawyerTypes[]>(lawyerData);
@@ -120,7 +120,8 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
120
120
  };
121
121
 
122
122
  const convertFaqItemType = (template: ISeoTemplateTypes): ISeoTemplateTypes => {
123
- if ((faqCount as number) >= 2) {
123
+ console.log('faqElementMaxCountInContents : ', faqElementMaxCountInContents);
124
+ if ((faqElementMaxCountInContents as number) >= 2) {
124
125
  template.description = template.description.replace(
125
126
  /itemtype\s*=\s*["']https:\/\/schema\.org\/FAQPage["']/gi,
126
127
  ''
@@ -134,8 +135,8 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
134
135
 
135
136
  return (
136
137
  <div
137
- itemScope={handleFaqItemScope(isFaqActive, faqCount as number)}
138
- itemType={handleFaqItemType(isFaqActive, faqCount as number)}
138
+ itemScope={handleFaqItemScope(isFaqActive, faqElementMaxCountInContents as number)}
139
+ itemType={handleFaqItemType(isFaqActive, faqElementMaxCountInContents as number)}
139
140
  ref={printRef}
140
141
  >
141
142
  <div id={'sub_contents'}>
@@ -187,7 +188,14 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
187
188
  </div>
188
189
  </div>
189
190
 
190
- <article>
191
+ <article
192
+ itemScope={(faqElementMaxCountInContents as number) >= 2 ? true : undefined}
193
+ itemType={
194
+ (faqElementMaxCountInContents as number) >= 2
195
+ ? 'https://schema.org/FAQPage'
196
+ : undefined
197
+ }
198
+ >
191
199
  {/*목차*/}
192
200
  <ContentList
193
201
  template={template}
@@ -203,17 +211,11 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
203
211
  <section
204
212
  className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'}
205
213
  key={'h2영역' + h2Template.idx}
206
- itemScope={(h2Template.faqCount as number) >= 2 ? true : undefined}
207
- itemType={
208
- (h2Template.faqCount as number) >= 2
209
- ? 'https://schema.org/FAQPage'
210
- : undefined
211
- }
212
214
  >
213
215
  <H2Contents
214
216
  h2Template={convertFaqItemType(h2Template)}
215
217
  index={index}
216
- faqCount={faqCount as number}
218
+ faqCount={faqElementMaxCountInContents as number}
217
219
  />
218
220
 
219
221
  {/*h3*/}
@@ -237,7 +239,7 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
237
239
  <H3Contents
238
240
  h3Template={convertFaqItemType(h3Template)}
239
241
  key={'h3영역' + h3Template.idx}
240
- faqCount={faqCount as number}
242
+ faqCount={faqElementMaxCountInContents as number}
241
243
  />
242
244
  {(refer_is_use &&
243
245
  refer_length > 0 &&
@@ -27,5 +27,5 @@ export interface ILawInfoNewTypes {
27
27
  shortsLinkList: IAddLinkTypes[];
28
28
  youtubeLinkList: IAddLinkTypes[];
29
29
  initialData: IInitialDataTypes;
30
- faqCount?: number;
30
+ faqElementMaxCountInContents?: number;
31
31
  }
@@ -27,5 +27,5 @@ export interface ILawInfoNewTypes {
27
27
  shortsLinkList: IAddLinkTypes[];
28
28
  youtubeLinkList: IAddLinkTypes[];
29
29
  initialData: IInitialDataTypes;
30
- faqCount?: number;
30
+ faqElementMaxCountInContents?: number;
31
31
  }