Merged
Conversation
Contributor
There was a problem hiding this comment.
PR Overview
This PR introduces a new Blockies component to generate unique identicons based on an address, along with associated tests, types, and Storybook stories.
- Added Blockies component in its own file with dynamic import of the 'blo' module.
- Created tests to ensure proper rendering of the component with various props.
- Provided Storybook stories and type definitions to integrate the component into the design system.
Reviewed Changes
| File | Description |
|---|---|
| packages/design-system-react/src/components/blockies/Blockies.test.tsx | Added tests to validate the Blockies component functionality. |
| packages/design-system-react/src/components/blockies/Blockies.tsx | Implemented the Blockies component with dynamic module import. |
| packages/design-system-react/src/components/blockies/Blockies.types.ts | Defined the type for Blockies props. |
| packages/design-system-react/src/components/blockies/index.ts | Exported the Blockies component and its types. |
| packages/design-system-react/src/components/blockies/Blockies.stories.tsx | Provided Storybook stories for the Blockies component. |
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
packages/design-system-react/src/components/blockies/Blockies.tsx:13
- Consider adding error handling to the dynamic import (e.g., using a catch block) so the component can gracefully handle failure cases rather than silently returning null.
useEffect(() => { import('blo').then((module) =>
## **Description** This PR makes some small updates to the DSR Blockies component by better aligning it with other React components in our design system and enhancing accessibility. The changes include: 1. Added default alt text for improved accessibility 2. Updated documentation to include an accessibility section 3. Added test coverage for alt text behavior These changes make the Blockies component more consistent with our other components and improve the experience for users relying on screen readers. ## **Related issues** Fixes: N/A ## **Manual testing steps** 1. Go to the Blockies component in Storybook 2. Verify that the default alt text appears when inspecting the component 3. Test with a screen reader to confirm the alt text is being read 4. Override the alt text with a custom value and verify it works as expected ## **Screenshots/Recordings** ### Before https://github.com/user-attachments/assets/e60543df-c868-4ac4-8fbc-986215b0b29e ### After https://github.com/user-attachments/assets/9e726781-8da0-4807-a06e-4087d9d7638f ## **Pre-merge author checklist** - [x] I've followed MetaMask Contributor Docs - [x] I've completed the PR template to the best of my ability - [x] I've included tests (added test for alt text behavior) - [x] I've documented my code using JSDoc format (updated types and documentation) - [x] I've applied the right labels on the PR ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR - [ ] I confirm that this PR addresses all acceptance criteria
georgewrmarshall
approved these changes
Mar 18, 2025
Contributor
georgewrmarshall
left a comment
There was a problem hiding this comment.
Excellent work 💯 merged a few small updates after we reviewed them. LGTM 🚀
This file contains hidden or 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
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
Blockiescomponent to DSRRelated issues
Fixes: #404
Manual testing steps
yarn storybookfrom rootScreenshots/Recordings
Before
After
Screen.Recording.2025-03-05.at.10.41.42.AM.mov
Pre-merge author checklist
Pre-merge reviewer checklist