Skip to content

Commit

Permalink
Feat: Import 'loading-icon.scss' into 'LikeButton.tsx'
Browse files Browse the repository at this point in the history
  • Loading branch information
ITurres committed Mar 5, 2024
1 parent 2df9c93 commit c93c071
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/UI/LikeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -68,6 +69,8 @@ const LikeButton: React.FC<LikeButtonProps> = ({ 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]);
Expand Down

0 comments on commit c93c071

Please sign in to comment.