From 1f4bd88e7599fe9b9af92d461741a92e1d2a69ec Mon Sep 17 00:00:00 2001 From: S-N-O-R-L-A-X Date: Sun, 31 Dec 2023 11:28:14 +0800 Subject: [PATCH] feat: make statistics horizontal align --- architecture.drawio | 25 ++++++++++++++----------- src/Components/PlayBoard/ShowTricks.tsx | 2 +- src/views/Analysis/Analysis.tsx | 13 +++++++------ src/views/Analysis/analysis.css | 8 ++++++++ 4 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 src/views/Analysis/analysis.css diff --git a/architecture.drawio b/architecture.drawio index 132be27..dad457d 100644 --- a/architecture.drawio +++ b/architecture.drawio @@ -1,6 +1,6 @@ - + @@ -20,10 +20,10 @@ - + - + @@ -43,13 +43,13 @@ - + - + @@ -62,9 +62,9 @@ - + - + @@ -97,16 +97,19 @@ - + - + - + - + + + + diff --git a/src/Components/PlayBoard/ShowTricks.tsx b/src/Components/PlayBoard/ShowTricks.tsx index a4c7ee3..304448c 100644 --- a/src/Components/PlayBoard/ShowTricks.tsx +++ b/src/Components/PlayBoard/ShowTricks.tsx @@ -26,7 +26,7 @@ export default function ShowTricks(props: ShowTricksProps) { } return ( - +
{CONTRACTCOLORS.map((v) => )} {tricks.map((trick, idx) => {trick.map((t, idx2) => )})} diff --git a/src/views/Analysis/Analysis.tsx b/src/views/Analysis/Analysis.tsx index 7608122..520b899 100644 --- a/src/views/Analysis/Analysis.tsx +++ b/src/views/Analysis/Analysis.tsx @@ -1,7 +1,8 @@ import { useContext, useEffect, useState } from "react"; import ShowTricks from "../../Components/PlayBoard/ShowTricks"; import { analyzeOffline } from "../../Utils/utils"; -import { CompleteBoard, ShowResultsContext } from "../Show/ShowResults"; +import { ShowResultsContext } from "../Show/ShowResults"; +import "./analysis.css" function MatrixAdd(a: number[][], b: (string | number)[][]) { for (let i = 0; i < a.length; ++i) { @@ -35,7 +36,7 @@ export default function Analysis() { } return Promise.resolve(); } - countTricks().then(()=>{ + countTricks().then(() => { if (all_boards.length > 0) { setTable(MatrixDivide(table, all_boards.length)); } @@ -43,10 +44,10 @@ export default function Analysis() { }, [all_boards.length]) return ( - <> - The average tricks: - - +
+ The average tricks: + +
) } diff --git a/src/views/Analysis/analysis.css b/src/views/Analysis/analysis.css new file mode 100644 index 0000000..0e90595 --- /dev/null +++ b/src/views/Analysis/analysis.css @@ -0,0 +1,8 @@ +.showStatistics { + max-width: fit-content; + margin: 0 auto; +} + +.showStatistics .showTricks { + margin: 0 auto; +} \ No newline at end of file
{v}
{PROGRAM_POSITIONS[idx]}{t}