From d493777de3c18814947e440c9ce199aebf05dcb1 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Fri, 29 Jul 2022 01:01:45 +0200 Subject: [PATCH] Fix: show final and small final in one column --- src/pages/SpeedFlowchartPage.tsx | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/pages/SpeedFlowchartPage.tsx b/src/pages/SpeedFlowchartPage.tsx index 4579397..8e16dc6 100644 --- a/src/pages/SpeedFlowchartPage.tsx +++ b/src/pages/SpeedFlowchartPage.tsx @@ -4,9 +4,14 @@ import { useParams } from 'react-router-dom'; import { convertResultsToSpeedFlowchartResult, SpeedFlowchartResult, + SpeedRoundPair, } from '../data/SpeedFlowchart'; import { Card, CardContent, Grid, Skeleton, Typography } from '@mui/material'; +interface SpeedRoundPairDummy extends SpeedRoundPair { + dummy: boolean; +} + /** * * @return {JSX.Element} speed flowchart page @@ -37,7 +42,17 @@ export default function SpeedFlowchartPage() { console.log('loading false'); const flowchartResult = convertResultsToSpeedFlowchartResult(r); - console.log(flowchartResult); + const l = flowchartResult.rounds.length; + const dummy: SpeedRoundPairDummy = { dummy: true }; + flowchartResult.rounds[l - 2].pairs = [ + dummy, + ...flowchartResult.rounds[l - 1].pairs, + ...flowchartResult.rounds[l - 2].pairs, + ]; + flowchartResult.rounds[l - 2].roundName = `${ + flowchartResult.rounds[l - 1].roundName + } / ${flowchartResult.rounds[l - 2].roundName}`; + flowchartResult.rounds.pop(); setFlowchartResult(flowchartResult); }); }, []); @@ -56,7 +71,7 @@ export default function SpeedFlowchartPage() { xs={12} md={12 / flowchartResult.rounds.length} > - + {round.roundName} @@ -70,7 +85,11 @@ export default function SpeedFlowchartPage() { > {round.pairs.map((pair, pairKey) => ( - +