From 1a4392327d50ab416fc8491bfd82259dc5bd5e8f Mon Sep 17 00:00:00 2001 From: Kevin Thomas Date: Sat, 23 Nov 2024 14:20:45 -0800 Subject: [PATCH] style: improve UI elements for new analysis dropdowns (#4) --- src/api/analysis/analysis.ts | 10 ++++++ src/components/Analysis/AnalysisGameList.tsx | 32 +++++++++++++++----- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/api/analysis/analysis.ts b/src/api/analysis/analysis.ts index 61da8cf..4e89899 100644 --- a/src/api/analysis/analysis.ts +++ b/src/api/analysis/analysis.ts @@ -309,6 +309,16 @@ export const getAnalyzedUserGame = async ( const blackPlayer = data['black_player'] const whitePlayer = data['white_player'] + const maiaPattern = /maia_kdd_1\d00/ + + if (maiaPattern.test(blackPlayer.name)) { + blackPlayer.name = blackPlayer.name.replace('maia_kdd_', 'Maia ') + } + + if (maiaPattern.test(whitePlayer.name)) { + whitePlayer.name = whitePlayer.name.replace('maia_kdd_', 'Maia ') + } + const maiaEvaluations: { [model: string]: MoveMap[] } = {} const positionEvaluations: { [model: string]: PositionEvaluation[] } = {} const availableMoves: AvailableMoves[] = [] diff --git a/src/components/Analysis/AnalysisGameList.tsx b/src/components/Analysis/AnalysisGameList.tsx index 63e6d25..2a0cc26 100644 --- a/src/components/Analysis/AnalysisGameList.tsx +++ b/src/components/Analysis/AnalysisGameList.tsx @@ -101,25 +101,43 @@ const AnalysisGameList: React.FC = ({