-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
269 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,105 +1,105 @@ | ||
import React, { useContext } from "react" | ||
|
||
import { useSettings, Context } from "../state" | ||
|
||
import Dropdown from "./inputs/Dropdown" | ||
import Next from "./inputs/Next" | ||
import Numbers from "./inputs/Numbers" | ||
|
||
import TripleTeamSelector from "./inputs/TripleTeamSelector" | ||
import TextLine from "./inputs/TextLine" | ||
|
||
const ConfigureQualitative = () => { | ||
|
||
const [state] = useContext(Context) | ||
|
||
const compareTwoTeamNums = (team1, team2) => { | ||
// If one of the teams is left blank, then we shouldn't compare them and we just return true | ||
// This is because sometimes, a team is missing from the match and don't show up | ||
if (!team1 || !team2) return true | ||
|
||
// Then actually checking to make sure the two numbers are not equivalent | ||
if (team1 !== team2) return true | ||
|
||
return false | ||
} | ||
|
||
let [team1Num, team2Num, team3Num] = [ | ||
state.team1.number, | ||
state.team2.number, | ||
state.team3.number, | ||
] | ||
|
||
// Checks to make sure that at least one of the teams has been actually been filled out | ||
const teamFilledOut = team1Num && team2Num && team3Num | ||
|
||
// Comparing all the teams | ||
const teamNumsUnequal = | ||
compareTwoTeamNums(team1Num, team2Num) && | ||
compareTwoTeamNums(team1Num, team3Num) && | ||
compareTwoTeamNums(team2Num, team3Num) | ||
|
||
// Checks if we're ready to move on | ||
const ready = state.matchNum && teamFilledOut && teamNumsUnequal && state.scoutName | ||
|
||
// Creating the disabled message | ||
const disabledMessage = (() => { | ||
if (!teamFilledOut && !state.matchNum) | ||
return "Provide all 3 team numbers and a match number" | ||
|
||
if (!teamFilledOut) return "Provide all 3 team numbers" | ||
|
||
if (!teamNumsUnequal) return "You cannot have multiple of the same team" | ||
|
||
if (state.matchNum == undefined) return "Provide a match number" | ||
|
||
if(!state.scoutName) return "Input your name" | ||
return "" | ||
})() | ||
|
||
return ( | ||
<> | ||
<TripleTeamSelector | ||
label="Alliance Teams" | ||
prop="number" | ||
idealLength={4} | ||
width="halfWide" | ||
height = "twoHigh" | ||
/> | ||
<Numbers | ||
label="Match #" | ||
prop="matchNum" | ||
idealLength={2} | ||
width="halfWide" | ||
></Numbers> | ||
<Dropdown | ||
width = "halfWide" | ||
prop="matchType" | ||
options={[ | ||
{ label: "Practice", value: "practice" }, | ||
{ label: "Qualification", value: "qm" }, | ||
{ label: "Semifinals", value: "sf" }, | ||
{ label: "Finals", value: "f" }, | ||
]} | ||
></Dropdown> | ||
{/* {!isIOS && <SetPanel width = "halfWide" label="Scanner" panelName="Scanner"></SetPanel>} */} | ||
|
||
<TextLine | ||
width="halfWide" | ||
label="Scouter Name:" | ||
explanation="Scouter Name: " | ||
capitalize={false} | ||
prop="scoutName" | ||
/> | ||
|
||
<Next | ||
width="halfWide" | ||
qualitative | ||
isDisabled={false && !ready} | ||
disabledText={disabledMessage} | ||
></Next> | ||
</> | ||
) | ||
} | ||
|
||
export default ConfigureQualitative | ||
import React, { useContext } from "react" | ||
|
||
import { useSettings, Context } from "../state" | ||
|
||
import Dropdown from "./inputs/Dropdown" | ||
import Next from "./inputs/Next" | ||
import Numbers from "./inputs/Numbers" | ||
|
||
import TripleTeamSelector from "./inputs/TripleTeamSelector" | ||
import TextLine from "./inputs/TextLine" | ||
|
||
const ConfigureQualitative = () => { | ||
|
||
const [state] = useContext(Context) | ||
|
||
const compareTwoTeamNums = (team1, team2) => { | ||
// If one of the teams is left blank, then we shouldn't compare them and we just return true | ||
// This is because sometimes, a team is missing from the match and don't show up | ||
if (!team1 || !team2) return true | ||
|
||
// Then actually checking to make sure the two numbers are not equivalent | ||
if (team1 !== team2) return true | ||
|
||
return false | ||
} | ||
|
||
let [team1Num, team2Num, team3Num] = [ | ||
state.team1.number, | ||
state.team2.number, | ||
state.team3.number, | ||
] | ||
|
||
// Checks to make sure that at least one of the teams has been actually been filled out | ||
const teamFilledOut = team1Num && team2Num && team3Num | ||
|
||
// Comparing all the teams | ||
const teamNumsUnequal = | ||
compareTwoTeamNums(team1Num, team2Num) && | ||
compareTwoTeamNums(team1Num, team3Num) && | ||
compareTwoTeamNums(team2Num, team3Num) | ||
|
||
// Checks if we're ready to move on | ||
const ready = state.matchNum && teamFilledOut && teamNumsUnequal && state.scoutName | ||
|
||
// Creating the disabled message | ||
const disabledMessage = (() => { | ||
if (!teamFilledOut && !state.matchNum) | ||
return "Provide all 3 team numbers and a match number" | ||
|
||
if (!teamFilledOut) return "Provide all 3 team numbers" | ||
|
||
if (!teamNumsUnequal) return "You cannot have multiple of the same team" | ||
|
||
if (state.matchNum == undefined) return "Provide a match number" | ||
|
||
if(!state.scoutName) return "Input your name" | ||
return "" | ||
})() | ||
|
||
return ( | ||
<> | ||
<TripleTeamSelector | ||
label="Alliance Teams" | ||
prop="number" | ||
idealLength={4} | ||
width="halfWide" | ||
height = "twoHigh" | ||
/> | ||
<Numbers | ||
label="Match #" | ||
prop="matchNum" | ||
idealLength={2} | ||
width="halfWide" | ||
></Numbers> | ||
<Dropdown | ||
width = "halfWide" | ||
prop="matchType" | ||
options={[ | ||
{ label: "Practice", value: "practice" }, | ||
{ label: "Qualification", value: "qm" }, | ||
{ label: "Semifinals", value: "sf" }, | ||
{ label: "Finals", value: "f" }, | ||
]} | ||
></Dropdown> | ||
{/* {!isIOS && <SetPanel width = "halfWide" label="Scanner" panelName="Scanner"></SetPanel>} */} | ||
|
||
<TextLine | ||
width="halfWide" | ||
label="Scouter Name:" | ||
explanation="Scouter Name: " | ||
capitalize={false} | ||
prop="scoutName" | ||
/> | ||
|
||
<Next | ||
width="halfWide" | ||
qualitative | ||
isDisabled={!ready} | ||
disabledText={disabledMessage} | ||
></Next> | ||
</> | ||
) | ||
} | ||
|
||
export default ConfigureQualitative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
import React from "react" | ||
|
||
import Checkbox from "./inputs/Checkbox" | ||
import Freetext from "./inputs/Freetext" | ||
import Next from "./inputs/Next" | ||
import SetPanel from "./inputs/SetPanel" | ||
import Dropdown from "./inputs/Dropdown" | ||
|
||
const Review = () => { | ||
return ( | ||
<> | ||
<Checkbox label="Played defense" prop="defense"></Checkbox> | ||
<Checkbox | ||
label="Robot had problems / malfunction" | ||
prop="robotProblems" | ||
></Checkbox> | ||
<Checkbox | ||
label="Scouting data accidents / problems" | ||
prop="scoutProblems" | ||
></Checkbox> | ||
{/* <div className="TextLine Divider">Pickup</div> */} | ||
|
||
<Freetext label="Comments?" prop="comments"></Freetext> | ||
<SetPanel label="Edit Data" panelName="EditScoutData" width = "wide"></SetPanel> | ||
<Next width = "wide"></Next> | ||
</> | ||
) | ||
} | ||
|
||
export default Review | ||
import React from "react" | ||
|
||
import Checkbox from "./inputs/Checkbox" | ||
import Freetext from "./inputs/Freetext" | ||
import Next from "./inputs/Next" | ||
import SetPanel from "./inputs/SetPanel" | ||
import Dropdown from "./inputs/Dropdown" | ||
|
||
const Review = () => { | ||
return ( | ||
<> | ||
<Checkbox label="Played defense" prop="defense"></Checkbox> | ||
<Checkbox | ||
label="Robot had problems / malfunction" | ||
prop="robotProblems" | ||
></Checkbox> | ||
<Checkbox | ||
label="Scouting data accidents / problems" | ||
prop="scoutProblems" | ||
></Checkbox> | ||
{/* <div className="TextLine Divider">Pickup</div> */} | ||
|
||
<Freetext label="Comments?" prop="comments"></Freetext> | ||
{/* In 2024, we didn't want to edit data, untested anyways */} | ||
{/* <SetPanel label="Edit Data" panelName="EditScoutData" width = "wide"></SetPanel> */} | ||
<Next width = "wide"></Next> | ||
</> | ||
) | ||
} | ||
|
||
export default Review |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
import React, { useContext } from "react" | ||
import { Context } from "../../state" | ||
|
||
import "./inputs.scss" | ||
import "./Tabs.scss" | ||
|
||
const Tabs = () => { | ||
const [state, dispatch] = useContext(Context) | ||
|
||
// In general, should be auto, teleop, endgame, but in 2023, endgame wasn't necessary | ||
const TabArray = ["auto", "teleop", "endgame"].map((label) => ( | ||
<button | ||
className="Tab" | ||
disabled={label === state.phase} | ||
onClick={() => { | ||
dispatch({ type: "set_phase", phase: label }) | ||
}} | ||
key={label} | ||
> | ||
<span>{label}</span> | ||
|
||
</button> | ||
)) | ||
|
||
return <div className="Tabs veryTall sixth evenFlex">{TabArray}</div> | ||
} | ||
|
||
export default Tabs | ||
import React, { useContext } from "react" | ||
import { Context } from "../../state" | ||
|
||
import "./inputs.scss" | ||
import "./Tabs.scss" | ||
|
||
const Tabs = () => { | ||
const [state, dispatch] = useContext(Context) | ||
|
||
const TabArray = ["auto", "teleop", "endgame"].map((label) => ( | ||
<button | ||
className="Tab" | ||
disabled={label === state.phase} | ||
onClick={() => { | ||
dispatch({ type: "set_phase", phase: label }) | ||
}} | ||
key={label} | ||
> | ||
<span>{label}</span> | ||
|
||
</button> | ||
)) | ||
|
||
return <div className="Tabs veryTall sixth evenFlex">{TabArray}</div> | ||
} | ||
|
||
export default Tabs |
Oops, something went wrong.