Skip to content

Commit 358ac7c

Browse files
committed
Add trash can icon to delete
1 parent 5528c09 commit 358ac7c

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
1+
import { FaTrash } from "react-icons/fa";
2+
import { IconContext } from "react-icons";
3+
14
export default function TodoRowItem(props) {
25
return (
3-
<tr onClick={() => props.deleteTodo(props.rowNumber)}>
6+
<tr>
47
<th scope="row">{props.rowNumber}</th>
58
<td>{props.rowDescription}</td>
69
<td>{props.rowAssigned}</td>
10+
<td onClick={() => props.deleteTodo(props.rowNumber)}>
11+
<IconContext.Provider
12+
value={{
13+
style: { cursor: "pointer" },
14+
color: "red",
15+
className: "global-class-name",
16+
}}
17+
>
18+
<FaTrash />
19+
</IconContext.Provider>
20+
</td>
721
</tr>
822
);
923
}

react-todos/src/components/TodoTable.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default function TodoTable(props) {
88
<th scope="col">#</th>
99
<th scope="col">Description</th>
1010
<th scope="col">Assigned</th>
11+
<th className="bi-trash">Delete</th>
1112
</tr>
1213
</thead>
1314
<tbody>

0 commit comments

Comments
 (0)