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

feat: adding avatar favicon to design system react #414

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Feb 3, 2025

Has a dependency on AvatarBase #390

Description

This PR adds a new AvatarFavicon component to the design system.

Key features:

  • Displays dapp favicon/logo images with consistent sizing and styling
  • Provides text fallback when image is not available (uses first letter of name or custom fallback text)
  • Supports multiple sizes (xs, sm, md, lg, xl) with appropriate text scaling
  • Handles alt text and accessibility concerns
  • Allows customization of both image and fallback text properties

Related issues

Fixes: #368

Manual testing steps

  1. Run storybook (yarn storybook)
  2. Navigate to React Components/AvatarFavicon
  3. Test different component configurations:
    • With and without image source
    • Different sizes
    • Custom fallback text
    • Custom styling via className and props

Screenshots/Recordings

Before

N/A - New component

After

avatarfavicon720.mov

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs
  • I've completed the PR template to the best of my ability
  • I've included tests for the new AvatarFavicon component
  • I've documented the code using JSDoc format
  • I've applied the right labels on the PR

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run storybook, test AvatarFavicon component)
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots

Comment on lines 39 to 40
export { AvatarBase, AvatarBaseSize } from './avatar-base';
export type { AvatarBaseProps } from './avatar-base';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding missing AvatarBase export

@georgewrmarshall georgewrmarshall marked this pull request as ready for review February 4, 2025 17:18
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner February 4, 2025 17:18
brianacnguyen
brianacnguyen previously approved these changes Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[React]: Create AvatarFavicon component in shared UI component library
2 participants