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 ( <>