@daeryun/dr_components 1.0.1 → 1.0.3

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.
@@ -88,7 +88,7 @@ const LawInfoNew = ({ data, tel }) => {
88
88
  };
89
89
  const convertFaqItemType = (template) => {
90
90
  console.log('faqElementMaxCountInContents : ', faqElementMaxCountInContents);
91
- if (faqElementMaxCountInContents >= 1) {
91
+ if (faqElementMaxCountInContents >= 2) {
92
92
  template.description = template.description.replaceAll(/<div\s+itemscope=""\s+itemtype="https:\/\/schema\.org\/FAQPage">/gi, '<div>');
93
93
  return template;
94
94
  }
@@ -122,9 +122,9 @@ const LawInfoNew = ({ data, tel }) => {
122
122
  </div>
123
123
  </div>
124
124
 
125
- <article itemScope={faqElementMaxCountInContents >= 1 ? true : undefined} itemType={faqElementMaxCountInContents >= 1
126
- ? 'https://schema.org/FAQPage'
127
- : undefined}>
125
+ <article itemScope={faqElementMaxCountInContents >= 2 ? undefined : true} itemType={faqElementMaxCountInContents >= 2
126
+ ? undefined
127
+ : 'https://schema.org/FAQPage'}>
128
128
  {/*목차*/}
129
129
  <ContentList template={template} h2List={h2List ? h2List : []} onScrollToElement={handleScrollToElement}/>
130
130
 
@@ -120,7 +120,7 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
120
120
 
121
121
  const convertFaqItemType = (template: ISeoTemplateTypes): ISeoTemplateTypes => {
122
122
  console.log('faqElementMaxCountInContents : ', faqElementMaxCountInContents);
123
- if ((faqElementMaxCountInContents as number) >= 1) {
123
+ if ((faqElementMaxCountInContents as number) >= 2) {
124
124
  template.description = template.description.replaceAll(
125
125
  /&lt;div\s+itemscope=""\s+itemtype="https:\/\/schema\.org\/FAQPage"&gt;/gi,
126
126
  '&lt;div&gt;'
@@ -188,11 +188,11 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
188
188
  </div>
189
189
 
190
190
  <article
191
- itemScope={(faqElementMaxCountInContents as number) >= 1 ? true : undefined}
191
+ itemScope={(faqElementMaxCountInContents as number) >= 2 ? undefined : true}
192
192
  itemType={
193
- (faqElementMaxCountInContents as number) >= 1
194
- ? 'https://schema.org/FAQPage'
195
- : undefined
193
+ (faqElementMaxCountInContents as number) >= 2
194
+ ? undefined
195
+ : 'https://schema.org/FAQPage'
196
196
  }
197
197
  >
198
198
  {/*목차*/}
@@ -3,15 +3,16 @@ import { htmlUrlDecode } from '../../../../lib';
3
3
  const H2Contents = ({ h2Template, index, faqCount }) => {
4
4
  const { active_faq } = h2Template;
5
5
  const getItemScope = () => {
6
- if (active_faq === false && faqCount === 0) {
7
- return true;
8
- }
9
- if (active_faq || faqCount === 0) {
6
+ if (active_faq || faqCount >= 2) {
10
7
  return undefined;
11
8
  }
9
+ return true;
12
10
  };
13
11
  const getItemProp = (category) => {
14
- if (active_faq === false && faqCount === 0) {
12
+ if (active_faq || faqCount >= 2) {
13
+ return undefined;
14
+ }
15
+ else {
15
16
  switch (category) {
16
17
  case 'mainEntity':
17
18
  return 'mainEntity';
@@ -25,12 +26,12 @@ const H2Contents = ({ h2Template, index, faqCount }) => {
25
26
  undefined;
26
27
  }
27
28
  }
28
- if (active_faq || faqCount === 0) {
29
- return undefined;
30
- }
31
29
  };
32
30
  const getItemType = (category) => {
33
- if (active_faq === false && faqCount === 0) {
31
+ if (active_faq || faqCount >= 2) {
32
+ return undefined;
33
+ }
34
+ else {
34
35
  switch (category) {
35
36
  case 'question':
36
37
  return 'https://schema.org/Question';
@@ -40,9 +41,6 @@ const H2Contents = ({ h2Template, index, faqCount }) => {
40
41
  undefined;
41
42
  }
42
43
  }
43
- if (active_faq || faqCount === 0) {
44
- return undefined;
45
- }
46
44
  };
47
45
  return (<div itemScope={getItemScope()} itemProp={getItemProp('mainEntity')} itemType={getItemType('question')}>
48
46
  <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')}>
@@ -17,17 +17,17 @@ const H2Contents = ({
17
17
  const { active_faq } = h2Template;
18
18
 
19
19
  const getItemScope = (): boolean | undefined => {
20
- if (active_faq === false && (faqCount as number) === 0) {
21
- return true;
22
- }
23
-
24
- if (active_faq || (faqCount as number) === 0) {
20
+ if (active_faq || (faqCount as number) >= 2) {
25
21
  return undefined;
26
22
  }
23
+
24
+ return true;
27
25
  };
28
26
 
29
27
  const getItemProp = (category: ItemPropTypes): string | undefined => {
30
- if (active_faq === false && (faqCount as number) === 0) {
28
+ if (active_faq || (faqCount as number) >= 2) {
29
+ return undefined;
30
+ } else {
31
31
  switch (category) {
32
32
  case 'mainEntity':
33
33
  return 'mainEntity';
@@ -41,14 +41,12 @@ const H2Contents = ({
41
41
  undefined;
42
42
  }
43
43
  }
44
-
45
- if (active_faq || (faqCount as number) === 0) {
46
- return undefined;
47
- }
48
44
  };
49
45
 
50
46
  const getItemType = (category: ItemTypes): string | undefined => {
51
- if (active_faq === false && (faqCount as number) === 0) {
47
+ if (active_faq || (faqCount as number) >= 2) {
48
+ return undefined;
49
+ } else {
52
50
  switch (category) {
53
51
  case 'question':
54
52
  return 'https://schema.org/Question';
@@ -58,10 +56,6 @@ const H2Contents = ({
58
56
  undefined;
59
57
  }
60
58
  }
61
-
62
- if (active_faq || (faqCount as number) === 0) {
63
- return undefined;
64
- }
65
59
  };
66
60
 
67
61
  return (
@@ -5,15 +5,16 @@ import FieldIcon from '../../../../asset/images/success_new/field_icon.webp';
5
5
  const H3Contents = ({ h3Template, faqCount }) => {
6
6
  const { active_faq } = h3Template;
7
7
  const getItemScope = () => {
8
- if (active_faq === false && faqCount === 0) {
9
- return true;
10
- }
11
- if (active_faq || faqCount === 0) {
8
+ if (active_faq || faqCount >= 1) {
12
9
  return undefined;
13
10
  }
11
+ return true;
14
12
  };
15
13
  const getItemProp = (category) => {
16
- if (active_faq === false && faqCount === 0) {
14
+ if (active_faq || faqCount >= 1) {
15
+ return undefined;
16
+ }
17
+ else {
17
18
  switch (category) {
18
19
  case 'mainEntity':
19
20
  return 'mainEntity';
@@ -27,12 +28,12 @@ const H3Contents = ({ h3Template, faqCount }) => {
27
28
  undefined;
28
29
  }
29
30
  }
30
- if (active_faq || faqCount === 0) {
31
- return undefined;
32
- }
33
31
  };
34
32
  const getItemType = (category) => {
35
- if (active_faq === false && faqCount === 0) {
33
+ if (active_faq || faqCount >= 1) {
34
+ return undefined;
35
+ }
36
+ else {
36
37
  switch (category) {
37
38
  case 'question':
38
39
  return 'https://schema.org/Question';
@@ -42,9 +43,6 @@ const H3Contents = ({ h3Template, faqCount }) => {
42
43
  undefined;
43
44
  }
44
45
  }
45
- if (active_faq || faqCount === 0) {
46
- return undefined;
47
- }
48
46
  };
49
47
  return (<>
50
48
  <div className={'px-[10px] sm:px-[18px]'} key={'h3영역' + h3Template.idx} itemScope={getItemScope()} itemProp={getItemProp('mainEntity')} itemType={getItemType('question')}>
@@ -11,17 +11,17 @@ const H3Contents = ({ h3Template, faqCount }: { h3Template: ISeoTemplateTypes; f
11
11
  const { active_faq } = h3Template;
12
12
 
13
13
  const getItemScope = (): boolean | undefined => {
14
- if (active_faq === false && (faqCount as number) === 0) {
15
- return true;
16
- }
17
-
18
- if (active_faq || (faqCount as number) === 0) {
14
+ if (active_faq || (faqCount as number) >= 1) {
19
15
  return undefined;
20
16
  }
17
+
18
+ return true;
21
19
  };
22
20
 
23
21
  const getItemProp = (category: ItemPropTypes): string | undefined => {
24
- if (active_faq === false && (faqCount as number) === 0) {
22
+ if (active_faq || (faqCount as number) >= 1) {
23
+ return undefined;
24
+ } else {
25
25
  switch (category) {
26
26
  case 'mainEntity':
27
27
  return 'mainEntity';
@@ -35,14 +35,12 @@ const H3Contents = ({ h3Template, faqCount }: { h3Template: ISeoTemplateTypes; f
35
35
  undefined;
36
36
  }
37
37
  }
38
-
39
- if (active_faq || (faqCount as number) === 0) {
40
- return undefined;
41
- }
42
38
  };
43
39
 
44
40
  const getItemType = (category: ItemTypes): string | undefined => {
45
- if (active_faq === false && (faqCount as number) === 0) {
41
+ if (active_faq || (faqCount as number) >= 1) {
42
+ return undefined;
43
+ } else {
46
44
  switch (category) {
47
45
  case 'question':
48
46
  return 'https://schema.org/Question';
@@ -52,10 +50,6 @@ const H3Contents = ({ h3Template, faqCount }: { h3Template: ISeoTemplateTypes; f
52
50
  undefined;
53
51
  }
54
52
  }
55
-
56
- if (active_faq || (faqCount as number) === 0) {
57
- return undefined;
58
- }
59
53
  };
60
54
 
61
55
  return (