From c93c0717b7e01192e52f18f9a53888b8ef90f222 Mon Sep 17 00:00:00 2001 From: ITurres Date: Mon, 4 Mar 2024 23:23:35 -0300 Subject: [PATCH] Feat: Import 'loading-icon.scss' into 'LikeButton.tsx' --- src/components/UI/LikeButton.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/UI/LikeButton.tsx b/src/components/UI/LikeButton.tsx index 8eea8f3..701368a 100644 --- a/src/components/UI/LikeButton.tsx +++ b/src/components/UI/LikeButton.tsx @@ -9,6 +9,7 @@ import { SlLike } from 'react-icons/sl'; import { VscLoading } from 'react-icons/vsc'; import '../../styles/UI/LikeButton.scss'; +import '../../styles/animations/loading-icon.scss'; import involvement from '../../services/involvementAPI/involvementAPI.ts'; @@ -68,6 +69,8 @@ const LikeButton: React.FC = ({ itemId }) => { if (likedProject) { setLikeCount(likedProject.likes); + // ? at this point the loading spinner is still showing because of the initial API request. + // * so terminate the loading state, to show the like button with the like count. setLoadingToFalse(); } }, [itemId, setLoadingToFalse]);