@daeryun/dr_components 1.3.47 → 1.3.49

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.
@@ -23,8 +23,8 @@ const SuccessNew = ({ data, tel }) => {
23
23
  const { template, contentsList, h2List, imgData, lawyerData, fieldData, successData, groupTopTenLawyerList, referenceLinkList, newsLinkList, shortsLinkList, youtubeLinkList, pn, initialData, faqElementMaxCountInContents } = data;
24
24
  const { width } = useBrowser(true);
25
25
  const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState(lawyerData);
26
- const [isFaqActive, setIsFaqActive] = useState(false);
27
26
  const printRef = useRef(null);
27
+ const faqPageCountInContents = faqElementMaxCountInContents !== null && faqElementMaxCountInContents !== void 0 ? faqElementMaxCountInContents : 0;
28
28
  const typeIdxNum = template && template[0].type_idx;
29
29
  const successDataFiltered = successData.filter(data => Number(data.type_idx) !== typeIdxNum);
30
30
  const legalDocumentImageObject = imgData && imgData.length > 0 ? imgData[0] : null;
@@ -55,31 +55,29 @@ const SuccessNew = ({ data, tel }) => {
55
55
  const imgLocation = (_b = (_a = document.getElementById('img_wrap')) === null || _a === void 0 ? void 0 : _a.offsetTop) !== null && _b !== void 0 ? _b : 0;
56
56
  window.scrollTo({ top: imgLocation + (width > 680 ? 300 : 200), behavior: 'smooth' });
57
57
  };
58
- const handleFaqItemType = (isFaqActive, faqElementMaxCountInContents) => {
59
- if (isFaqActive && faqElementMaxCountInContents === 0) {
60
- return 'https://schema.org/FAQPage';
61
- }
62
- if (isFaqActive && faqElementMaxCountInContents >= 2) {
58
+ const handleFaqItemType = () => {
59
+ // 작성자 FAQPage가 1개일 때만 루트 FAQPage를 제거한다.
60
+ if (faqPageCountInContents === 1) {
63
61
  return undefined;
64
62
  }
65
63
  return 'https://schema.org/FAQPage';
66
64
  };
67
- const handleFaqItemScope = (isFaqActive, faqElementMaxCountInContents) => {
68
- if (isFaqActive && faqElementMaxCountInContents === 0) {
69
- return true;
70
- }
71
- if (isFaqActive && faqElementMaxCountInContents >= 2) {
65
+ const handleFaqItemScope = () => {
66
+ // 작성자 FAQPage가 1개일 때만 루트 FAQPage를 제거한다.
67
+ if (faqPageCountInContents === 1) {
72
68
  return undefined;
73
69
  }
74
70
  return true;
75
71
  };
76
72
  const convertFaqItemType = (template) => {
77
- if (faqElementMaxCountInContents >= 2) {
78
- // faqElementMaxCountInContents가 두 개 이상일 경우, template 내부에 FAQPage itemtype을 지운다. FAQPage 중복 이슈로 인한 코드임
79
- template.description = template.description.replaceAll('<div itemscope="" itemtype="https://schema.org/FAQPage">', '<div>');
80
- return template;
73
+ // 작성자 FAQPage가 2개 이상이면 내부 FAQPage를 지우고 루트 FAQPage 1개만 유지한다.
74
+ if (faqPageCountInContents >= 2) {
75
+ const convertedDescription = template.description
76
+ .replaceAll('<div itemscope="" itemtype="https://schema.org/FAQPage">', '<div>')
77
+ .replaceAll('<div itemscope="" itemtype="https://schema.org/FAQPage">', '<div>');
78
+ return Object.assign(Object.assign({}, template), { description: convertedDescription });
81
79
  }
82
- return template;
80
+ return Object.assign({}, template);
83
81
  };
84
82
  // 변호사 6명 맞추기
85
83
  useEffect(() => {
@@ -99,19 +97,7 @@ const SuccessNew = ({ data, tel }) => {
99
97
  setRelatedCaseLawyerList(lawyerData.slice(0, maxCount));
100
98
  }
101
99
  }, [lawyerData, groupTopTenLawyerList]);
102
- useEffect(() => {
103
- if (template) {
104
- // 초기화
105
- setIsFaqActive(false);
106
- for (const data of template) {
107
- // console.log("faq 활성화: ", data['active_faq']);
108
- if (data['active_faq']) {
109
- setIsFaqActive(true);
110
- }
111
- }
112
- }
113
- }, [template]);
114
- return (<div itemScope={handleFaqItemScope(isFaqActive, faqElementMaxCountInContents)} itemType={handleFaqItemType(isFaqActive, faqElementMaxCountInContents)} ref={printRef}>
100
+ return (<div itemScope={handleFaqItemScope()} itemType={handleFaqItemType()} ref={printRef}>
115
101
  <div className="relative m-auto mb-[100px] w-[90%] max-w-screen-2xl max-md2:mb-[40px] max-xs:mb-[30px]">
116
102
  <div className={'m-auto mt-[100px] flex gap-[120px] ' +
117
103
  //1700px
@@ -46,8 +46,8 @@ const SuccessNew = ({ data, tel }: ISuccessNewPageTypes) => {
46
46
  } = data;
47
47
  const { width } = useBrowser(true);
48
48
  const [relatedCaseLawyerList, setRelatedCaseLawyerList] = useState<ILawyerTypes[]>(lawyerData);
49
- const [isFaqActive, setIsFaqActive] = useState<boolean>(false);
50
49
  const printRef = useRef<HTMLDivElement>(null);
50
+ const faqPageCountInContents = faqElementMaxCountInContents ?? 0;
51
51
  const typeIdxNum: number | null = template && (template[0].type_idx as number);
52
52
  const successDataFiltered: ISuccessTypes[] = successData.filter(data => Number(data.type_idx) !== typeIdxNum);
53
53
 
@@ -85,24 +85,18 @@ const SuccessNew = ({ data, tel }: ISuccessNewPageTypes) => {
85
85
  window.scrollTo({ top: imgLocation + (width > 680 ? 300 : 200), behavior: 'smooth' });
86
86
  };
87
87
 
88
- const handleFaqItemType = (isFaqActive: boolean, faqElementMaxCountInContents?: number): string | undefined => {
89
- if (isFaqActive && faqElementMaxCountInContents === 0) {
90
- return 'https://schema.org/FAQPage';
91
- }
92
-
93
- if (isFaqActive && (faqElementMaxCountInContents as number) >= 2) {
88
+ const handleFaqItemType = (): string | undefined => {
89
+ // 작성자 FAQPage가 1개일 때만 루트 FAQPage를 제거한다.
90
+ if (faqPageCountInContents === 1) {
94
91
  return undefined;
95
92
  }
96
93
 
97
94
  return 'https://schema.org/FAQPage';
98
95
  };
99
96
 
100
- const handleFaqItemScope = (isFaqActive: boolean, faqElementMaxCountInContents?: number): true | undefined => {
101
- if (isFaqActive && faqElementMaxCountInContents === 0) {
102
- return true;
103
- }
104
-
105
- if (isFaqActive && (faqElementMaxCountInContents as number) >= 2) {
97
+ const handleFaqItemScope = (): true | undefined => {
98
+ // 작성자 FAQPage가 1개일 때만 루트 FAQPage를 제거한다.
99
+ if (faqPageCountInContents === 1) {
106
100
  return undefined;
107
101
  }
108
102
 
@@ -110,17 +104,22 @@ const SuccessNew = ({ data, tel }: ISuccessNewPageTypes) => {
110
104
  };
111
105
 
112
106
  const convertFaqItemType = (template: ISeoTemplateTypes): ISeoTemplateTypes => {
113
- if ((faqElementMaxCountInContents as number) >= 2) {
114
- // faqElementMaxCountInContents가 두 개 이상일 경우, template 내부에 FAQPage itemtype을 지운다. FAQPage 중복 이슈로 인한 코드임
115
- template.description = template.description.replaceAll(
116
- '&lt;div itemscope="" itemtype="https://schema.org/FAQPage"&gt;',
117
- '&lt;div&gt;'
118
- );
119
-
120
- return template;
107
+ // 작성자 FAQPage가 2개 이상이면 내부 FAQPage를 지우고 루트 FAQPage 1개만 유지한다.
108
+ if (faqPageCountInContents >= 2) {
109
+ const convertedDescription = template.description
110
+ .replaceAll(
111
+ '&lt;div itemscope="" itemtype="https://schema.org/FAQPage"&gt;',
112
+ '&lt;div&gt;'
113
+ )
114
+ .replaceAll('<div itemscope="" itemtype="https://schema.org/FAQPage">', '<div>');
115
+
116
+ return {
117
+ ...template,
118
+ description: convertedDescription
119
+ };
121
120
  }
122
121
 
123
- return template;
122
+ return { ...template };
124
123
  };
125
124
 
126
125
  // 변호사 6명 맞추기
@@ -143,24 +142,10 @@ const SuccessNew = ({ data, tel }: ISuccessNewPageTypes) => {
143
142
  }
144
143
  }, [lawyerData, groupTopTenLawyerList]);
145
144
 
146
- useEffect(() => {
147
- if (template) {
148
- // 초기화
149
- setIsFaqActive(false);
150
-
151
- for (const data of template) {
152
- // console.log("faq 활성화: ", data['active_faq']);
153
- if (data['active_faq']) {
154
- setIsFaqActive(true);
155
- }
156
- }
157
- }
158
- }, [template]);
159
-
160
145
  return (
161
146
  <div
162
- itemScope={handleFaqItemScope(isFaqActive, faqElementMaxCountInContents as number)}
163
- itemType={handleFaqItemType(isFaqActive, faqElementMaxCountInContents as number)}
147
+ itemScope={handleFaqItemScope()}
148
+ itemType={handleFaqItemType()}
164
149
  ref={printRef}
165
150
  >
166
151
  <div className="relative m-auto mb-[100px] w-[90%] max-w-screen-2xl max-md2:mb-[40px] max-xs:mb-[30px]">
@@ -110,7 +110,7 @@ export function categoryMenuName({ url }) {
110
110
  return { title: 'SNS', subTitle: '인스타그램', address: 'instagram' };
111
111
  }
112
112
  else if (url.includes('/blog')) {
113
- return { title: 'SNS', subTitle: '블로그', address: 'blog' };
113
+ return { title: '소식/자료', subTitle: '법률 블로그', address: 'blog' };
114
114
  }
115
115
  else if (url.includes('/common/disclaimer')) {
116
116
  return { title: '면책공고', subTitle: '면책공고', address: 'common/disclaimer' };
@@ -94,7 +94,7 @@ export function categoryMenuName({ url }: { url: string }): {
94
94
  } else if (url.includes('/instagram')) {
95
95
  return { title: 'SNS', subTitle: '인스타그램', address: 'instagram' };
96
96
  } else if (url.includes('/blog')) {
97
- return { title: 'SNS', subTitle: '블로그', address: 'blog' };
97
+ return { title: '소식/자료', subTitle: '법률 블로그', address: 'blog' };
98
98
  } else if (url.includes('/common/disclaimer')) {
99
99
  return { title: '면책공고', subTitle: '면책공고', address: 'common/disclaimer' };
100
100
  } else if (url.includes('/common/limited-liability')) {
@@ -107,7 +107,7 @@
107
107
  }
108
108
 
109
109
  /*
110
- ! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com
110
+ ! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com
111
111
  */
112
112
 
113
113
  /*
@@ -9394,16 +9394,20 @@ html {
9394
9394
 
9395
9395
  .backdrop-blur-\[4px\] {
9396
9396
  --tw-backdrop-blur: blur(4px);
9397
+ -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
9397
9398
  backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
9398
9399
  }
9399
9400
 
9400
9401
  .backdrop-blur-sm {
9401
9402
  --tw-backdrop-blur: blur(4px);
9403
+ -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
9402
9404
  backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
9403
9405
  }
9404
9406
 
9405
9407
  .transition {
9408
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
9406
9409
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
9410
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
9407
9411
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
9408
9412
  transition-duration: 150ms;
9409
9413
  }