Skip to content

Commit

Permalink
Summary
Browse files Browse the repository at this point in the history
  • Loading branch information
EuJinnLucaShow committed Nov 25, 2023
1 parent b3a1a34 commit 88cdc2d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 43 deletions.
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const App = () => {
title: inputValue,
completed: false,
};
setTasks([...tasks, newTask]);
setTasks([newTask, ...tasks]);
setInputValue('');
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/TodoItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import React from 'react';

const TodoItem = ({ task, toggleTaskStatus, deleteTask }) => {
return (
<div className="task">
<li className="task">
<span
style={{ textDecoration: task.completed ? 'line-through' : 'none' }}
onClick={() => toggleTaskStatus(task.id)}
>
{task.title}
</span>
<button onClick={() => deleteTask(task.id)}>Delete</button>
</div>
</li>
);
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/TodoList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import TodoItem from './TodoItem';

const TodoList = ({ tasks, toggleTaskStatus, deleteTask }) => {
return (
<div className="tasks">
<ul className="tasks">
{tasks.map(task => (
<TodoItem
key={task.id}
Expand All @@ -12,7 +12,7 @@ const TodoList = ({ tasks, toggleTaskStatus, deleteTask }) => {
deleteTask={deleteTask}
/>
))}
</div>
</ul>
);
};

Expand Down
7 changes: 7 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@ code {
flex-direction: column;
align-items: center;
}

.tasks {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 20px;
}

0 comments on commit 88cdc2d

Please sign in to comment.