generated from MetaMask/metamask-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
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 base component to design system react #390
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
packages/design-system-react/src/components/avatar-base/AvatarBase.tsx
Outdated
Show resolved
Hide resolved
20e04cc
to
e0b0f50
Compare
5bf0f5d
to
88d27fe
Compare
7 tasks
brianacnguyen
requested changes
Jan 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not merge these until design is ready
52d19f3
to
aa4022a
Compare
aa4022a
to
1119f0e
Compare
georgewrmarshall
commented
Feb 3, 2025
Comment on lines
+45
to
+53
<Text | ||
variant={AVATAR_BASE_SIZE_TO_TEXT_VARIANT_MAP[size]} | ||
fontWeight={FontWeight.Bold} | ||
asChild | ||
{...fallbackTextProps} | ||
> | ||
{/* asChild prop renders Text component as a span, it does not create an additional element */} | ||
<span>{fallbackText}</span> | ||
</Text> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are still waiting on design for full confirmation of fallback ticket created here: #411
This was referenced Feb 3, 2025
brianacnguyen
approved these changes
Feb 4, 2025
brianacnguyen
pushed a commit
that referenced
this pull request
Feb 5, 2025
Has a dependency on `AvatarBase` #390 ## **Description** This PR adds the new AvatarToken component to design system react Key features: - Displays token logos with consistent sizing and styling - Provides fallback text display when images are unavailable - Supports multiple size variants - Built on top of the AvatarBase component - Fully tested and documented ## **Related issues** Fixes: #364 ## **Manual testing steps** 1. Run Storybook (`yarn storybook`) 2. Navigate to React Components/AvatarToken 3. Test different component variations: - With and without images - Different sizes - Fallback text behavior - Custom className application 4. Verify responsive behavior and image handling 5. Check accessibility features (alt text, etc.) ## **Screenshots/Recordings** ### **Before** N/A (New component) ### **After** https://github.com/user-attachments/assets/81103ad2-7124-4971-92fb-fdb799ecac9f ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) - [x] I've completed the PR template to the best of my ability - [x] I've included comprehensive tests for the AvatarToken component - [x] I've documented the code using [JSDoc](https://jsdoc.app/) format - [x] I've applied the right labels on the PR - [x] I've ensured the component meets accessibility standards ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR in Storybook - [ ] I confirm that this PR addresses all acceptance criteria for the AvatarToken component - [ ] I've verified the component works correctly with and without images - [ ] I've checked that the component integrates properly with the existing design system
brianacnguyen
pushed a commit
that referenced
this pull request
Feb 5, 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** https://github.com/user-attachments/assets/fca9b112-d0f3-454d-baa0-b3ef8e953e1a ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) - [x] I've completed the PR template to the best of my ability - [x] I've included tests for the new AvatarFavicon component - [x] I've documented the code using [JSDoc](https://jsdoc.app/) format - [x] 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds the initial
AvatarBase
component to design system react.Key features:
Related issues
Fixes: #359
Manual testing steps
yarn storybook
)Screenshots/Recordings
Before
N/A - New component
After
after720.mov
Pre-merge author checklist
Pre-merge reviewer checklist