Skip to content

Commit

Permalink
typo fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaMannella committed Apr 24, 2021
1 parent cf108b8 commit f93c92b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ExamComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function ExamForm(props) {
const [score, setScore] = useState(30);
const [date, setDate] = useState(dayjs());

const handleSumbit = (event) => {
const handleSubmit = (event) => {
event.preventDefault();
const exam = { coursecode: course, score: score, date: date };
// VALIDATE !!!
Expand All @@ -102,7 +102,7 @@ function ExamForm(props) {
<Form.Label>Date</Form.Label>
<Form.Control type='date' value={date.format('YYYY-MM-DD')} onChange={ev => setDate(dayjs(ev.target.value))} />
</Form.Group>
<Button onClick={handleSumbit}>Save</Button> <Button variant='secondary' onClick={props.cancel}>Cancel</Button>
<Button onClick={handleSubmit}>Save</Button> <Button variant='secondary' onClick={props.cancel}>Cancel</Button>
</Form>
)
}
Expand All @@ -114,7 +114,7 @@ function ExamForm_native(props) {
const [score, setScore] = useState(30);
const [date, setDate] = useState(dayjs());

const handleSumbit = (event) => {
const handleSubmit = (event) => {
event.preventDefault();
const exam = { coursecode: course, score: score, date: date };
props.addExam(exam);
Expand All @@ -130,7 +130,7 @@ function ExamForm_native(props) {
<input type='number' min={18} max={31} value={score} onChange={ev => setScore(ev.target.value)} /><br />
<span style={{ display: 'inline-block', width: '5em' }}>Date:</span>
<input type='date' value={date.format('YYYY-MM-DD')} onChange={ev => setDate(dayjs(ev.target.value))} /><br />
<button onClick={handleSumbit}>Save</button> <button onClick={props.cancel}>Cancel</button>
<button onClick={handleSubmit}>Save</button> <button onClick={props.cancel}>Cancel</button>
</form >
)
}
Expand Down

0 comments on commit f93c92b

Please sign in to comment.