@daeryun/dr_components 0.7.2 → 0.7.22
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.
- package/dist/asset/images/seo/seoAddLink/link_arrow.webp +0 -0
- package/dist/asset/images/seo/seoAddLink/link_on.webp +0 -0
- package/dist/asset/images/seo/seoAddLink/logo_youtube.webp +0 -0
- package/dist/asset/images/seo/seoAddLink/ribon.svg +3 -0
- package/dist/asset/images/seo/seoAddLink/youtubeSmall_ico.svg +4 -0
- package/dist/asset/images/seo/seoYoutube/youtube_ico.svg +7 -0
- package/dist/asset/images/seo/seoYoutube/youtube_txt.svg +3 -0
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/Seo/SeoAdditionalLink.d.ts +7 -0
- package/dist/components/Seo/SeoAdditionalLink.jsx +101 -0
- package/dist/components/Seo/SeoAdditionalLink.stories.d.ts +19 -0
- package/dist/components/Seo/SeoAdditionalLink.stories.jsx +34 -0
- package/dist/components/Seo/SeoAdditionalLink.stories.tsx +41 -0
- package/dist/components/Seo/SeoAdditionalLink.tsx +168 -0
- package/dist/components/Seo/SeoYoutube.d.ts +6 -0
- package/dist/components/Seo/SeoYoutube.jsx +69 -0
- package/dist/components/Seo/SeoYoutube.stories.d.ts +12 -0
- package/dist/components/Seo/SeoYoutube.stories.jsx +27 -0
- package/dist/components/Seo/SeoYoutube.stories.tsx +34 -0
- package/dist/components/Seo/SeoYoutube.tsx +103 -0
- package/dist/components/YoutubeModal/YoutubeModal.d.ts +8 -0
- package/dist/components/YoutubeModal/YoutubeModal.jsx +20 -0
- package/dist/components/YoutubeModal/YoutubeModal.tsx +57 -0
- package/dist/components/common/types/seo/index.d.ts +9 -0
- package/dist/components/common/types/seo/index.ts +10 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.ts +2 -0
- package/dist/styles/globals.css +179 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import Link from 'next/link';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import * as gtag from '../../lib/gtag';
|
|
6
|
+
import Image from 'next/image';
|
|
7
|
+
import { IAddLinkTypes } from '../common/types/seo';
|
|
8
|
+
import IconRibon from '../../asset/images/seo/seoAddLink/ribon.svg';
|
|
9
|
+
import IconLinkOn from '../../asset/images/seo/seoAddLink/link_on.webp';
|
|
10
|
+
import IconLinkArrow from '../../asset/images/seo/seoAddLink/link_arrow.webp';
|
|
11
|
+
import IconYoutube from '../../asset/images/seo/seoAddLink/logo_youtube.webp';
|
|
12
|
+
import IconYoutubeSmall from '../../asset/images/seo/seoAddLink/youtubeSmall_ico.svg';
|
|
13
|
+
|
|
14
|
+
const SeoAdditionalLink = ({ type, linkList }: { type: string; linkList: IAddLinkTypes[] }) => {
|
|
15
|
+
const referClick = () => {
|
|
16
|
+
gtag.event({
|
|
17
|
+
action: 'contents_refer',
|
|
18
|
+
category: 'contents',
|
|
19
|
+
label: '컨텐츠 내 참고 컨텐츠 클릭',
|
|
20
|
+
value: '1'
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const newsClick = () => {
|
|
25
|
+
gtag.event({
|
|
26
|
+
action: 'contents_news',
|
|
27
|
+
category: 'contents',
|
|
28
|
+
label: '컨텐츠 내 관련 기사 클릭',
|
|
29
|
+
value: '1'
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
<div
|
|
36
|
+
className={
|
|
37
|
+
'flex items-center gap-[14px] border-[1px] border-solid border-[#D0D0D0] pr-[30px] ' +
|
|
38
|
+
//640px
|
|
39
|
+
'max-sm:gap-[14px] ' +
|
|
40
|
+
//520px
|
|
41
|
+
'max-2sm:gap-[10px] '
|
|
42
|
+
}
|
|
43
|
+
>
|
|
44
|
+
{type == 'shorts' ? (
|
|
45
|
+
// 쇼츠일때는 유튜브 로고
|
|
46
|
+
<span
|
|
47
|
+
className={
|
|
48
|
+
'relative flex h-[47px] w-[130px] shrink-0 items-center ' +
|
|
49
|
+
//1500px
|
|
50
|
+
'max-3xl:h-[42px] max-3xl:w-[120px] ' +
|
|
51
|
+
//640px
|
|
52
|
+
'max-sm:h-[38px] max-sm:w-[110px] ' +
|
|
53
|
+
//520px
|
|
54
|
+
'max-2sm:h-[33px] max-2sm:w-[100px] '
|
|
55
|
+
}
|
|
56
|
+
style={{ paddingLeft: '15px' }}
|
|
57
|
+
>
|
|
58
|
+
<Image src={IconYoutube} alt="" className={'h-6 w-[105px]'} width={210} height={48} />
|
|
59
|
+
</span>
|
|
60
|
+
) : (
|
|
61
|
+
<span
|
|
62
|
+
className={
|
|
63
|
+
'relative flex h-[47px] w-[130px] shrink-0 items-center ' +
|
|
64
|
+
//1500px
|
|
65
|
+
'max-3xl:h-[42px] max-3xl:w-[120px] ' +
|
|
66
|
+
//640px
|
|
67
|
+
'max-sm:h-[38px] max-sm:w-[110px] ' +
|
|
68
|
+
//520px
|
|
69
|
+
'max-2sm:h-[33px] max-2sm:w-[100px] '
|
|
70
|
+
}
|
|
71
|
+
>
|
|
72
|
+
<IconRibon className="absolute left-0 top-0 -z-10 h-full w-auto " />
|
|
73
|
+
<p
|
|
74
|
+
className={
|
|
75
|
+
'pl-[15px] text-[24px] font-bold leading-none tracking-[-0.96px] text-white ' +
|
|
76
|
+
//1500px
|
|
77
|
+
'max-3xl:text-[22px] ' +
|
|
78
|
+
//640px
|
|
79
|
+
'max-sm:text-[18px] ' +
|
|
80
|
+
//520px
|
|
81
|
+
'max-2sm:pl-[10px] max-2sm:text-[16px] '
|
|
82
|
+
}
|
|
83
|
+
>
|
|
84
|
+
{type}
|
|
85
|
+
</p>
|
|
86
|
+
</span>
|
|
87
|
+
)}
|
|
88
|
+
<ul
|
|
89
|
+
className={
|
|
90
|
+
'flex flex-col gap-[20px] py-[24px] text-[20px] font-normal tracking-[-0.7px] ' +
|
|
91
|
+
// 쇼츠타입 추가
|
|
92
|
+
`${type == 'shorts' ? 'flex min-h-[98px] items-center justify-center ' : 'text-[#0D74CE] '}` +
|
|
93
|
+
//1500px
|
|
94
|
+
'max-3xl:text-[18px] ' +
|
|
95
|
+
//640px
|
|
96
|
+
'max-sm:gap-[12px] max-sm:py-[20px] max-sm:text-[16px] '
|
|
97
|
+
}
|
|
98
|
+
>
|
|
99
|
+
{linkList
|
|
100
|
+
.filter(l => l.title.length > 0)
|
|
101
|
+
.map(linkData => (
|
|
102
|
+
<li key={linkData.title + linkData.idx}>
|
|
103
|
+
<Link
|
|
104
|
+
href={linkData.link}
|
|
105
|
+
target={type == 'shorts' ? '_blank' : '_self'}
|
|
106
|
+
className={
|
|
107
|
+
'relative flex w-fit items-center gap-[16px] font-[600] ' +
|
|
108
|
+
//640px
|
|
109
|
+
'max-sm:gap-[8px] '
|
|
110
|
+
}
|
|
111
|
+
onClick={() => {
|
|
112
|
+
if (type === '참고') referClick();
|
|
113
|
+
else newsClick();
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
<Image
|
|
117
|
+
src={IconLinkArrow}
|
|
118
|
+
alt={''}
|
|
119
|
+
width={8}
|
|
120
|
+
height={14}
|
|
121
|
+
className={
|
|
122
|
+
'relative h-[14px] w-[8px] object-contain ' +
|
|
123
|
+
//640px
|
|
124
|
+
'max-sm:w-[6px] '
|
|
125
|
+
}
|
|
126
|
+
/>
|
|
127
|
+
<p
|
|
128
|
+
className={
|
|
129
|
+
'line-clamp-1 flex items-center leading-[1.25] max-md:line-clamp-none'
|
|
130
|
+
}
|
|
131
|
+
>
|
|
132
|
+
{linkData.title}
|
|
133
|
+
</p>
|
|
134
|
+
{type == 'shorts' ? (
|
|
135
|
+
<IconYoutubeSmall
|
|
136
|
+
className={
|
|
137
|
+
'inline aspect-square w-[24px] shrink-0 ' +
|
|
138
|
+
//1500px
|
|
139
|
+
'max-3xl:w-[20px] ' +
|
|
140
|
+
//640px
|
|
141
|
+
'max-sm:w-[16px] '
|
|
142
|
+
}
|
|
143
|
+
/>
|
|
144
|
+
) : (
|
|
145
|
+
<Image
|
|
146
|
+
src={IconLinkOn}
|
|
147
|
+
alt={''}
|
|
148
|
+
width={16}
|
|
149
|
+
height={16}
|
|
150
|
+
className={
|
|
151
|
+
'inline aspect-square w-[16px] shrink-0 ' +
|
|
152
|
+
//1500px
|
|
153
|
+
'max-3xl:w-[14px] ' +
|
|
154
|
+
//640px
|
|
155
|
+
'max-sm:w-[12px] '
|
|
156
|
+
}
|
|
157
|
+
/>
|
|
158
|
+
)}
|
|
159
|
+
</Link>
|
|
160
|
+
</li>
|
|
161
|
+
))}
|
|
162
|
+
</ul>
|
|
163
|
+
</div>
|
|
164
|
+
</>
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export default SeoAdditionalLink;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import YoutubeModal from '../YoutubeModal/YoutubeModal';
|
|
5
|
+
import LogoYoutube from '../../asset/images/seo/seoAddLink/logo_youtube.webp';
|
|
6
|
+
import IconYoutube from '../../asset/images/seo/seoYoutube/youtube_ico.svg';
|
|
7
|
+
import IconYoutubeTxt from '../../asset/images/seo/seoYoutube/youtube_txt.svg';
|
|
8
|
+
const SeoYoutube = ({ linkList }) => {
|
|
9
|
+
//유튜브 관련
|
|
10
|
+
const [isYoutubeOn, setIsYoutubeOn] = useState(false);
|
|
11
|
+
const [youtubeId, setYoutubeId] = useState('');
|
|
12
|
+
const popOffBtnRef = useRef(null);
|
|
13
|
+
const extractYouTubeID = (url) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const regex = /(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})/;
|
|
16
|
+
const match = url.match(regex);
|
|
17
|
+
return (_a = match === null || match === void 0 ? void 0 : match[1]) !== null && _a !== void 0 ? _a : '';
|
|
18
|
+
};
|
|
19
|
+
const handleClickUpYoutube = () => {
|
|
20
|
+
setIsYoutubeOn(!isYoutubeOn);
|
|
21
|
+
setYoutubeId('');
|
|
22
|
+
};
|
|
23
|
+
const handleButtonClick = (id, num) => {
|
|
24
|
+
setYoutubeId(id);
|
|
25
|
+
setIsYoutubeOn(true); // 켜진 상태로 변경
|
|
26
|
+
};
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
var _a;
|
|
29
|
+
(_a = popOffBtnRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
30
|
+
}, [isYoutubeOn]);
|
|
31
|
+
return (<>
|
|
32
|
+
<section className={'mt-8 flex justify-between gap-[36px] border-b border-solid border-[#DBDBDB] pb-[60px] tracking-[-1.92px] ' +
|
|
33
|
+
//1500px
|
|
34
|
+
'max-3xl:gap-[24px] ' +
|
|
35
|
+
//640px
|
|
36
|
+
'max-md2:flex-col max-md2:pb-6'}>
|
|
37
|
+
{/*pc 로고뷰*/}
|
|
38
|
+
<div className={'flex w-fit min-w-[264px] flex-col gap-y-9 max-md2:hidden'}>
|
|
39
|
+
<div className={'flex flex-col gap-5'}>
|
|
40
|
+
<IconYoutube className={'h-[67px] w-[99px]'}/>
|
|
41
|
+
<IconYoutubeTxt className={'h-[35px] w-[117px]'}/>
|
|
42
|
+
</div>
|
|
43
|
+
<p className={'text-2xl font-semibold leading-[34px] text-[#545454] '}>
|
|
44
|
+
해당 업무사례와 관련된
|
|
45
|
+
<br />
|
|
46
|
+
영상 콘텐츠도 함께 확인하세요.
|
|
47
|
+
</p>
|
|
48
|
+
</div>
|
|
49
|
+
{/*모바일 로고뷰*/}
|
|
50
|
+
<div className={'hidden max-md2:block'}>
|
|
51
|
+
<Image src={LogoYoutube} alt="" className={'h-[29px] w-[96px] object-contain'}/>
|
|
52
|
+
</div>
|
|
53
|
+
<ol className={'h-fit w-full max-w-[657px] gap-y-4 max-md2:max-w-full'}>
|
|
54
|
+
{linkList
|
|
55
|
+
.filter(l => l.title.length > 0)
|
|
56
|
+
.map((linkData, index) => (<li key={linkData.title + linkData.idx} className={'flex w-full flex-col gap-4 max-md2:gap-[10px]'} onClick={() => { var _a; return handleButtonClick((_a = extractYouTubeID(linkData.link)) !== null && _a !== void 0 ? _a : '', index); }}>
|
|
57
|
+
<div className="aspect-video w-full">
|
|
58
|
+
<iframe className="pointer-events-none h-full w-full" src={`https://www.youtube.com/embed/${extractYouTubeID(linkData.link)}?autoplay=0&mute=1&controls=0`} title="YouTube preview" frameBorder="0" allow=""></iframe>
|
|
59
|
+
</div>
|
|
60
|
+
<p className={'line-clamp-1 text-2xl font-semibold leading-9 text-[#545454] max-md2:text-[18px] max-md2:leading-6'}>
|
|
61
|
+
{linkData.title}
|
|
62
|
+
</p>
|
|
63
|
+
</li>))}
|
|
64
|
+
</ol>
|
|
65
|
+
<YoutubeModal onClick={handleClickUpYoutube} isYoutubeOn={isYoutubeOn} youtubeId={youtubeId} popOffBtnRef={popOffBtnRef}/>
|
|
66
|
+
</section>
|
|
67
|
+
</>);
|
|
68
|
+
};
|
|
69
|
+
export default SeoYoutube;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import SeoYoutube from './SeoYoutube';
|
|
2
|
+
import type { StoryObj } from '@storybook/react';
|
|
3
|
+
import '../../styles/globals.css';
|
|
4
|
+
declare const SeoYoutubeComponent: {
|
|
5
|
+
component: ({ linkList }: {
|
|
6
|
+
linkList: import("../common/types/seo").IAddLinkTypes[];
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
8
|
+
title: string;
|
|
9
|
+
};
|
|
10
|
+
export default SeoYoutubeComponent;
|
|
11
|
+
type Story = StoryObj<typeof SeoYoutube>;
|
|
12
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import SeoYoutube from './SeoYoutube';
|
|
2
|
+
import '../../styles/globals.css';
|
|
3
|
+
const SeoYoutubeComponent = {
|
|
4
|
+
component: SeoYoutube,
|
|
5
|
+
title: 'SeoYoutube'
|
|
6
|
+
};
|
|
7
|
+
export default SeoYoutubeComponent;
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: args => {
|
|
10
|
+
return (<div className={'font-[SUIT]'}>
|
|
11
|
+
<SeoYoutube {...args}/>
|
|
12
|
+
</div>);
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
linkList: [
|
|
16
|
+
{
|
|
17
|
+
type_idx: 0,
|
|
18
|
+
tag_idx: 0,
|
|
19
|
+
type: 'youtube',
|
|
20
|
+
seo_type: 'success',
|
|
21
|
+
title: '🚨실제 의뢰인 녹화본🚨 보이스피싱 피의자 경찰 조사 #경찰조사이렇게하는거다',
|
|
22
|
+
link: 'https://www.youtube.com/watch?v=EVW4ruKm4HA',
|
|
23
|
+
idx: 0
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import SeoYoutube from './SeoYoutube';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import '../../styles/globals.css';
|
|
4
|
+
|
|
5
|
+
const SeoYoutubeComponent = {
|
|
6
|
+
component: SeoYoutube,
|
|
7
|
+
title: 'SeoYoutube'
|
|
8
|
+
} satisfies Meta<typeof SeoYoutube>;
|
|
9
|
+
|
|
10
|
+
export default SeoYoutubeComponent;
|
|
11
|
+
type Story = StoryObj<typeof SeoYoutube>;
|
|
12
|
+
|
|
13
|
+
export const Default: Story = {
|
|
14
|
+
render: args => {
|
|
15
|
+
return (
|
|
16
|
+
<div className={'font-[SUIT]'}>
|
|
17
|
+
<SeoYoutube {...args} />
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
linkList: [
|
|
23
|
+
{
|
|
24
|
+
type_idx: 0,
|
|
25
|
+
tag_idx: 0,
|
|
26
|
+
type: 'youtube',
|
|
27
|
+
seo_type: 'success',
|
|
28
|
+
title: '🚨실제 의뢰인 녹화본🚨 보이스피싱 피의자 경찰 조사 #경찰조사이렇게하는거다',
|
|
29
|
+
link: 'https://www.youtube.com/watch?v=EVW4ruKm4HA',
|
|
30
|
+
idx: 0
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
5
|
+
import YoutubeModal from '../YoutubeModal/YoutubeModal';
|
|
6
|
+
import { IAddLinkTypes } from '../common/types/seo';
|
|
7
|
+
|
|
8
|
+
import LogoYoutube from '../../asset/images/seo/seoAddLink/logo_youtube.webp';
|
|
9
|
+
import IconYoutube from '../../asset/images/seo/seoYoutube/youtube_ico.svg';
|
|
10
|
+
import IconYoutubeTxt from '../../asset/images/seo/seoYoutube/youtube_txt.svg';
|
|
11
|
+
|
|
12
|
+
const SeoYoutube = ({ linkList }: { linkList: IAddLinkTypes[] }) => {
|
|
13
|
+
//유튜브 관련
|
|
14
|
+
const [isYoutubeOn, setIsYoutubeOn] = useState<boolean>(false);
|
|
15
|
+
const [youtubeId, setYoutubeId] = useState<string>('');
|
|
16
|
+
const popOffBtnRef = useRef<HTMLButtonElement>(null);
|
|
17
|
+
|
|
18
|
+
const extractYouTubeID = (url: string): string => {
|
|
19
|
+
const regex = /(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})/;
|
|
20
|
+
const match = url.match(regex);
|
|
21
|
+
return match?.[1] ?? '';
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const handleClickUpYoutube = () => {
|
|
25
|
+
setIsYoutubeOn(!isYoutubeOn);
|
|
26
|
+
setYoutubeId('');
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const handleButtonClick = (id: string, num: number) => {
|
|
30
|
+
setYoutubeId(id);
|
|
31
|
+
setIsYoutubeOn(true); // 켜진 상태로 변경
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
popOffBtnRef.current?.focus();
|
|
36
|
+
}, [isYoutubeOn]);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<>
|
|
40
|
+
<section
|
|
41
|
+
className={
|
|
42
|
+
'mt-8 flex justify-between gap-[36px] border-b border-solid border-[#DBDBDB] pb-[60px] tracking-[-1.92px] ' +
|
|
43
|
+
//1500px
|
|
44
|
+
'max-3xl:gap-[24px] ' +
|
|
45
|
+
//640px
|
|
46
|
+
'max-md2:flex-col max-md2:pb-6'
|
|
47
|
+
}
|
|
48
|
+
>
|
|
49
|
+
{/*pc 로고뷰*/}
|
|
50
|
+
<div className={'flex w-fit min-w-[264px] flex-col gap-y-9 max-md2:hidden'}>
|
|
51
|
+
<div className={'flex flex-col gap-5'}>
|
|
52
|
+
<IconYoutube className={'h-[67px] w-[99px]'} />
|
|
53
|
+
<IconYoutubeTxt className={'h-[35px] w-[117px]'} />
|
|
54
|
+
</div>
|
|
55
|
+
<p className={'text-2xl font-semibold leading-[34px] text-[#545454] '}>
|
|
56
|
+
해당 업무사례와 관련된
|
|
57
|
+
<br />
|
|
58
|
+
영상 콘텐츠도 함께 확인하세요.
|
|
59
|
+
</p>
|
|
60
|
+
</div>
|
|
61
|
+
{/*모바일 로고뷰*/}
|
|
62
|
+
<div className={'hidden max-md2:block'}>
|
|
63
|
+
<Image src={LogoYoutube} alt="" className={'h-[29px] w-[96px] object-contain'} />
|
|
64
|
+
</div>
|
|
65
|
+
<ol className={'h-fit w-full max-w-[657px] gap-y-4 max-md2:max-w-full'}>
|
|
66
|
+
{linkList
|
|
67
|
+
.filter(l => l.title.length > 0)
|
|
68
|
+
.map((linkData, index) => (
|
|
69
|
+
<li
|
|
70
|
+
key={linkData.title + linkData.idx}
|
|
71
|
+
className={'flex w-full flex-col gap-4 max-md2:gap-[10px]'}
|
|
72
|
+
onClick={() => handleButtonClick(extractYouTubeID(linkData.link) ?? '', index)}
|
|
73
|
+
>
|
|
74
|
+
<div className="aspect-video w-full">
|
|
75
|
+
<iframe
|
|
76
|
+
className="pointer-events-none h-full w-full"
|
|
77
|
+
src={`https://www.youtube.com/embed/${extractYouTubeID(linkData.link)}?autoplay=0&mute=1&controls=0`}
|
|
78
|
+
title="YouTube preview"
|
|
79
|
+
frameBorder="0"
|
|
80
|
+
allow=""
|
|
81
|
+
></iframe>
|
|
82
|
+
</div>
|
|
83
|
+
<p
|
|
84
|
+
className={
|
|
85
|
+
'line-clamp-1 text-2xl font-semibold leading-9 text-[#545454] max-md2:text-[18px] max-md2:leading-6'
|
|
86
|
+
}
|
|
87
|
+
>
|
|
88
|
+
{linkData.title}
|
|
89
|
+
</p>
|
|
90
|
+
</li>
|
|
91
|
+
))}
|
|
92
|
+
</ol>
|
|
93
|
+
<YoutubeModal
|
|
94
|
+
onClick={handleClickUpYoutube}
|
|
95
|
+
isYoutubeOn={isYoutubeOn}
|
|
96
|
+
youtubeId={youtubeId}
|
|
97
|
+
popOffBtnRef={popOffBtnRef}
|
|
98
|
+
/>
|
|
99
|
+
</section>
|
|
100
|
+
</>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
export default SeoYoutube;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
//상단 유튜브 클릭 시 모달
|
|
3
|
+
const YoutubeModal = (props) => {
|
|
4
|
+
const { onClick, isYoutubeOn, youtubeId, popOffBtnRef } = props;
|
|
5
|
+
return (<div className={'fixed left-0 top-0 z-[9999] h-full w-full bg-black bg-opacity-50 ' + `${isYoutubeOn ? '' : 'hidden'}`}>
|
|
6
|
+
<div className={'absolute left-[50%] top-[50%] aspect-[110/62] w-[80%] max-w-[1100px] translate-x-[-50%] translate-y-[-50%] ' +
|
|
7
|
+
//1024px
|
|
8
|
+
'max-lg:aspect-[unset] max-lg:h-[40%] max-lg:min-h-[350px] max-lg:w-[90%]'}>
|
|
9
|
+
<button type={'button'} className={'absolute right-[-40px] top-[-50px] text-[35px] text-white ' +
|
|
10
|
+
//1024px
|
|
11
|
+
'max-lg:right-0'} ref={popOffBtnRef} onClick={onClick} aria-label={'유튜브 모달 닫기'}>
|
|
12
|
+
✕
|
|
13
|
+
</button>
|
|
14
|
+
<span className={'mx-auto w-full'}>
|
|
15
|
+
<iframe title={'youtube'} width="1100" height="619" src={`https://www.youtube.com/embed/${youtubeId}`} frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowFullScreen className={'h-full w-full '}></iframe>
|
|
16
|
+
</span>
|
|
17
|
+
</div>
|
|
18
|
+
</div>);
|
|
19
|
+
};
|
|
20
|
+
export default YoutubeModal;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { RefObject } from 'react';
|
|
4
|
+
//상단 유튜브 클릭 시 모달
|
|
5
|
+
const YoutubeModal = (props: {
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
isYoutubeOn: boolean;
|
|
8
|
+
youtubeId: string;
|
|
9
|
+
popOffBtnRef: RefObject<HTMLButtonElement>;
|
|
10
|
+
}) => {
|
|
11
|
+
const { onClick, isYoutubeOn, youtubeId, popOffBtnRef } = props;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
className={
|
|
16
|
+
'fixed left-0 top-0 z-[9999] h-full w-full bg-black bg-opacity-50 ' + `${isYoutubeOn ? '' : 'hidden'}`
|
|
17
|
+
}
|
|
18
|
+
// onClick={handleClickUpYoutube}
|
|
19
|
+
>
|
|
20
|
+
<div
|
|
21
|
+
className={
|
|
22
|
+
'absolute left-[50%] top-[50%] aspect-[110/62] w-[80%] max-w-[1100px] translate-x-[-50%] translate-y-[-50%] ' +
|
|
23
|
+
//1024px
|
|
24
|
+
'max-lg:aspect-[unset] max-lg:h-[40%] max-lg:min-h-[350px] max-lg:w-[90%]'
|
|
25
|
+
}
|
|
26
|
+
>
|
|
27
|
+
<button
|
|
28
|
+
type={'button'}
|
|
29
|
+
className={
|
|
30
|
+
'absolute right-[-40px] top-[-50px] text-[35px] text-white ' +
|
|
31
|
+
//1024px
|
|
32
|
+
'max-lg:right-0'
|
|
33
|
+
}
|
|
34
|
+
ref={popOffBtnRef}
|
|
35
|
+
onClick={onClick}
|
|
36
|
+
aria-label={'유튜브 모달 닫기'}
|
|
37
|
+
>
|
|
38
|
+
✕
|
|
39
|
+
</button>
|
|
40
|
+
<span className={'mx-auto w-full'}>
|
|
41
|
+
<iframe
|
|
42
|
+
title={'youtube'}
|
|
43
|
+
width="1100"
|
|
44
|
+
height="619"
|
|
45
|
+
src={`https://www.youtube.com/embed/${youtubeId}`}
|
|
46
|
+
frameBorder="0"
|
|
47
|
+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
|
48
|
+
allowFullScreen
|
|
49
|
+
className={'h-full w-full '}
|
|
50
|
+
></iframe>
|
|
51
|
+
</span>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default YoutubeModal;
|
|
@@ -27,3 +27,13 @@ export interface IFieldTypes {
|
|
|
27
27
|
field_title: string;
|
|
28
28
|
pathname: string;
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
export interface IAddLinkTypes {
|
|
32
|
+
type_idx: number;
|
|
33
|
+
tag_idx: number;
|
|
34
|
+
type: string;
|
|
35
|
+
seo_type: string;
|
|
36
|
+
title: string;
|
|
37
|
+
link: string;
|
|
38
|
+
idx: number;
|
|
39
|
+
}
|
package/dist/components/index.js
CHANGED
|
@@ -35,3 +35,5 @@ export { default as SearchBar } from './SearchBar/SearchBar';
|
|
|
35
35
|
export { default as VisitReservationLawyer } from './VisitReservationLawyer/VisitReservationLawyer';
|
|
36
36
|
export { default as RelatedGroup } from './FieldNew/RelatedGroup';
|
|
37
37
|
export { default as FooterV2 } from './Footer/FooterV2';
|
|
38
|
+
export { default as SeoYoutube } from './Seo/SeoYoutube';
|
|
39
|
+
export { default as SeoAdditionalLink } from './Seo/SeoAdditionalLink';
|
package/dist/components/index.ts
CHANGED
|
@@ -35,3 +35,5 @@ export { default as SearchBar } from './SearchBar/SearchBar';
|
|
|
35
35
|
export { default as VisitReservationLawyer } from './VisitReservationLawyer/VisitReservationLawyer';
|
|
36
36
|
export { default as RelatedGroup } from './FieldNew/RelatedGroup';
|
|
37
37
|
export { default as FooterV2 } from './Footer/FooterV2';
|
|
38
|
+
export { default as SeoYoutube } from './Seo/SeoYoutube';
|
|
39
|
+
export { default as SeoAdditionalLink } from './Seo/SeoAdditionalLink';
|