From 93a3c47bcbab2ed38883e8922a59d2273c1f39ec Mon Sep 17 00:00:00 2001 From: Mikayla Dobson <93477693+innocuous-symmetry@users.noreply.github.com> Date: Tue, 29 Mar 2022 13:21:55 -0500 Subject: [PATCH] formatting for localmulti form --- .../GameConfigForms/CpuMultiForm.js | 7 ++ .../GameConfigForms/LocalMultiForm.js | 76 +++++++++++++++++++ client/src/components/Welcome.js | 47 +++++++++++- 3 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 client/src/components/GameConfigForms/CpuMultiForm.js create mode 100644 client/src/components/GameConfigForms/LocalMultiForm.js diff --git a/client/src/components/GameConfigForms/CpuMultiForm.js b/client/src/components/GameConfigForms/CpuMultiForm.js new file mode 100644 index 0000000..03892ef --- /dev/null +++ b/client/src/components/GameConfigForms/CpuMultiForm.js @@ -0,0 +1,7 @@ +export default function CpuMultiForm() { + return ( +
+ ) +} \ No newline at end of file diff --git a/client/src/components/GameConfigForms/LocalMultiForm.js b/client/src/components/GameConfigForms/LocalMultiForm.js new file mode 100644 index 0000000..90c2594 --- /dev/null +++ b/client/src/components/GameConfigForms/LocalMultiForm.js @@ -0,0 +1,76 @@ +import { useState, useEffect } from "react"; + +const formVariants = [ + <> { /* Fragment, expects to be concatenated as necessary within a + + + > + ) +} \ No newline at end of file diff --git a/client/src/components/Welcome.js b/client/src/components/Welcome.js index 2b64060..5e5a9f0 100644 --- a/client/src/components/Welcome.js +++ b/client/src/components/Welcome.js @@ -1,4 +1,37 @@ +import { useState, useRef } from "react" +import LocalMultiForm from "./GameConfigForms/LocalMultiForm"; +import CpuMultiForm from "./GameConfigForms/CpuMultiForm"; + export default function Welcome() { + const [localMulti, setLocalMulti] = useState(false); + const [cpuMulti, setCpuMulti] = useState(false); + + const [value, setValue] = useState(''); + + const localMultiRadio = useRef(); + const cpuRadio = useRef(); + + const handleChange = (e) => { + setValue(e.target.id); + + if (e.target.id === 'local-multi') { + setLocalMulti(true); + setCpuMulti(false); + } else { + setLocalMulti(false); + setCpuMulti(true); + } + } + + const handleClear = () => { + localMultiRadio.current.checked = false; + cpuRadio.current.checked = false; + + setLocalMulti(false); + setCpuMulti(false); + setValue(''); + } + return ( <>