-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2024-setup' into 2024-endgame-section
- Loading branch information
Showing
25 changed files
with
2,269 additions
and
2,081 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
69 changes: 69 additions & 0 deletions
69
scoutingapp/src/components/inputs/ConeCubeIncrementInput.tsx
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React from "react" | ||
import { useState } from "react"; | ||
import { ComponentSetup } from "../interface"; | ||
|
||
function ConeCubeIncrementInput(props: ComponentSetup) { | ||
|
||
const [coneCounter, setConeCounter] = useState(0) | ||
const [cubeCounter, setCubeCounter] = useState(0) | ||
|
||
const color = props?.options?.[0] | ||
|
||
const updateStateText = (values: any) => { | ||
var state = props.getValue | ||
|
||
|
||
state[props.id] = values | ||
props.setValue(state) | ||
} | ||
|
||
return ( | ||
<div className="mx-3 my-3"> | ||
<label className="block text-[#344054] text-sm mb-2"> | ||
{ props.text } | ||
</label> | ||
<div className="flex justify-between"> | ||
<div className="w-[45%] h-16 border border-color-[#D0D5DD] border-[1.5px] rounded-xl"> | ||
<button | ||
type="button" | ||
className="w-1/3 text-[#cc2936] h-full text-5xl rounded-l-xl float-left bg-[#FDE7E7]" | ||
onClick={function () {if (coneCounter > 0) {setConeCounter(coneCounter-1); updateStateText([coneCounter-1, cubeCounter])}}} | ||
> | ||
- | ||
</button> | ||
<div className={`flex w-1/3 h-full text-2xl float-left items-center ${color == "red" ? "bg-red-400" : color == "yellow" ? "bg-amber-300" : color == "green" ? "bg-green-400" : "bg-white"}`}> | ||
<p className={"text-center text-white font-semibold flex items-center pt-1 justify-center text-md h-[80%] w-full bg-center bg-[url('../public/coneSprite.svg')] bg-contain bg-no-repeat"}>{coneCounter}</p> | ||
</div> | ||
<button | ||
type="button" | ||
className="text-5xl text-[#18611B] w-1/3 h-full rounded-r-xl float-right bg-[#E2F8E3]" | ||
onClick={function () {setConeCounter(coneCounter+1); updateStateText([coneCounter+1, cubeCounter])}} | ||
> | ||
+ | ||
</button> | ||
</div> | ||
<div className="w-[45%] h-16 border border-color-[#D0D5DD] border-[1.5px] rounded-xl"> | ||
<button | ||
type="button" | ||
className="w-1/3 text-[#cc2936] h-full text-5xl rounded-l-xl float-left bg-[#FDE7E7]" | ||
onClick={function () {if (cubeCounter > 0) {setCubeCounter(cubeCounter-1); updateStateText([coneCounter, cubeCounter-1])}}} | ||
> | ||
- | ||
</button> | ||
<div className={`flex w-1/3 h-full text-2xl float-left items-center ${color == "red" ? "bg-red-400" : color == "yellow" ? "bg-amber-300" : color == "green" ? "bg-green-400" : "bg-white"}`}> | ||
<p className={"text-center text-white font-semibold flex items-center pt-1 justify-center text-md h-[80%] w-full bg-center bg-[url('../public/cubeSprite.svg')] bg-contain bg-no-repeat"}>{cubeCounter}</p> | ||
</div> | ||
<button | ||
type="button" | ||
className="text-5xl text-[#18611B] w-1/3 h-full rounded-r-xl float-right bg-[#E2F8E3]" | ||
onClick={function () {setCubeCounter(cubeCounter+1); updateStateText([coneCounter, cubeCounter+1])}} | ||
> | ||
+ | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default ConeCubeIncrementInput |
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
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from "react" | ||
import { Link } from "react-router-dom"; | ||
import QRCode from 'react-qr-code' | ||
|
||
export function StoragePage() { | ||
return ( | ||
<div className="mx-4 pt-8 pb-10 max-w-[40rem] md:mx-auto"> | ||
<Link to="/"> | ||
<div className="w-full h-6 mx-4 text-2xl font-bold"> | ||
<svg xmlns="http://www.w3.org/2000/svg" height="40" width="40" viewBox="0 0 75 75"> | ||
<path d="M20 44 0 24 20 4l2.8 2.85L5.65 24 22.8 41.15Z"/> | ||
</svg> | ||
</div> | ||
</Link> | ||
<div className="px-4"> | ||
<div className="h-10 w-full mb-8 mt-4"> | ||
<h1 className="text-3xl font-bold mb-8 inline float-left">Saved Codes</h1> | ||
</div> | ||
</div> | ||
<div className="mt-4 px-4"> | ||
{ Object.keys(JSON.parse(localStorage.getItem("codes") as string)).map ((option: any) => ( | ||
<div className="border-b-2 border-gray-700 pb-4 pt-4"> | ||
<h1 className="text-2xl font-bold mb-4">{option}</h1> | ||
<QRCode | ||
size={256} | ||
style={{ height: "auto", maxWidth: "200px", width: "200px"}} | ||
value={JSON.parse(localStorage.getItem("codes") as string)[option]} | ||
viewBox={`0 0 256 256`} | ||
className="h-[200px] w-[200px] mx-auto mb-4" | ||
/> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.