Unify all flags to rectangular SVG (fix waving emoji inconsistency)

- 원인: MEX·RSA는 이모지 국기(OS별 휘날림/광택), KOR·CZE만 실제 이미지 → 불일치
- 해결: 4개국 전부 flagcdn 직사각형 SVG(public/icons/flags) + object-cover로 통일, 이모지 제거
- 미등록 국가는 이모지 fallback 유지

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Haewon KamandClaude Opus 4.8 committed 2026-06-10 09:35:14 +09:00
1 parent 9b35a759a9
commit f29dbd0454
5 files changed
+18 -20

No files matched your search

+14 -20
View File
@@ -1,7 +1,14 @@
import type { Team } from "@/lib/types";
// 모든 경기에 일반화된 국기 렌더.
// KOR = 실제 png 자산, CZE = 인라인 SVG(비율 보존), 그 외 = 이모지(컨테이너 높이에 비례, 안 잘림).
// 모든 국기를 직사각형 SVG로 통일 (flagcdn, 퍼블릭 도메인).
// 이모지(OS별 휘날림/광택 렌더) 제거 → 일관된 사각형. object-cover로 박스를 꽉 채움(왜곡 없음).
const FLAG_FILE: Record<string, string> = {
KOR: "kr",
CZE: "cz",
MEX: "mx",
RSA: "za",
};
export default function TeamFlag({
team,
className = "",
@@ -9,30 +16,17 @@ export default function TeamFlag({
team: Team;
className?: string;
}) {
if (team.code === "KOR") {
const file = FLAG_FILE[team.code];
if (file) {
return (
<img
src="/icons/kor.png"
src={`/icons/flags/${file}.svg`}
alt={team.name}
className={`flag-img object-cover ${className}`}
className={`border border-[var(--line-d)] object-cover ${className}`}
/>
);
}
if (team.code === "CZE") {
return (
<svg
viewBox="0 0 6 4"
className={`border border-[var(--line-d)] ${className}`}
preserveAspectRatio="xMidYMid meet"
aria-label={team.name}
>
<rect width="6" height="2" y="0" fill="#ffffff" />
<rect width="6" height="2" y="2" fill="#d7141a" />
<polygon points="0,0 3,2 0,4" fill="#11457e" />
</svg>
);
}
// 그 외 국가 — 이모지 국기. 컨테이너 높이(cqh) 기준으로 크기를 잡아 잘림/찌그러짐 방지.
// 미등록 국가 fallback — 이모지(직사각형 박스, 잘림 없음)
return (
<span
className={`grid place-items-center overflow-hidden border border-[var(--line-d)] bg-white/[0.06] ${className}`}