플레이어에 가사 보기·공유하기 + 응원가 전용 OG 공유 카드

- 하단 MusicBar: 가사 패널 토글(바 위로 펼침)·공유 버튼(네이티브 공유,
  폴백 클립보드) — 응원가 트랙에만 노출
- 공유 링크 /song/:matchId/:teamCode — 크롤러(카톡·페북)는 "오늘의 OO
  응원가" 제목 + Suno 앨범아트 OG 카드, 사람은 경기 페이지로 리다이렉트
  후 그 팀 응원가 자동 로드(?song=)
- nginx /song/ 크롤러 분기 추가

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
JinwooKimandClaude Fable 5 committed 2026-08-25 10:20:54 +09:00
1 parent dbd08e62c7
commit 3a5fc36ee8
6 files changed
+199 -4

No files matched your search

+13 -1
View File
@@ -1,4 +1,4 @@
import { useEffect, useState } from "react";
import { useEffect, useRef, useState } from "react";
import type { Match, TeamStanding } from "@/lib/types";
import { kickoffDisplay } from "@/lib/format";
import { type Lang, dict, teamShort, roundLabel as tRound } from "@/lib/i18n";
@@ -30,6 +30,18 @@ function CheerSongButton({
};
}, [matchId, teamCode]);
// 공유 링크(/song/...→ ?song=팀코드) 진입 시 그 팀 응원가 자동 로드 (1회)
const autoLoaded = useRef(false);
useEffect(() => {
if (autoLoaded.current || tracks.length === 0) return;
const q = new URLSearchParams(window.location.search).get("song");
if (q === teamCode) {
autoLoaded.current = true;
loadPlaylist(tracks);
open();
}
}, [tracks, teamCode, loadPlaylist, open]);
if (tracks.length === 0) return null;
const active = !!currentTrack && tracks.some((t) => t.src === currentTrack.src);
const label = active