Skip to content

Commit

Permalink
Merge pull request #7 from rsnj5/feature/task-entry-behaviour-modific…
Browse files Browse the repository at this point in the history
…ation

fix task entry behaviour issue
  • Loading branch information
vigneshs-dev authored Oct 23, 2024
2 parents a4ff296 + 138af23 commit e94121f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions client/src/components/TodoItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Badge, Box, Flex, Spinner, Text } from "@chakra-ui/react";
import { FaCheckCircle } from "react-icons/fa";
import { FaRegCircle,FaCheckCircle } from "react-icons/fa";
import { MdDelete } from "react-icons/md";
import { Todo } from "./TodoList";
import { useMutation, useQueryClient } from "@tanstack/react-query";
Expand Down Expand Up @@ -68,6 +68,7 @@ const TodoItem = ({ todo }: { todo: Todo }) => {
>
{todo.body}
</Text>

{todo.completed && (
<Badge ml='1' colorScheme='green'>
Done
Expand All @@ -80,14 +81,18 @@ const TodoItem = ({ todo }: { todo: Todo }) => {
)}
</Flex>
<Flex gap={2} alignItems={"center"}>
<Box color={"green.500"} cursor={"pointer"} onClick={() => updateTodo()}>
{!isUpdating && <FaCheckCircle size={20} />}
<Box color={todo.completed? "green.500":"whiteAlpha.500"} cursor={"pointer"} onClick={() => updateTodo()}>
{!isUpdating && (todo.completed)?<FaCheckCircle size={20} />:<FaRegCircle size={20} />

}

{isUpdating && <Spinner size={"sm"} />}
</Box>
<Box color={"red.500"} cursor={"pointer"} onClick={() => deleteTodo()}>
{!isDeleting && <MdDelete size={25} />}
{isDeleting && <Spinner size={"sm"} />}
</Box>

</Flex>
</Flex>
);
Expand Down

0 comments on commit e94121f

Please sign in to comment.