From 3fab819a719a79a27a551cbb7daec7eb05162838 Mon Sep 17 00:00:00 2001 From: JosiahFu Date: Sun, 17 Mar 2024 12:08:10 -0700 Subject: [PATCH] Fix TeamSummary & Score Calculator layout tweaks --- .../apps/picklist/components/TeamSummary.tsx | 8 -- .../apps/score_calculator/ScoreCalculator.tsx | 110 +++++++----------- client/tailwind.config.js | 3 + 3 files changed, 48 insertions(+), 73 deletions(-) diff --git a/client/src/apps/picklist/components/TeamSummary.tsx b/client/src/apps/picklist/components/TeamSummary.tsx index 1afcb5e4..d469d3d3 100644 --- a/client/src/apps/picklist/components/TeamSummary.tsx +++ b/client/src/apps/picklist/components/TeamSummary.tsx @@ -93,14 +93,6 @@ function TeamSummary({ )} -
-

Comments

- - {(teamData && teamData.Comments) ? Object.entries(teamData.Comments).sort(([_, a], [__, b]) => b - a).map(([comment, count]) => ( - count > 0 &&

{snakeToSpaced(comment)}: {count}

- )) :
} -
-

Comments

diff --git a/client/src/apps/score_calculator/ScoreCalculator.tsx b/client/src/apps/score_calculator/ScoreCalculator.tsx index 071f3fa6..da73f9c6 100644 --- a/client/src/apps/score_calculator/ScoreCalculator.tsx +++ b/client/src/apps/score_calculator/ScoreCalculator.tsx @@ -3,7 +3,6 @@ import React, { Dispatch, SetStateAction, useState } from 'react'; import LinkButton from '../../components/LinkButton'; import { MaterialSymbol } from 'react-material-symbols'; -import MultiButton from '../../components/MultiButton'; function Counter({ value, @@ -17,7 +16,7 @@ function Counter({ return ( <> @@ -31,18 +30,17 @@ function Counter({ } function ScoreCalculator() { - const [autoLeave, setAutoLeave] = useState(Number); - const [autoSpeaker, setAutoSpeaker] = useState(Number); - const [autoAmp, setAutoAmp] = useState(Number); - const [teleSpeaker, setTeleSpeaker] = useState(Number); - const [ampedTeleSpeaker, setAmpedTeleSpeaker] = useState(Number); - const [teleAmp, setTeleAmp] = useState(Number); - const [park, setPark] = useState(Number); - const [climb, setClimb] = useState(Number); - const [climbSpot, setClimbSpot] = useState(Number); - const [trap, setTrap] = useState(Number); - const [harmony, setHarmony] = useState(Number); - const [speakerOnly, setSpeakerOnly] = useState(Boolean); + const [autoLeave, setAutoLeave] = useState(0); + const [autoSpeaker, setAutoSpeaker] = useState(0); + const [autoAmp, setAutoAmp] = useState(0); + const [teleSpeaker, setTeleSpeaker] = useState(0); + const [ampedTeleSpeaker, setAmpedTeleSpeaker] = useState(0); + const [teleAmp, setTeleAmp] = useState(0); + const [park, setPark] = useState(0); + const [climb, setClimb] = useState(0); + const [climbSpot, setClimbSpot] = useState(0); + const [trap, setTrap] = useState(0); + const [harmony, setHarmony] = useState(0); const handleReset = () => { setAutoLeave(0); @@ -59,27 +57,14 @@ function ScoreCalculator() { }; return ( -
-
+
+

Score Calculator

-
- -
-
-
+
-
+
+

Auto

Auto Leave @@ -111,7 +97,8 @@ function ScoreCalculator() { Auto Amp
-
+
+

Teleop

Tele Speaker @@ -126,7 +113,8 @@ function ScoreCalculator() {
-
+
+

Endgame

Park @@ -146,19 +134,15 @@ function ScoreCalculator() {
- {speakerOnly || ( - <> -

- Leave:{' '} - - {autoLeave * 2} - -

- - )} +

+ Leave:{' '} + + {autoLeave * 2} + +

+ className={` text-black-100 text-md rounded-md border-green-800 bg-green-400/70 px-3 py-2 text-center`}> Speaker:{' '} {autoSpeaker * 5 + @@ -167,27 +151,23 @@ function ScoreCalculator() {

- {speakerOnly || ( - <> -

- Amp:{' '} - - {autoAmp * 2 + teleAmp * 1} - -

+

+ Amp:{' '} + + {autoAmp * 2 + teleAmp * 1} + +

-

- Stage:{' '} - - {park * 1 + - climb * 3 + - climbSpot * 4 + - trap * 5 + - harmony * 2} - -

- - )} +

+ Stage:{' '} + + {park * 1 + + climb * 3 + + climbSpot * 4 + + trap * 5 + + harmony * 2} + +

diff --git a/client/tailwind.config.js b/client/tailwind.config.js index d7a87b4d..2d8f7cec 100644 --- a/client/tailwind.config.js +++ b/client/tailwind.config.js @@ -23,6 +23,9 @@ export default { }, rotate: { '60': '60deg', + }, + spacing: { + '23/24': '95.833333%' } },