Features
- Add new items and append them to the bottom of the list with an input and button
- Remove items from the list
Optional Features Included
- Mark item as complete
- Edit item on list
- Delete item from list
Go to https://fans-todo-list.netlify.app/
Clone the repo into your local machine with the following:
Install dependencies using:
This app uses React v.17. In the project directory, run the following:
Open http://localhost:3000 to view it in the browser. This app is running in development mode.
The app contains two components: App
and Todo
The top level App
component contains the following user actions: Add Todo
and Filter Todo by Completion
. The default view for filter is View All
.
The user can add items to the list either by clicking the Add Task
button or by pressing the Enter
key. The item will not add if the input box is empty. Added tasks will display on the page.
The Filter
allows users to display their tasks by completion. The default view is View All
, and they can select also between Complete
and Incomplete
.
Contents of the task can be found in the Todo
component. It contains the following user actions:
Complete Task
: Clicking on the empty box to the left of the task will check off the box and put a strikethrough on the targeted task.Edit Task
: Clicking on theEdit
button causes a toggle on both the task and the button for the selected task. The task field will display a text input and theEdit
button will switch to aSave
button.- If the user makes no changes or has nothing in the input and clicks
Save
, the task will not be modified. - If the user makes a change, upon clicking
Save
, if the task was previously complete, it will reset to incomplete: TheComplete
box will become unmarked and the task will not have a strikethrough. If the task was previously incomplete, the display will not change.
- If the user makes no changes or has nothing in the input and clicks
Delete Task
: Clicking on theDelete
button will remove the targeted task from the list.
The list of tasks is displayed with alternating colors to help distinguish between the tasks.
The app is split into 3 sections: Header
, User Action
, and the List of Todos
.
The User Action
is added in a section
tag because other tags don't seem to fit. The closest is nav
, but the user is not navigating anywhere else.
List of Todos
contains the main content of the page, so it is assigned the main
tag.
div
tags are used to help with content placement.
The CSS is named using the BEM methodology. Styling is grouped by component, with the exception of the header.