From 1fae954b09a49d93a1361788e859065bea43f0c0 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 5 Mar 2026 22:03:20 +0900 Subject: fix(frontend): hide code column in ranking table when code is not available --- frontend/app/components/Gaming/RankingTable.tsx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'frontend/app') diff --git a/frontend/app/components/Gaming/RankingTable.tsx b/frontend/app/components/Gaming/RankingTable.tsx index 4ba3987..60f4808 100644 --- a/frontend/app/components/Gaming/RankingTable.tsx +++ b/frontend/app/components/Gaming/RankingTable.tsx @@ -10,9 +10,18 @@ type Props = { export default function RankingTable({ problemLanguage }: Props) { const ranking = useAtomValue(rankingAtom); + const showCode = ranking.some((entry) => entry.code != null); return ( - + {ranking.map((entry, index) => ( {index + 1} @@ -24,11 +33,13 @@ export default function RankingTable({ problemLanguage }: Props) { {formatUnixTimestamp(entry.submitted_at)} - - {entry.code && ( - - )} - + {showCode && ( + + {entry.code && ( + + )} + + )} ))} -- cgit v1.3.1