Skip to content

[DSR] Added Blockies#465

Merged
brianacnguyen merged 7 commits intomainfrom
dsr/blockies
Mar 19, 2025
Merged

[DSR] Added Blockies#465
brianacnguyen merged 7 commits intomainfrom
dsr/blockies

Conversation

@brianacnguyen
Copy link
Copy Markdown
Contributor

Description

This PR adds the Blockies component to DSR

Related issues

Fixes: #404

Manual testing steps

  1. Run yarn storybook from root
  2. Go to React Components > Blockies

Screenshots/Recordings

Before

After

Screen.Recording.2025-03-05.at.10.41.42.AM.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 if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • 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.

@brianacnguyen brianacnguyen self-assigned this Mar 5, 2025
@brianacnguyen brianacnguyen requested a review from a team as a code owner March 5, 2025 18:58
@georgewrmarshall georgewrmarshall requested a review from Copilot March 6, 2025 22:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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) =>

@brianacnguyen brianacnguyen changed the title [DSRN] Added Blockies [DSR] Added Blockies Mar 11, 2025
@georgewrmarshall georgewrmarshall marked this pull request as draft March 12, 2025 15:33
@brianacnguyen brianacnguyen marked this pull request as ready for review March 18, 2025 15:28
brianacnguyen and others added 3 commits March 18, 2025 08:34
## **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
Copy link
Copy Markdown
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Excellent work 💯 merged a few small updates after we reviewed them. LGTM 🚀

@brianacnguyen brianacnguyen merged commit b4063d2 into main Mar 19, 2025
30 checks passed
@brianacnguyen brianacnguyen deleted the dsr/blockies branch March 19, 2025 15:25
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 AvatarAccountBlockies component in shared UI component library

3 participants