diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index ff3a337..ba7ca9f 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -515,6 +515,8 @@ export default function App() { setGameId={setGameId} onOpenHelp={() => setHelpOpen(true)} members={members} + me={me} + hostUserId={gameMeta?.host_user_id || ""} /> {/* Sieger Badge: zwischen Spiel und Verdächtigte Person */} diff --git a/frontend/src/components/GamePickerCard.jsx b/frontend/src/components/GamePickerCard.jsx index 90c616f..3e03dab 100644 --- a/frontend/src/components/GamePickerCard.jsx +++ b/frontend/src/components/GamePickerCard.jsx @@ -2,7 +2,46 @@ import React from "react"; import { styles } from "../styles/styles"; import { stylesTokens } from "../styles/theme"; -export default function GamePickerCard({ games, gameId, setGameId, onOpenHelp, members = [] }) { +export default function GamePickerCard({ + games, + gameId, + setGameId, + onOpenHelp, + members = [], + me, + hostUserId, +}) { + const cur = games.find((x) => x.id === gameId); + + const renderMemberName = (m) => { + const base = ((m.display_name || "").trim() || (m.email || "").trim() || "—"); + const isMe = !!(me?.id && String(me.id) === String(m.id)); + const isHost = !!(hostUserId && String(hostUserId) === String(m.id)); + + const suffix = `${isHost ? " ⭐" : ""}${isMe ? " (du)" : ""}`; + return base + suffix; + }; + + const pillStyle = (isHost, isMe) => ({ + padding: "7px 10px", + borderRadius: 999, + border: `1px solid ${ + isHost ? "rgba(233,216,166,0.35)" : "rgba(233,216,166,0.16)" + }`, + background: isHost + ? "linear-gradient(180deg, rgba(233,216,166,0.14), rgba(10,10,12,0.35))" + : "rgba(10,10,12,0.30)", + color: stylesTokens.textMain, + fontSize: 13, + fontWeight: 950, + boxShadow: isHost ? "0 8px 18px rgba(0,0,0,0.25)" : "none", + opacity: isMe ? 1 : 0.95, + display: "inline-flex", + alignItems: "center", + gap: 6, + whiteSpace: "nowrap", + }); + return (