Skip to content

fix: updating icon sizes inside of avatar icon component#25155

Closed
georgewrmarshall wants to merge 4 commits intodevelopfrom
fix/avatar-icon
Closed

fix: updating icon sizes inside of avatar icon component#25155
georgewrmarshall wants to merge 4 commits intodevelopfrom
fix/avatar-icon

Conversation

@georgewrmarshall
Copy link
Copy Markdown
Contributor

@georgewrmarshall georgewrmarshall commented Jun 7, 2024

Description

This pull request updates the icon sizes in the AvatarIcon component to the following specifications:

xs: 10px
sm: 15px
md: 20px
lg: 25px
xl: 30px

The reason for this change is align the component with Figma

Open in GitHub Codespaces

Related issues

Fixes: #25154

Manual testing steps

  1. Open the AvatarIcon storybook.
  2. Verify that the icon sizes are updated according to the new specifications (xs: 10px, sm: 15px, md: 20px, lg: 25px, xl: 30px).
  3. Ensure that the updated sizes do not break any existing layouts or designs.
  4. Check for visual consistency across different components where AvatarIcon is used.

Screenshots/Recordings

Before

before.mov

After

after720.mov

Pre-merge author checklist

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.

@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system in Extension label Jun 7, 2024
@georgewrmarshall georgewrmarshall self-assigned this Jun 7, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 7, 2024

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Comment on lines +31 to +35
- `AvatarIconSize.Xs` 16px (icon size: 10px)
- `AvatarIconSize.Sm` 24px (icon size: 15px)
- `AvatarIconSize.Md` 32px (icon size: 20px)
- `AvatarIconSize.Lg` 40px (icon size: 25px)
- `AvatarIconSize.Xl` 48px (icon size: 30px)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2024-06-07 at 2 52 46 PM Screenshot 2024-06-07 at 2 53 19 PM

Comment on lines +54 to +59
{...iconProps}
className={classnames(
'mm-avatar-icon__icon',
`mm-avatar-icon__icon--size-${size}`,
iconProps?.className || '',
)}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ensures a custom classname is still possible without overriding current icon classnames

expect(getByTestId('xl-icon')).toHaveClass(
`mm-avatar-icon__icon--size-${AvatarIconSize.Xl}`,
);
});
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updating tests to include icon checks

}: AvatarIconProps<C>,
ref?: PolymorphicRef<C>,
) => {
const iconSize = avatarIconSizeToIconSize[size];
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No longer need the avatarIconSizeToIconSize

Comment on lines -14 to -20
export const avatarIconSizeToIconSize: Record<AvatarIconSize, IconSize> = {
[AvatarIconSize.Xs]: IconSize.Xs,
[AvatarIconSize.Sm]: IconSize.Sm,
[AvatarIconSize.Md]: IconSize.Md,
[AvatarIconSize.Lg]: IconSize.Lg,
[AvatarIconSize.Xl]: IconSize.Xl,
};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No longer needed

@import 'avatar-base/avatar-base';
@import 'avatar-account/avatar-account';
@import 'avatar-favicon/avatar-favicon';
@import 'avatar-icon/avatar-icon';
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adding avatar-icon stylesheet to main component-library stylesheet

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 7, 2024

This PR has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 14 days. Thank you for your contributions.

@github-actions github-actions bot added the stale issues and PRs marked as stale label Aug 7, 2024
@github-actions
Copy link
Copy Markdown
Contributor

This PR was closed because there has been no follow up activity in the last 14 days. Thank you for your contributions.

@github-actions github-actions bot closed this Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale issues and PRs marked as stale team-design-system All issues relating to design system in Extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Update AvararIcon icon sizes

1 participant