Skip to content

Return with no avatar option and fix avatar popup layout issue #340

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

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

victorgois
Copy link
Collaborator

@victorgois victorgois commented Jul 30, 2025

Add "No Avatar" option to avatar selection popup

Summary

  • Added "No Avatar" option: The avatar selection popup now includes a "No Avatar" option as the first choice, using the Wikimedia Commons image: https://upload.wikimedia.org/wikipedia/commons/6/60/CapX_-_No_avatar.svg

  • Updated type definitions: Modified Avatar interface to support null ID for the virtual "no avatar" option

  • Fixed avatar removal: When selecting "No Avatar", the system now sends null to the backend instead of ID 0, which was causing validation errors

  • Fixed avatar selection popup height to adapt itself when screen gets streched

  • Added Avatar Selection Popup test suite

Technical Details

  • Modified AvatarSelectionPopup component to include a virtual avatar with id: null
  • Updated handleAvatarSelect function to accept number | null parameter
  • Updated type definitions in ProfileEditMainWrapper, ProfileEditMobileView, and ProfileEditDesktopView
  • The "No Avatar" option appears first in the grid, before all other avatars

Testing

  • Users can now select "No Avatar" to remove their current avatar
  • The selection properly saves to the backend without validation errors
  • The UI correctly displays the Wikimedia Commons image for the "No Avatar" option
  • Run yarn test or yarn test -- AvatarSelectionPopup.test.tsx to test each functionality of the component

@victorgois victorgois marked this pull request as draft July 30, 2025 17:06
@victorgois victorgois marked this pull request as ready for review July 30, 2025 17:22
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return with no avatar option, add the remain avatars and fix layout issue
1 participant