fix: 공통으로 공유하기 사용하도록 변경

This commit is contained in:
김성경 2026-08-18 14:56:38 +09:00
parent 3566c1f7bc
commit e400884eb7
7 changed files with 6 additions and 30 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@ -8,7 +8,6 @@ interface ContentCardSocialActionsProps {
videoId: number;
storeName: string;
region?: string;
posterUrl?: string | null;
commentCount: number;
initialLikeCount: number;
initialIsLiked?: boolean;
@ -18,7 +17,6 @@ const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
videoId,
storeName,
region,
posterUrl,
commentCount,
initialLikeCount,
initialIsLiked = false,
@ -36,11 +34,9 @@ const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
const shareMenuRef = useRef<HTMLDivElement>(null);
const likeDebounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const videoPageUrl = `${window.location.origin}/video/${videoId}`;
const shareUrl = buildVideoShareUrl(API_URL, videoId);
const shareTitle = storeName || t('videoDetail.kakaoDefaultTitle');
const shareDescription = t('videoDetail.kakaoDescription', { region: region ?? '' });
const shareImageUrl = posterUrl || `${window.location.origin}/assets/images/hero-background.png`;
useEffect(() => {
if (!shareMenuOpen) return;
@ -100,16 +96,9 @@ const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
const handleKakaoShare = () => {
const kakao = window.Kakao;
if (kakao?.Share) {
kakao.Share.sendDefault({
objectType: 'feed',
content: {
title: shareTitle,
description: shareDescription,
imageUrl: shareImageUrl,
link: { mobileWebUrl: videoPageUrl, webUrl: videoPageUrl },
},
buttons: [{ title: t('videoDetail.kakaoButtonTitle'), link: { mobileWebUrl: videoPageUrl, webUrl: videoPageUrl } }],
});
// 공유 URL(백엔드 OG 페이지)을 스크랩해 제목/설명/이미지를 자동으로 채운다.
// 다른 채널과 동일한 shareUrl을 쓰므로 카카오만을 위한 별도 콘텐츠 지정이 필요 없다.
kakao.Share.sendScrap({ requestUrl: shareUrl });
} else if (navigator.share) {
navigator.share({ title: shareTitle, text: shareDescription, url: shareUrl }).catch(() => {});
} else {

View File

@ -103,11 +103,9 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
return `${date.getFullYear()}.${String(date.getMonth() + 1).padStart(2, '0')}.${String(date.getDate()).padStart(2, '0')}`;
};
const videoPageUrl = `${window.location.origin}/video/${videoId}`;
const shareUrl = buildVideoShareUrl(API_URL, videoId);
const shareTitle = video?.store_name ?? t('videoDetail.kakaoDefaultTitle');
const shareDescription = t('videoDetail.kakaoDescription', { region: video?.region ?? '' });
const shareImageUrl = video?.poster_url || `${window.location.origin}/assets/images/hero-background.png`;
const handleCopyLink = async () => {
try {
@ -122,16 +120,9 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
const handleKakaoShare = () => {
const kakao = window.Kakao;
if (kakao?.Share) {
kakao.Share.sendDefault({
objectType: 'feed',
content: {
title: shareTitle,
description: shareDescription,
imageUrl: shareImageUrl,
link: { mobileWebUrl: videoPageUrl, webUrl: videoPageUrl },
},
buttons: [{ title: t('videoDetail.kakaoButtonTitle'), link: { mobileWebUrl: videoPageUrl, webUrl: videoPageUrl } }],
});
// 공유 URL(백엔드 OG 페이지)을 스크랩해 제목/설명/이미지를 자동으로 채운다.
// 다른 채널과 동일한 shareUrl을 쓰므로 카카오만을 위한 별도 콘텐츠 지정이 필요 없다.
kakao.Share.sendScrap({ requestUrl: shareUrl });
} else if (navigator.share) {
navigator.share({ title: shareTitle, text: shareDescription, url: shareUrl }).catch(() => {});
} else {

View File

@ -620,7 +620,6 @@
"dateFormat": "{{month}}/{{day}}/{{year}}",
"kakaoDefaultTitle": "ADO2 Video",
"kakaoDescription": "{{region}} · ADO2 AI Marketing Video",
"kakaoButtonTitle": "Watch Video",
"deletedComment": "(This comment has been deleted.)",
"closeAriaLabel": "Close",
"share": "Share",

View File

@ -619,7 +619,6 @@
"dateFormat": "{{year}}년 {{month}}월 {{day}}일",
"kakaoDefaultTitle": "ADO2 영상",
"kakaoDescription": "{{region}} · ADO2 AI 마케팅 영상",
"kakaoButtonTitle": "영상 보기",
"deletedComment": "(삭제된 댓글입니다.)",
"closeAriaLabel": "닫기",
"share": "공유하기",

View File

@ -194,7 +194,6 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
videoId={video.video_id}
storeName={video.store_name}
region={video.region}
posterUrl={video.poster_url}
commentCount={video.comment_count ?? 0}
initialLikeCount={video.like_count ?? 0}
initialIsLiked={video.is_liked_by_me}

View File

@ -291,7 +291,6 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
videoId={video.video_id}
storeName={video.store_name}
region={video.region}
posterUrl={video.poster_url}
commentCount={video.comment_count ?? 0}
initialLikeCount={video.like_count ?? 0}
initialIsLiked={video.is_liked_by_me}