feat(DSYS-476): Migrate AvatarIcon to ADR-0003 and ADR-0004#1070
Closed
cursor[bot] wants to merge 1 commit intomainfrom
Closed
feat(DSYS-476): Migrate AvatarIcon to ADR-0003 and ADR-0004#1070cursor[bot] wants to merge 1 commit intomainfrom
cursor[bot] wants to merge 1 commit intomainfrom
Conversation
- Add AvatarIconSeverity const object (ADR-0003) to shared package, replacing enum in both platforms - Add AvatarIconSize alias (AvatarBaseSize) to shared package - Add AvatarIconPropsShared (ADR-0004) with iconName:string, size?, severity? - Export from @metamask/design-system-shared index - Update React AvatarIcon.types.ts to extend AvatarIconPropsShared with platform-specific iconName:IconName and iconProps - Update RN AvatarIcon.types.ts to extend AvatarIconPropsShared with platform-specific iconName:IconName, iconProps, twClassName - Update both platform index.ts to export AvatarIconSize/AvatarIconSeverity from shared - Update component .tsx, .constants.ts, .test.tsx, .stories.tsx in both platforms to import from shared - Remove AvatarIconSeverity enum from both platform types/index.ts, add re-export from shared for backwards compat Co-authored-by: George Marshall <[email protected]>
Contributor
📖 Storybook Preview |
Contributor
|
Duplicate |
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
Migrates the
AvatarIconcomponent to follow ADR-0003 (String Unions) and ADR-0004 (Centralized Types Architecture).Changes:
AvatarIconSeverityfrom a duplicated enum in both platform packages to a shared const object in@metamask/design-system-sharedAvatarIconSizealias (ofAvatarBaseSize) to the shared packageAvatarIconPropsShared(ADR-0004) withiconName: string,size?, andseverity?AvatarIconSeverityandAvatarIconSizefrom@metamask/design-system-sharedAvatarIconPropsSharedwith platform-specific props (iconProps,className,twClassName)iconNamefromstringto platform-specificIconNametypeAvatarIconSeverityenum from both platformtypes/index.ts, adds re-export from shared for backwards compatibility.tsx,.constants.ts,.test.tsx,.stories.tsx) in both platforms to import from@metamask/design-system-sharedNo breaking changes — all public exports remain available at the same import paths.
Related issues
Fixes: DSYS-476
Manual testing steps
yarn build— all packages should build successfullyyarn test— all tests should pass with 100% coverageAvatarIconcomponent renders correctly in Storybook with all severity/size combinationsScreenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist