From 243183ca269402f57b3649cd77ca5d06059fd1f9 Mon Sep 17 00:00:00 2001 From: Andrew Casal Date: Sat, 8 Jun 2024 14:55:49 -0400 Subject: [PATCH] Add handicap to game history table --- src/views/User/GameHistoryTable.tsx | 9 +++++++++ src/views/User/User.styl | 13 ++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/views/User/GameHistoryTable.tsx b/src/views/User/GameHistoryTable.tsx index fb42583b97..2fd54d3af9 100644 --- a/src/views/User/GameHistoryTable.tsx +++ b/src/views/User/GameHistoryTable.tsx @@ -69,6 +69,7 @@ interface GroomedGame { result: JSX.Element; flags?: { [flag_key: string]: number | string | boolean }; rengo_vs_text?: `${number} vs. ${number}`; + handicap: number; } export function GameHistoryTable(props: GameHistoryProps) { @@ -190,6 +191,8 @@ export function GameHistoryTable(props: GameHistoryProps) { item.name = r.name; + item.handicap = r.handicap; + if (item.name && item.name.trim() === "") { item.name = item.href; } @@ -393,6 +396,12 @@ export function GameHistoryTable(props: GameHistoryProps) { "board_size" + (X && X.annulled ? " annulled" : ""), render: (X) => `${X.width}x${X.height}`, }, + { + header: _("Hd"), + className: (X) => + "handicap" + (X && X.annulled ? " annulled" : ""), + render: (X) => X.handicap, + }, { header: _("Name"), className: (X) => diff --git a/src/views/User/User.styl b/src/views/User/User.styl index d7a5e4d4fc..08bc29aa4d 100644 --- a/src/views/User/User.styl +++ b/src/views/User/User.styl @@ -492,13 +492,20 @@ themed color strong-loss } + .board_size { + padding-right: 0.5em; + } + + .handicap { + padding-right: 0.5em; + } + .game_name { a { color: unset; } max-width: 15rem; overflow: hidden; - padding-left: 0.5em; text-overflow: ellipsis; } @@ -526,6 +533,10 @@ .annulled { themed opacity annul-opacity; } + + th { + padding-right: 0.5em; + } }