Implement a simple TODO app working as described below.
If you are not sure about how a feature should work just open the real TodoApp and look how it works there
- Use
TodosContext
to store and update the todos. - Implement
TodoApp
component with an input field to create new todos on submit (Enter). Each item should have:id
- unique identifier (+new Date()
is good enough)title
- the text of a todocompleted
- current status (false
by default)
- Show the number of not completed todos in
TodoApp
; - Implement
TodoList
component to display a list of todos;<TodoList items={todos} />
- Implement
TodoItem
component with ability to toggle thecompleted
status using a checkbox.- move a
li
tag inside theTodoItem
; - add class
completed
if todo is completed;
- move a
- Add the ability to toggle the completed status of all the todos with the
toggleAll
checkbox.toggleAll
checkbox is active only if all the todos are completed;- if you click the checkbox all the items should be marked as
completed
/not completed
depending ontoggleAll
checked;
- Create
TodosFilter
component to switch betweenAll
/Active
/Completed
todos (add it to theApp
)- add the
Status
enum with the required values; - href should be
#/
,#/active
or#/completed
)
- add the
- Add ability to remove a todo using the
destroy
button (X
). - Add ability to clear completed todos - remove all completed items from the list. The button should contain text
Clear completed
in it.- It should be visible if there is at least 1 completed item in the list.
- Hide everything except the input to add new todo if there are no todos. But not if todos are just filtered out.
- Make inline editing for the TODO item
- double click on the TODO title makes it editable (just add a class
editing
to ali
) - DON'T add
htmlFor
to the label!!! Enter
saves changesEcs
cancels editing (useonKeyup
andevent.key === 'Escape'
)- Todo title can't be empty! If a user presses
Enter
when the title is empty, this todo should be removed. - (*) save changes
onBlur
- double click on the TODO title makes it editable (just add a class
- Save state of the APP to the
localStorage
using the nametodos
for the key (Watch Custom Hooks lesson)- use
JSON.stringify
before saving andJSON.parse
on reading
- use
- Font: 'helvetica neue'
- Font sizes to use: 100px, 24px, 14px
- implement arrow by rotating '❯' symbol
- Use '✕' symbol to remove TODO item on hover
- checked
- unchecked
- Implement a solution following the React task guideline.
- Use the React TypeScript cheat sheet.
- Open one more terminal and run tests with
npm test
to ensure your solution is correct. - Replace
<your_account>
with your Github username in the DEMO LINK and add it to the PR description.