Skip to content

Commit e94121f

Browse files
authored
Merge pull request #7 from rsnj5/feature/task-entry-behaviour-modification
fix task entry behaviour issue
2 parents a4ff296 + 138af23 commit e94121f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

client/src/components/TodoItem.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Badge, Box, Flex, Spinner, Text } from "@chakra-ui/react";
2-
import { FaCheckCircle } from "react-icons/fa";
2+
import { FaRegCircle,FaCheckCircle } from "react-icons/fa";
33
import { MdDelete } from "react-icons/md";
44
import { Todo } from "./TodoList";
55
import { useMutation, useQueryClient } from "@tanstack/react-query";
@@ -68,6 +68,7 @@ const TodoItem = ({ todo }: { todo: Todo }) => {
6868
>
6969
{todo.body}
7070
</Text>
71+
7172
{todo.completed && (
7273
<Badge ml='1' colorScheme='green'>
7374
Done
@@ -80,14 +81,18 @@ const TodoItem = ({ todo }: { todo: Todo }) => {
8081
)}
8182
</Flex>
8283
<Flex gap={2} alignItems={"center"}>
83-
<Box color={"green.500"} cursor={"pointer"} onClick={() => updateTodo()}>
84-
{!isUpdating && <FaCheckCircle size={20} />}
84+
<Box color={todo.completed? "green.500":"whiteAlpha.500"} cursor={"pointer"} onClick={() => updateTodo()}>
85+
{!isUpdating && (todo.completed)?<FaCheckCircle size={20} />:<FaRegCircle size={20} />
86+
87+
}
88+
8589
{isUpdating && <Spinner size={"sm"} />}
8690
</Box>
8791
<Box color={"red.500"} cursor={"pointer"} onClick={() => deleteTodo()}>
8892
{!isDeleting && <MdDelete size={25} />}
8993
{isDeleting && <Spinner size={"sm"} />}
9094
</Box>
95+
9196
</Flex>
9297
</Flex>
9398
);

0 commit comments

Comments
 (0)