@daeryun/dr_components 1.1.13 → 1.1.16

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.
@@ -3,12 +3,20 @@ import { useEffect, useState } from 'react';
3
3
  export function useFullURL() {
4
4
  const pathname = usePathname();
5
5
  const searchParams = useSearchParams();
6
- const [fullUrl, setFullUrl] = useState('');
6
+ const [fullUrl, setFullUrl] = useState(() => {
7
+ if (typeof window !== 'undefined') {
8
+ const origin = window.location.origin;
9
+ const query = searchParams.toString();
10
+ const hash = window.location.hash;
11
+ return origin + pathname + (query ? `?${query}` : '') + hash;
12
+ }
13
+ return '';
14
+ });
7
15
  useEffect(() => {
8
16
  if (typeof window !== 'undefined') {
9
- const origin = window.location.origin; // https://example.com
10
- const query = searchParams.toString(); // scrollToMsg=true
11
- const hash = window.location.hash; // #1234 or ''
17
+ const origin = window.location.origin;
18
+ const query = searchParams.toString();
19
+ const hash = window.location.hash;
12
20
  const fullPath = origin + pathname + (query ? `?${query}` : '') + hash;
13
21
  setFullUrl(fullPath);
14
22
  }
@@ -4,16 +4,23 @@ import { useEffect, useState } from 'react';
4
4
  export function useFullURL() {
5
5
  const pathname = usePathname();
6
6
  const searchParams = useSearchParams();
7
- const [fullUrl, setFullUrl] = useState('');
8
7
 
9
- useEffect(() => {
8
+ const [fullUrl, setFullUrl] = useState(() => {
10
9
  if (typeof window !== 'undefined') {
11
- const origin = window.location.origin; // https://example.com
12
- const query = searchParams.toString(); // scrollToMsg=true
13
- const hash = window.location.hash; // #1234 or ''
10
+ const origin = window.location.origin;
11
+ const query = searchParams.toString();
12
+ const hash = window.location.hash;
13
+ return origin + pathname + (query ? `?${query}` : '') + hash;
14
+ }
15
+ return '';
16
+ });
14
17
 
18
+ useEffect(() => {
19
+ if (typeof window !== 'undefined') {
20
+ const origin = window.location.origin;
21
+ const query = searchParams.toString();
22
+ const hash = window.location.hash;
15
23
  const fullPath = origin + pathname + (query ? `?${query}` : '') + hash;
16
-
17
24
  setFullUrl(fullPath);
18
25
  }
19
26
  }, [pathname, searchParams]);
@@ -30,35 +30,32 @@ export const SuccessCase = ({ successData }) => {
30
30
  </span>
31
31
 
32
32
  <span className={'mt-[30px] flex flex-col gap-3 '}>
33
- {successData === null || successData === void 0 ? void 0 : successData.map(i => {
34
- var _a;
35
- return (<Link href={((_a = i.domain) !== null && _a !== void 0 ? _a : '') + '/success_new/' + i.type_idx} key={'/success_new/' + i.type_idx} target={i.domain ? '_blank' : ''} className={'flex w-fit items-start gap-[10px] text-[20px] font-medium tracking-[-0.4px] hover:text-[#285FA7] ' +
36
- //1500px
37
- 'max-3xl:text-[18px] ' +
38
- //1280px
39
- 'max-xl:text-[20px] ' +
40
- //768px
41
- 'max-md:text-[18px]'}>
33
+ {successData === null || successData === void 0 ? void 0 : successData.map(i => (<Link href={i.domain ? i.domain + `success_new/${i.type_idx}` : '/success_new/' + i.type_idx} key={'/success_new/' + i.type_idx} target={i.domain ? '_blank' : ''} className={'flex w-fit items-start gap-[10px] text-[20px] font-medium tracking-[-0.4px] hover:text-[#285FA7] ' +
34
+ //1500px
35
+ 'max-3xl:text-[18px] ' +
36
+ //1280px
37
+ 'max-xl:text-[20px] ' +
38
+ //768px
39
+ 'max-md:text-[18px]'}>
42
40
  <IconDot className={'mt-3 inline shrink-0 ' +
43
- //1500px
44
- 'max-3xl:mt-[9px]'}/>
41
+ //1500px
42
+ 'max-3xl:mt-[9px]'}/>
45
43
  <div className={''}>
46
44
  {i.tag_title.includes('|')
47
- ? i.tag_title.split('|')[1]
48
- : i.tag_title.includes(']')
49
- ? i.tag_title.split(']')[1]
50
- : ''}
45
+ ? i.tag_title.split('|')[1]
46
+ : i.tag_title.includes(']')
47
+ ? i.tag_title.split(']')[1]
48
+ : ''}
51
49
 
52
50
  <IconArrow aria-label={'새창열림'} className={'mb-[5px] ml-2 inline h-[10px] w-[10px] ' +
53
- //1500px
54
- 'max-3xl:h-[9px] max-3xl:w-[9px] ' +
55
- //1280px
56
- 'max-xl:mb-[3px] max-xl:h-[10px] max-xl:w-[10px] ' +
57
- //1500px
58
- 'max-md:mb-[7px] max-md:h-[9px] max-md:w-[9px] '}/>
51
+ //1500px
52
+ 'max-3xl:h-[9px] max-3xl:w-[9px] ' +
53
+ //1280px
54
+ 'max-xl:mb-[3px] max-xl:h-[10px] max-xl:w-[10px] ' +
55
+ //1500px
56
+ 'max-md:mb-[7px] max-md:h-[9px] max-md:w-[9px] '}/>
59
57
  </div>
60
- </Link>);
61
- })}
58
+ </Link>))}
62
59
  </span>
63
60
  </div>);
64
61
  };
@@ -57,7 +57,7 @@ export const SuccessCase = ({ successData }: { successData: ISuccessTypes[] }) =
57
57
  <span className={'mt-[30px] flex flex-col gap-3 '}>
58
58
  {successData?.map(i => (
59
59
  <Link
60
- href={(i.domain ?? '') + '/success_new/' + i.type_idx}
60
+ href={i.domain ? i.domain + `success_new/${i.type_idx}` : '/success_new/' + i.type_idx}
61
61
  key={'/success_new/' + i.type_idx}
62
62
  target={i.domain ? '_blank' : ''}
63
63
  className={