From 13d740fc80f086b54ddd5b8f3c116146cc6f90d6 Mon Sep 17 00:00:00 2001 From: William Correa Date: Tue, 9 Apr 2024 18:56:08 -0300 Subject: [PATCH] feature: improve ui --- src/App.tsx | 14 +++++++------- src/view/components/game/GamePlaySession.tsx | 6 +++--- .../game-play-session/GamePlaySessionQuestion.tsx | 10 ++++------ .../components/general/{Switch.tsx => Match.tsx} | 2 +- 4 files changed, 15 insertions(+), 17 deletions(-) rename src/view/components/general/{Switch.tsx => Match.tsx} (90%) diff --git a/src/App.tsx b/src/App.tsx index b3446f2..7ba10a3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -57,14 +57,14 @@ export default function App () { path="/auth/otp" element={} /> + + } + > } - > - } - /> - + path="/dashboard" + element={} + /> diff --git a/src/view/components/game/GamePlaySession.tsx b/src/view/components/game/GamePlaySession.tsx index c5ce71c..52e6fd4 100644 --- a/src/view/components/game/GamePlaySession.tsx +++ b/src/view/components/game/GamePlaySession.tsx @@ -7,7 +7,7 @@ import Game from '../../../app/Domain/Game/Game.ts' import { GamePlaySessionInstruction } from './game-play-session/GamePlaySessionInstruction.tsx' import { GamePlaySessionQuestion, GameQuestionAnswerQuestion } from './game-play-session/GamePlaySessionQuestion.tsx' -import { Case, Switch } from '../general/Switch.tsx' +import { Case, Match } from '../general/Match.tsx' import { Loading } from '../general/Loading.tsx' import { AlertWarning } from '../general/Alert.tsx' @@ -79,7 +79,7 @@ export function GamePlaySession ({ game, onStart, onFinish }: GamePlaySessionPro }, [status, game, questions]) return ( - + @@ -120,6 +120,6 @@ export function GamePlaySession ({ game, onStart, onFinish }: GamePlaySessionPro - + ) } diff --git a/src/view/components/game/game-play-session/GamePlaySessionQuestion.tsx b/src/view/components/game/game-play-session/GamePlaySessionQuestion.tsx index 90a6571..580e15a 100644 --- a/src/view/components/game/game-play-session/GamePlaySessionQuestion.tsx +++ b/src/view/components/game/game-play-session/GamePlaySessionQuestion.tsx @@ -4,7 +4,7 @@ import Answer from '../../../../app/Domain/Game/Answer.ts' import { shuffle } from '../../../../app/Domain/Util.ts' import AnswerStatus from '../../../../app/Domain/Game/AnswerStatus.ts' -import { Case, Switch } from '../../general/Switch.tsx' +import { Case, Match } from '../../general/Match.tsx' import { GamePlaySessionQuestionCorrect, @@ -77,10 +77,8 @@ export function GamePlaySessionQuestion (props: GameQuestionProps) { return ( <> - - + + - + ) } diff --git a/src/view/components/general/Switch.tsx b/src/view/components/general/Match.tsx similarity index 90% rename from src/view/components/general/Switch.tsx rename to src/view/components/general/Match.tsx index baae867..55ad0a6 100644 --- a/src/view/components/general/Switch.tsx +++ b/src/view/components/general/Match.tsx @@ -15,7 +15,7 @@ export type SwitchProps = { children: ReactNode[] } -export function Switch (props: SwitchProps) { +export function Match (props: SwitchProps) { const { condition, children } = props return children.find((child: any) => child.props.value === condition) }