Skip to content

Commit 5568a9e

Browse files
committed
made working button
1 parent d39b44d commit 5568a9e

File tree

4 files changed

+102
-44
lines changed

4 files changed

+102
-44
lines changed

web/src/App.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ import { TaskList } from './components/domains/task/TaskList/TaskList';
22
import { TaskForm } from './components/domains/task/TaskForm/TaskForm';
33

44
function App() {
5+
function createTask() {
6+
console.log('it works');
7+
}
8+
59
return (
610
<>
711
<TaskList />
8-
<TaskForm />
12+
<TaskForm handleClick={createTask} />
913
</>
1014
);
1115
}
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,64 @@
11
import styles from './TaskForm.module.css';
2-
import PropTypes from 'prop-types';
2+
import { PropTypes } from 'prop-types';
33

4-
export function TaskForm() {
4+
function TaskForm(props) {
55
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>
2119

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

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'}
4646
</label>
4747
</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>
5157
);
5258
}
59+
60+
export { TaskForm };
61+
62+
TaskForm.propTypes = {
63+
handleClick: PropTypes.func.isRequired,
64+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.formWrapper {
2+
background-color: var(--light-grey);
3+
display: flex;
4+
flex-direction: column;
5+
justify-content: center;
6+
align-items: right;
7+
padding: 40px;
8+
gap: 10px;
9+
border-radius: 10px;
10+
margin: 50px;
11+
}
12+
13+
.fieldsetStyle {
14+
display: flex;
15+
flex-wrap: wrap;
16+
border: none;
17+
gap: 40px;
18+
}
19+
20+
.taskLabelStyle {
21+
flex-grow: 1;
22+
display: flex;
23+
flex-direction: column;
24+
}
25+
26+
.taskInputStyle {
27+
border-radius: 7px;
28+
border: 2px solid black;
29+
padding: 5px;
30+
margin-top: 7px;
31+
}
32+
33+
.formButton {
34+
text-align: center;
35+
border-radius: 15px;
36+
width: fit-content;
37+
padding: 5px;
38+
background-color: var(--light-blue);
39+
margin-top: 10px;
40+
padding: 10px;
41+
}

web/src/components/domains/task/TaskItem/TaskItem.module.css

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
.priorityStyle {
2222
text-align: center;
2323
border-radius: 15px;
24+
background-color: var(--light-blue);
2425
width: fit-content;
2526
padding: 5px;
2627
}

0 commit comments

Comments
 (0)