mirror of
https://github.com/reiyua/RayRaysWordBingo.git
synced 2026-11-17 06:22:06 +11:00
Almost there ( https://imgur.com/a/7ZnszW6 )
This commit is contained in:
parent
d5ccae751e
commit
14a5974057
1 changed files with 31 additions and 37 deletions
34
src/App.js
34
src/App.js
|
|
@ -30,7 +30,7 @@ import { useContext } from "react";
|
||||||
const handleCheckboxChange = (event) => {
|
const handleCheckboxChange = (event) => {
|
||||||
const { value, checked } = event.target;
|
const { value, checked } = event.target;
|
||||||
if (checked) {
|
if (checked) {
|
||||||
setSelectedOptions([selectedOptions, value]);
|
setSelectedOptions([...selectedOptions, value]);
|
||||||
} else {
|
} else {
|
||||||
setSelectedOptions(selectedOptions.filter((option) => option !== value));
|
setSelectedOptions(selectedOptions.filter((option) => option !== value));
|
||||||
}
|
}
|
||||||
|
|
@ -38,14 +38,14 @@ import { useContext } from "react";
|
||||||
|
|
||||||
const submitHandler = async (event) => {
|
const submitHandler = async (event) => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
const incident = {setSubmitter: submitter, setDate: date, setContext: context, setSelectedOptions: selectedOptions }
|
const incident = { submitter, date, context, selectedOptions }
|
||||||
const col = collection(db, `incidents/`)
|
const col = collection(db, `incidents/`)
|
||||||
const ref = await addDoc(col, incident)
|
const ref = await addDoc(col, incident)
|
||||||
console.log(ref)
|
console.log(ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form>
|
<Form onSubmit={submitHandler}>
|
||||||
<Form.Group>
|
<Form.Group>
|
||||||
<Form.Label style={{ fontSize: '40px' }}>Ray Ray's Word Bingo</Form.Label>
|
<Form.Label style={{ fontSize: '40px' }}>Ray Ray's Word Bingo</Form.Label>
|
||||||
<Col sm={2}></Col>
|
<Col sm={2}></Col>
|
||||||
|
|
@ -54,18 +54,26 @@ import { useContext } from "react";
|
||||||
<Form.Control
|
<Form.Control
|
||||||
name="submitter"
|
name="submitter"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Name" />
|
placeholder="Name"
|
||||||
|
value={submitter}
|
||||||
|
onChange={(e) => setSubmitter(e.target.value)}
|
||||||
|
/>
|
||||||
<Form.Label style={{ fontSize: '30px' }}>Enter the date the shennanigans occurred (dd-mm-yyyy):</Form.Label>
|
<Form.Label style={{ fontSize: '30px' }}>Enter the date the shennanigans occurred (dd-mm-yyyy):</Form.Label>
|
||||||
<Form.Control
|
<Form.Control
|
||||||
name="date"
|
name="date"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Date"
|
placeholder="Date"
|
||||||
|
value={date}
|
||||||
|
onChange={(e) => setDate(e.target.value)}
|
||||||
/>
|
/>
|
||||||
<Form.Label style={{ fontSize: '30px' }}>Enter context for this tamper tantrum:</Form.Label>
|
<Form.Label style={{ fontSize: '30px' }}>Enter context for this tamper tantrum:</Form.Label>
|
||||||
<Form.Control
|
<Form.Control
|
||||||
type="text"
|
type="text"
|
||||||
name="context"
|
name="context"
|
||||||
placeholder="Enter context here" />
|
placeholder="Enter context here"
|
||||||
|
value={context}
|
||||||
|
onChange={(e) => setContext(e.target.value)}
|
||||||
|
/>
|
||||||
<Form.Label
|
<Form.Label
|
||||||
name="selectedoptions"
|
name="selectedoptions"
|
||||||
style={{ fontSize: '30px' }}>Select the words used by Ray during his little tamper tantrum:
|
style={{ fontSize: '30px' }}>Select the words used by Ray during his little tamper tantrum:
|
||||||
|
|
@ -98,24 +106,10 @@ import { useContext } from "react";
|
||||||
checked={selectedOptions.includes('fart')}
|
checked={selectedOptions.includes('fart')}
|
||||||
onChange={handleCheckboxChange}
|
onChange={handleCheckboxChange}
|
||||||
/>
|
/>
|
||||||
|
<Button type="submit">Submit</Button>
|
||||||
</Col>
|
</Col>
|
||||||
<Col sm={2}></Col>
|
|
||||||
</Form.Group>
|
|
||||||
|
|
||||||
<Button variant="primary" type="submit">
|
|
||||||
Submit
|
|
||||||
</Button>
|
|
||||||
<Form.Group>
|
|
||||||
<h3>Existing entries</h3>
|
|
||||||
<p>To be added</p>
|
|
||||||
</Form.Group>
|
|
||||||
<Form.Group>
|
|
||||||
<h3>I am sorry in advance for this Ash LMFAO🤣</h3>
|
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MyForm;
|
export default MyForm;
|
||||||
Loading…
Add table
Reference in a new issue