Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task tracker | Ebtesam Ahmed #7

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Ebtesammm
Copy link

No description provided.

Copy link

@natBizitza natBizitza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, @Ebtesammm! 🥳

I have included some comments for the frontend section. Let me know if you want to review any together!

<Route
path="/"
element={
<NewTaskPage

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the guidelines outlined in README.md, you need to incorporate a form with two inputs (task name and description) in the App.jsx file, located below the TaskList. Both the form and TaskList should be part of the same page and share the same parent component.

If you need further clarification on this, please let me know.🙂

};

return (
<form className={styles.newTask}>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slick job on the styles here!👏🏼

const [taskNameState, setNewTask] = useState('');
const [taskDescriptionState, setNewTaskDescription] = useState('');

const storeNewTask = () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improvement: You could consider adding an alert() method here to let the user know that the task was successfully created.

import { useState } from 'react';

function NewTask({ tasksItems, setTasksItems }) {
const [taskNameState, setNewTask] = useState('');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improvement: per React community best practices, I recommend using the following naming convention for useState value and setter function:

const [name, setName]= useState();

For example:
const [newTask, setNewTask] = useState('');

It helps readability, makes your code clear and concise.

value={taskNameState}
onChange={(event) => setNewTask(event.target.value)}
name="username"
required

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To meet accessibility (a11y) standards, provide visual indicators for required inputs, e.g. asterisks.

const [taskDescriptionState, setNewTaskDescription] = useState('');

const storeNewTask = () => {
const newTask = {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's possible to submit the form with empty inputs and create empty tasks.
Maybe we can use a simple condition to check if the inputs are empty and ask the user to fill those in?

Let me know what you think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants