From 59c7a4cd2230595a71b13c6573bc379cd8943006 Mon Sep 17 00:00:00 2001 From: Long Le <tlenguye@emich.edu> Date: Tue, 18 Mar 2025 16:46:26 -0400 Subject: [PATCH] clean up --- src/App.tsx | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 9950b92..4228c5c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -162,44 +162,6 @@ function Home() { // })); // }; - // Function to set the reply liked status to true - const likeReply = (replyId: number) => { - setReplyLiked((prev) => ({ - ...prev, - [replyId]: true, // Set the liked status to true - })); - }; - - // Function to set the reply liked status to false - const unlikeReply = (replyId: number) => { - setReplyLiked((prev) => ({ - ...prev, - [replyId]: false, // Set the liked status to false - })); - }; - - // Function to decrement the like count for a specific reply - const decrementLikeCount = (replyId: number) => { - setReplyLikeCount((prev) => { - const currentLikeCount = prev[replyId] || 0; // Get the current like count for the replyId, default to 0 - return { - ...prev, // Spread the previous state - [replyId]: Math.max(0, currentLikeCount - 1), // Update the like count for this specific replyId, ensuring it doesn't go below 0 - }; - }); - }; - - // Function to increment the like count for a specific reply - const incrementLikeCount = (replyId: number) => { - setReplyLikeCount((prev) => { - const currentLikeCount = prev[replyId] || 0; // Get the current like count for the replyId, default to 0 - return { - ...prev, // Spread the previous state - [replyId]: currentLikeCount + 1, // Increment the like count for this specific replyId - }; - }); - }; - const navigate = useNavigate(); useEffect(() => { -- GitLab