|
1 | 1 | import styles from './TaskForm.module.css';
|
2 |
| -import PropTypes from 'prop-types'; |
| 2 | +import { PropTypes } from 'prop-types'; |
3 | 3 |
|
4 |
| -export function TaskForm() { |
| 4 | +function TaskForm(props) { |
5 | 5 | return (
|
6 |
| - <> |
7 |
| - <div className={styles.formWrapper}> |
8 |
| - <form> |
9 |
| - <h1 className={styles.headingStyle}>New Task</h1> |
10 |
| - <fieldset> |
11 |
| - {/* Task title */} |
12 |
| - <label htmlFor="taskTitle" className={styles.taskLabelStyle}> |
13 |
| - Title |
14 |
| - <input |
15 |
| - type="text" |
16 |
| - name="taskTitle" |
17 |
| - className={styles.taskInputStyle} |
18 |
| - required |
19 |
| - /> |
20 |
| - </label> |
| 6 | + <form className={styles.formWrapper}> |
| 7 | + <h1 className={styles.headingStyle}>New Task</h1> |
| 8 | + <fieldset className={styles.fieldsetStyle}> |
| 9 | + {/* Task title */} |
| 10 | + <label htmlFor="taskTitle" className={styles.taskLabelStyle}> |
| 11 | + Title |
| 12 | + <input |
| 13 | + type="text" |
| 14 | + name="taskTitle" |
| 15 | + className={styles.taskInputStyle} |
| 16 | + required |
| 17 | + /> |
| 18 | + </label> |
21 | 19 |
|
22 |
| - {/* Project name */} |
23 |
| - <label htmlFor="taskProject" className={styles.taskLabelStyle}> |
24 |
| - Project |
25 |
| - <input |
26 |
| - type="text" |
27 |
| - name="taskProject" |
28 |
| - className={styles.taskInputStyle} |
29 |
| - required |
30 |
| - /> |
31 |
| - </label> |
| 20 | + {/* Project name */} |
| 21 | + <label htmlFor="taskProject" className={styles.taskLabelStyle}> |
| 22 | + Project |
| 23 | + <input |
| 24 | + type="text" |
| 25 | + name="taskProject" |
| 26 | + className={styles.taskInputStyle} |
| 27 | + required |
| 28 | + /> |
| 29 | + </label> |
32 | 30 |
|
33 |
| - {/* Priority */} |
34 |
| - <label htmlFor="taskPriority" className={styles.taskLabelStyle}> |
35 |
| - Priority |
36 |
| - <select |
37 |
| - name="taskPriority" |
38 |
| - className={styles.taskInputStyle} |
39 |
| - required |
40 |
| - > |
41 |
| - <option value>(select one)</option> |
42 |
| - <option value="1">Low</option> |
43 |
| - <option value="2">Medium</option> |
44 |
| - <option value="3">High</option> |
45 |
| - </select> |
| 31 | + {/* |
| 32 | + <label htmlFor="taskPriority" className={styles.taskLabelStyle}> |
| 33 | + Priority |
| 34 | + <fieldset className={styles.radios}> |
| 35 | + <label htmlFor="low"> |
| 36 | + <input type="radio" name="low" id="lowPriority" /> |
| 37 | + {' Low'} |
| 38 | + </label> |
| 39 | + <label htmlFor="medium"> |
| 40 | + <input type="radio" name="medium" id="mediumPriority" /> |
| 41 | + {' Medium'} |
| 42 | + </label> |
| 43 | + <label htmlFor="high"> |
| 44 | + <input type="radio" name="high" id="highPriority" /> |
| 45 | + {' High'} |
46 | 46 | </label>
|
47 | 47 | </fieldset>
|
48 |
| - </form> |
49 |
| - </div> |
50 |
| - </> |
| 48 | + </label> */} |
| 49 | + </fieldset> |
| 50 | + <input |
| 51 | + type="button" |
| 52 | + value="Add task" |
| 53 | + className={styles.formButton} |
| 54 | + onClick={props.handleClick} |
| 55 | + /> |
| 56 | + </form> |
51 | 57 | );
|
52 | 58 | }
|
| 59 | + |
| 60 | +export { TaskForm }; |
| 61 | + |
| 62 | +TaskForm.propTypes = { |
| 63 | + handleClick: PropTypes.func.isRequired, |
| 64 | +}; |
0 commit comments