@daeryun/dr_components 1.3.0 → 1.3.2

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.
@@ -4,6 +4,7 @@ import Image from 'next/image';
4
4
  import React from 'react';
5
5
  import Arrow5 from '../../asset/images/categoryView/section9_arrow_05.webp';
6
6
  import Arrow3 from '../../asset/images/categoryView/section9_arrow_03.webp';
7
+ import { getPowerLinkStr } from '../../lib';
7
8
  const CategoryComponent = (props) => {
8
9
  const { showCategory, onClickPage, currentPage, maxPageNum, selectedCenter, currentCenterTitle, allMainCenterTargetBlank, isApp } = props;
9
10
  const linkString = (id, pathname) => {
@@ -15,7 +16,7 @@ const CategoryComponent = (props) => {
15
16
  link = `/${pathname}`;
16
17
  }
17
18
  else {
18
- link = `https://www.daeryunlaw-${selectedCenter.code_desc}.com/${pathname}`;
19
+ link = `https://www.daeryunlaw-${selectedCenter.code_desc}.com/${pathname}` + getPowerLinkStr();
19
20
  }
20
21
  return link + '/' + id;
21
22
  };
@@ -7,6 +7,7 @@ import { ICategory, ICenter } from './ICategoryViewTypes';
7
7
  import Icon from '../../asset/images/categoryView/section9_icon.webp';
8
8
  import Arrow5 from '../../asset/images/categoryView/section9_arrow_05.webp';
9
9
  import Arrow3 from '../../asset/images/categoryView/section9_arrow_03.webp';
10
+ import { getPowerLinkStr } from '../../lib';
10
11
 
11
12
  const CategoryComponent = (props: {
12
13
  showCategory: ICategory[];
@@ -37,7 +38,7 @@ const CategoryComponent = (props: {
37
38
  } else if (selectedCenter.code_desc === currentCenterTitle && !allMainCenterTargetBlank) {
38
39
  link = `/${pathname}`;
39
40
  } else {
40
- link = `https://www.daeryunlaw-${selectedCenter.code_desc}.com/${pathname}`;
41
+ link = `https://www.daeryunlaw-${selectedCenter.code_desc}.com/${pathname}` + getPowerLinkStr();
41
42
  }
42
43
 
43
44
  return link + '/' + id;
@@ -18,17 +18,17 @@ import * as gtag from '../../lib/gtag';
18
18
  export const useLoginUuidSync = () => {
19
19
  const hasProcessed = useRef(false);
20
20
  // const pathName = usePathname();
21
- console.log('useLoginUuidSync 훅 호출됨');
21
+ // console.log('useLoginUuidSync 훅 호출됨');
22
22
  useEffect(() => {
23
23
  console.log('useLoginUuidSync useEffect 실행, hasProcessed:', hasProcessed.current);
24
24
  // 이미 처리했으면 스킵
25
25
  if (hasProcessed.current) {
26
- console.log('useLoginUuidSync: 이미 처리됨, 스킵');
26
+ // console.log('useLoginUuidSync: 이미 처리됨, 스킵');
27
27
  return;
28
28
  }
29
29
  const syncUuid = () => __awaiter(void 0, void 0, void 0, function* () {
30
30
  var _a, _b, _c;
31
- console.log('useLoginUuidSync syncUuid 함수 시작');
31
+ // console.log('useLoginUuidSync syncUuid 함수 시작');
32
32
  try {
33
33
  // URL에 이미 uuid가 있으면 스킵
34
34
  const urlParams = new URLSearchParams(window.location.search);
@@ -43,7 +43,7 @@ export const useLoginUuidSync = () => {
43
43
  headers: { 'Content-Type': 'application/json' },
44
44
  credentials: 'include'
45
45
  }).then(res => res.json());
46
- console.log('useLoginUuidSync result:', result);
46
+ // console.log('useLoginUuidSync result:', result);
47
47
  // 로그인 안 됨
48
48
  if (!((_a = result.data) === null || _a === void 0 ? void 0 : _a.email) || !((_b = result.data) === null || _b === void 0 ? void 0 : _b.name) || !((_c = result.data) === null || _c === void 0 ? void 0 : _c.phone_number)) {
49
49
  console.log('useLoginUuidSync: 로그인 안 됨 - email/name/phone_number 누락');
@@ -54,7 +54,7 @@ export const useLoginUuidSync = () => {
54
54
  console.log('useLoginUuidSync: idx 없음');
55
55
  return;
56
56
  }
57
- console.log('useLoginUuidSync: 로그인 확인, idx:', idx);
57
+ // console.log('useLoginUuidSync: 로그인 확인, idx:', idx);
58
58
  // URL에 uuid 추가
59
59
  const url = new URL(window.location.href);
60
60
  url.searchParams.set('uuid', String(idx));
@@ -67,15 +67,15 @@ export const useLoginUuidSync = () => {
67
67
  value: '1',
68
68
  user_id: String(idx)
69
69
  });
70
- console.log('useLoginUuidSync: GA 이벤트 발생 - login_complete');
70
+ // console.log('useLoginUuidSync: GA 이벤트 발생 - login_complete');
71
71
  hasProcessed.current = true;
72
72
  // 쿠키에 uuid 저장 (세션 쿠키 - 브라우저 닫으면 삭제)
73
73
  // middleware에서 페이지 이동 시 URL에 uuid를 자동 추가하는 데 사용
74
74
  document.cookie = `_dr_uuid=${idx}; path=/; SameSite=Lax`;
75
- console.log('useLoginUuidSync: 쿠키 저장 완료 - _dr_uuid:', idx);
75
+ // console.log('useLoginUuidSync: 쿠키 저장 완료 - _dr_uuid:', idx);
76
76
  // URL 업데이트 (히스토리에 추가하지 않고 교체)
77
77
  window.history.replaceState({}, '', newUrl);
78
- console.log('useLoginUuidSync: URL 업데이트 완료', newUrl);
78
+ // console.log('useLoginUuidSync: URL 업데이트 완료', newUrl);
79
79
  }
80
80
  catch (error) {
81
81
  console.error('useLoginUuidSync 에러:', error);
@@ -13,19 +13,19 @@ export const useLoginUuidSync = () => {
13
13
  const hasProcessed = useRef(false);
14
14
  // const pathName = usePathname();
15
15
 
16
- console.log('useLoginUuidSync 훅 호출됨');
16
+ // console.log('useLoginUuidSync 훅 호출됨');
17
17
 
18
18
  useEffect(() => {
19
19
  console.log('useLoginUuidSync useEffect 실행, hasProcessed:', hasProcessed.current);
20
20
 
21
21
  // 이미 처리했으면 스킵
22
22
  if (hasProcessed.current) {
23
- console.log('useLoginUuidSync: 이미 처리됨, 스킵');
23
+ // console.log('useLoginUuidSync: 이미 처리됨, 스킵');
24
24
  return;
25
25
  }
26
26
 
27
27
  const syncUuid = async () => {
28
- console.log('useLoginUuidSync syncUuid 함수 시작');
28
+ // console.log('useLoginUuidSync syncUuid 함수 시작');
29
29
  try {
30
30
  // URL에 이미 uuid가 있으면 스킵
31
31
  const urlParams = new URLSearchParams(window.location.search);
@@ -42,7 +42,7 @@ export const useLoginUuidSync = () => {
42
42
  credentials: 'include'
43
43
  }).then(res => res.json());
44
44
 
45
- console.log('useLoginUuidSync result:', result);
45
+ // console.log('useLoginUuidSync result:', result);
46
46
 
47
47
  // 로그인 안 됨
48
48
  if (!result.data?.email || !result.data?.name || !result.data?.phone_number) {
@@ -56,7 +56,7 @@ export const useLoginUuidSync = () => {
56
56
  return;
57
57
  }
58
58
 
59
- console.log('useLoginUuidSync: 로그인 확인, idx:', idx);
59
+ // console.log('useLoginUuidSync: 로그인 확인, idx:', idx);
60
60
 
61
61
  // URL에 uuid 추가
62
62
  const url = new URL(window.location.href);
@@ -72,17 +72,17 @@ export const useLoginUuidSync = () => {
72
72
  user_id: String(idx)
73
73
  });
74
74
 
75
- console.log('useLoginUuidSync: GA 이벤트 발생 - login_complete');
75
+ // console.log('useLoginUuidSync: GA 이벤트 발생 - login_complete');
76
76
  hasProcessed.current = true;
77
77
 
78
78
  // 쿠키에 uuid 저장 (세션 쿠키 - 브라우저 닫으면 삭제)
79
79
  // middleware에서 페이지 이동 시 URL에 uuid를 자동 추가하는 데 사용
80
80
  document.cookie = `_dr_uuid=${idx}; path=/; SameSite=Lax`;
81
- console.log('useLoginUuidSync: 쿠키 저장 완료 - _dr_uuid:', idx);
81
+ // console.log('useLoginUuidSync: 쿠키 저장 완료 - _dr_uuid:', idx);
82
82
 
83
83
  // URL 업데이트 (히스토리에 추가하지 않고 교체)
84
84
  window.history.replaceState({}, '', newUrl);
85
- console.log('useLoginUuidSync: URL 업데이트 완료', newUrl);
85
+ // console.log('useLoginUuidSync: URL 업데이트 완료', newUrl);
86
86
  } catch (error) {
87
87
  console.error('useLoginUuidSync 에러:', error);
88
88
  }
@@ -92,4 +92,4 @@ export const useLoginUuidSync = () => {
92
92
  }, []);
93
93
  };
94
94
 
95
- export default useLoginUuidSync;
95
+ export default useLoginUuidSync;