-
Notifications
You must be signed in to change notification settings - Fork 55
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
Johanna's checklist #45
base: main
Are you sure you want to change the base?
Conversation
…components and store component to store folder. Add the CSS styling to index.css, to be as the design I found. Add the form and classNames for the styling to the App component. Install Zustand.
…tall styled-components. Mount the Checklist to App component.
…Header and add Zustand
…ent. Add the new components to Checklist compinent.
…ort react to checklist and header components.
…oject. Use Zustand to import task list, title and description.
… all tasks are done
… size on Requirements and when tasks are done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job with your project Johanna! Your Zustand store is well-defined and structured ⭐ Keep up the good work
* To add: Mark all and task counter. | ||
*/ | ||
|
||
import React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to import React
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started with not importing it, but got a lot of errors, all saying something about react. So, my two cents of a workaround, to quickly fix this before my demo, was to add that import line because somehow it makes the app work.
I will look into this as soon as I can.
{/* Input field and Add Task button */} | ||
<InputField | ||
value={newTask} | ||
onChange={(event) => setNewTask(event.target.value)} | ||
placeholder="Write a task..." | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget labels for inputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out! I couldn't find a good way to implement it without displaying the label text, so I left it as it is for now. I’ll try to figure out a way :)
set((state) => ({ //Updates the state by creating a new tasks array | ||
tasks: [ | ||
...state.tasks, //Keeps all existing tasks in the array. | ||
{ text, id: crypto.randomUUID(), completed: false }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea to make use of the built-in crypto 👍
…my useful resources.
Netlify link
View it live