fix: 공유하기 및 UI 수정

This commit is contained in:
skkim committed 2026-08-20 10:34:14 +09:00
1 parent 4dff60c1ba
commit 17319e950e
14 files changed
+169 -274

No files matched your search

+5 -5
View File
@@ -20,20 +20,20 @@ export async function tryNativeShare(data: ShareData): Promise<boolean> {
}
}
/** API 서버가 제공하는 영상별 Open Graph 공유 페이지 URL을 만듭니다. */
/** API 서버의 영상 Open Graph 공유 페이지 URL을 만듭니다. */
export function buildVideoShareUrl(apiBaseUrl: string, videoId: number | string): string {
return `${apiBaseUrl.replace(/\/$/, '')}/video/share/${encodeURIComponent(String(videoId))}`;
}
/** 콘텐츠 종류별 공개 공유 URL. video.id 와 ssul_content.id 가 겹치므로 경로를 갈라야 한다. */
/** 콘텐츠 종류별 공유 URL. video.id 와 ssul_content.id 가 겹치므로 경로를 갈라야 한다. */
export function buildContentShareUrl(
apiBaseUrl: string,
contentId: number | string,
contentType: 'video' | 'ssul' = 'video',
): string {
const base = apiBaseUrl.replace(/\/$/, '');
if (contentType === 'ssul') {
const origin = typeof window !== 'undefined' ? window.location.origin : '';
return `${origin}/ssul/${encodeURIComponent(String(contentId))}`;
return `${base}/ssul/share/${encodeURIComponent(String(contentId))}`;
}
return buildVideoShareUrl(apiBaseUrl, contentId);
return buildVideoShareUrl(base, contentId);
}