Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #9 🎫: LikeButton (UI component) loading state #13

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

ITurres
Copy link
Owner

@ITurres ITurres commented Mar 5, 2024

arthur iturres logo

Pull Request Summary for Issue #9 Completion


Overview:

Currently, there is no indicator that every project likes count is fetched from the server. This can be confusing to the user, as they may not know if the likes are being fetched or not. To fix this, a loading spinner will be added to the project's like button, replacing the Like icon until the request is successful or the error message is displayed. This will provide the user with a visual indicator that the likes are being fetched.

Changes Made:

Added:

  • /src/styles/animations/loading-icon.scss

  • Added a new file to hold the keyframes for the loading icon (spinner) animation.


Modified:

  • /src/components/UI/LikeButton.tsx

  • Imported the VscLoading icon from react-icons/vsc to use as the loading spinner.

  • Imported the loading-icon.scss stylesheets to use the keyframes for the loading spinner.

  • The spinner operates as follows:

    The loading spinner will be shown in two situations, at first render, i.e
    when the likes are been fetched, and when the user likes a project, i.e if
    The user likes it, it will render the spinner until the request is finished and shows the updated number of likes or an error message if the POST request fails.


Deleted:

  • n/a.

Impact:

This change will have a positive impact on the user experience, as it will provide a visual indicator that the likes are being fetched. This will help to reduce confusion and provide a better user experience.

Testing:

  • n/a.

Related Issues:

Dependencies:

  • n/a.

Additional Notes:


ITurres added 3 commits March 4, 2024 23:03
Now the Like button will have its loading state and spinner.
This loading spinner will be shown in two situations, at first render, i.e
when the likes are being fetch, and when the user likes a project, i.e if
the user likes it, it will render the spinner until the request its finish and
showing the updated number of likes or an error message if the request fails.

This will certaintly enhance the user experience.
@ITurres ITurres added enhancement New feature or request UI/UX labels Mar 5, 2024
@ITurres ITurres self-assigned this Mar 5, 2024
@ITurres ITurres marked this pull request as ready for review March 7, 2024 03:02
@ITurres
Copy link
Owner Author

ITurres commented Mar 7, 2024

✅ Good for merge.

@ITurres ITurres merged commit df361b4 into development Mar 7, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request UI/UX
Development

Successfully merging this pull request may close these issues.

[2pt] Loading state for LikeButton UI component
1 participant