From 137e14b3d155864e66fb869a9112938a0283e58a Mon Sep 17 00:00:00 2001 From: Ronny Date: Sat, 11 Apr 2026 22:46:53 +0200 Subject: [PATCH] fix: kickoff time centered without 'Uhr', unified countdown badge, DevPanel close button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Kickoff: centered "21:00" above flags (no 'Uhr' suffix) - Countdown: always rendered as badge (was unstyled span for <60min) - DevPanel: added close button (โœ•) in panel header for reliable closing Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/components/DevPanel.module.css | 17 ++++++++ frontend/src/components/DevPanel.tsx | 1 + frontend/src/components/MatchCard.module.css | 13 ++++-- frontend/src/components/MatchCard.tsx | 42 ++++++++++---------- 4 files changed, 47 insertions(+), 26 deletions(-) diff --git a/frontend/src/components/DevPanel.module.css b/frontend/src/components/DevPanel.module.css index f043d6c..2755f9b 100644 --- a/frontend/src/components/DevPanel.module.css +++ b/frontend/src/components/DevPanel.module.css @@ -46,6 +46,23 @@ padding: 12px 16px; background: rgba(254,174,50,0.08); border-bottom: 1px solid rgba(254,174,50,0.15); + display: flex; + align-items: center; + justify-content: space-between; +} + +.closeBtn { + background: none; + border: none; + color: var(--text-muted); + font-size: 16px; + cursor: pointer; + padding: 4px 8px; + border-radius: 6px; +} +.closeBtn:hover { + background: rgba(255,255,255,0.1); + color: var(--text-primary); } .panelTitle { diff --git a/frontend/src/components/DevPanel.tsx b/frontend/src/components/DevPanel.tsx index 35732ce..a797462 100644 --- a/frontend/src/components/DevPanel.tsx +++ b/frontend/src/components/DevPanel.tsx @@ -131,6 +131,7 @@ export default function DevPanel({ currentUser, onUserChange, matches, onRefresh
๐Ÿงช Simulations-Modus +
{/* User Switcher */} diff --git a/frontend/src/components/MatchCard.module.css b/frontend/src/components/MatchCard.module.css index 25761fa..8762e78 100644 --- a/frontend/src/components/MatchCard.module.css +++ b/frontend/src/components/MatchCard.module.css @@ -77,12 +77,17 @@ border: 1px solid rgba(75,183,248,0.15); } -/* Kickoff badge in header row */ -.kickoffBadge { - font-size: 12px; +/* Kickoff time โ€” centered above flags */ +.kickoffRow { + text-align: center; + margin-bottom: 6px; +} + +.kickoffTime { + font-size: 13px; font-weight: 700; color: var(--text-secondary); - letter-spacing: 0.02em; + letter-spacing: 0.05em; } .topRowSpacer { diff --git a/frontend/src/components/MatchCard.tsx b/frontend/src/components/MatchCard.tsx index 2652dae..3df31d7 100644 --- a/frontend/src/components/MatchCard.tsx +++ b/frontend/src/components/MatchCard.tsx @@ -47,17 +47,7 @@ const STATUS_LABELS: Record = { function formatKickoff(utcDate: string): string { return new Date(utcDate).toLocaleString('de-DE', { hour: '2-digit', minute: '2-digit', timeZone: 'Europe/Berlin', - }) + ' Uhr'; -} - -function CountdownBadge({ minutes }: { minutes: number }) { - if (minutes <= 0) return null; - if (minutes < 60) return โšก in {minutes} Min.; - const h = Math.floor(minutes / 60); - const m = minutes % 60; - if (h < 24) return in {h}h{m > 0 ? ` ${m}m` : ''}; - const d = Math.floor(h / 24); - return in {d} Tag{d > 1 ? 'en' : ''}; + }); } function FlagBox({ crest, name }: { crest: string | null; name: string }) { @@ -94,7 +84,7 @@ export default function MatchCard({ match, onTip }: Props) { return (
- {/* Top row: Group + Kickoff + Countdown */} + {/* Top row: Group + Countdown */}
{(isLive || isFinished) && ( @@ -107,21 +97,29 @@ export default function MatchCard({ match, onTip }: Props) { {match.group.replace('GROUP_', 'Gruppe ')} )} - {!isFinished && !isLive && ( - {formatKickoff(match.utcDate)} - )} {(state === 'open' || state === 'tipped') && match.tippable && ( - match.minutesUntilKickoff < 60 ? ( - - Noch {remainingMins} Min! - - ) : ( - - ) + + {match.minutesUntilKickoff < 60 + ? `Noch ${remainingMins} Min!` + : (() => { + const h = Math.floor(match.minutesUntilKickoff / 60); + if (h < 24) return `in ${h}h`; + const d = Math.floor(h / 24); + return `in ${d} Tag${d > 1 ? 'en' : ''}`; + })() + } + )}
+ {/* Kickoff time โ€” centered above flags */} + {!isFinished && !isLive && ( +
+ {formatKickoff(match.utcDate)} +
+ )} + {/* Teams + Score */}
{/* Home */}