Private
Public Access
1
0

chg: usr: make fancy og tags - and create a special one for battle sharing #4

This commit is contained in:
2026-04-14 18:54:44 +02:00
parent 5d6aff8d90
commit d515f42cfd
21 changed files with 782 additions and 318 deletions

View File

@@ -134,8 +134,8 @@ function StatRow({ icon, label, value, valueColor }) {
}
export default function BattleDialog({ games }) {
const [open, setOpen] = useState(false);
const [game, setGame] = useState(null);
const [open, setOpen] = useState(false);
const [game, setGame] = useState(null);
const [copied, setCopied] = useState(false);
useEffect(() => {
@@ -156,18 +156,18 @@ export default function BattleDialog({ games }) {
return <ThemeProvider theme={darkTheme}><Dialog open={false} sx={DIALOG_SX} /></ThemeProvider>;
}
const meta = RESULT_META[game.result] ?? RESULT_META.draw;
const resign = game.resign;
const meta = RESULT_META[game.result] ?? RESULT_META.draw;
const resign = game.resign;
const endReason = resign
? `${resign.charAt(0).toUpperCase() + resign.slice(1)} resigned`
: 'Points';
const shareUrl = `${window.location.origin}/battle/${game.id}`;
? `${resign.charAt(0).toUpperCase() + resign.slice(1)} resigned`
: 'Points';
const shareUrl = `${window.location.origin}/battle/${game.uuid}`;
const handleShare = () => {
navigator.clipboard.writeText(shareUrl).then(() => {
setCopied(true);
setTimeout(() => setCopied(false), 2200);
});
navigator.clipboard.writeText(shareUrl).then(() => {
setCopied(true);
setTimeout(() => setCopied(false), 2200);
});
};
return (