Skip to content
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

AvatarBase font-size logic #18203

Merged
merged 2 commits into from
Mar 17, 2023
Merged

AvatarBase font-size logic #18203

merged 2 commits into from
Mar 17, 2023

Conversation

georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Mar 16, 2023

Explanation

Currently the fallback for AvatarNetwork and AvatarToken is a letter but at the time of creation there was no Text component. The letter also breaks at size xs of the avatar sizes

This PR changes the root component of the AvatarBase component to a Text component and adds logic to size it according to the avatar sizes. It also:

Screenshots/Screencaps

Before

before.mov

After

after.mov

Manual Testing Steps

  • Go to the latest build of storybook in this PR
  • Search for AvatarNetwork check the controls and stories and docs
  • Do the same for AvatarToken

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@georgewrmarshall georgewrmarshall added area-UI Relating to the user interface. team-design-system All issues relating to design system in Extension IA/NAV labels Mar 16, 2023
@georgewrmarshall georgewrmarshall self-assigned this Mar 16, 2023
@github-actions
Copy link
Contributor

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.

@georgewrmarshall georgewrmarshall marked this pull request as ready for review March 16, 2023 22:51
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner March 16, 2023 22:51
@georgewrmarshall georgewrmarshall requested review from pedronfigueiredo, NidhiKJha and darkwing and removed request for pedronfigueiredo March 16, 2023 22:51
darkwing
darkwing previously approved these changes Mar 16, 2023
display: flex;
align-items: center;
justify-content: center;
text-transform: uppercase;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing in favour of Box props

@georgewrmarshall georgewrmarshall marked this pull request as draft March 16, 2023 23:33
@georgewrmarshall georgewrmarshall changed the title AvatarToken and AvatarNetwork fallback updates AvatarBase font-size logic Mar 16, 2023
@georgewrmarshall georgewrmarshall force-pushed the fix/avatar-fallback branch 2 times, most recently from 6ead1f3 to ca7d178 Compare March 17, 2023 00:00
Comment on lines +103 to +105
expect(getByTestId('success')).toHaveClass(
'mm-text--color-success-default',
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We shouldn't have to update this the text component should use the Box component color prop have created an issue here #18209 cc @garrettbear

@georgewrmarshall georgewrmarshall marked this pull request as ready for review March 17, 2023 00:19
@metamaskbot
Copy link
Collaborator

Builds ready [764b7f4]
Page Load Metrics (1840 ± 80 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint112171137178
domContentLoaded16042135180313866
load16042297184016680
domInteractive16042135180313866
Bundle size diffs
  • background: 0 bytes
  • ui: 373 bytes
  • common: 0 bytes

@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Merging #18203 (764b7f4) into develop (c21c2bd) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop   #18203      +/-   ##
===========================================
+ Coverage    63.96%   63.97%   +0.01%     
===========================================
  Files          914      914              
  Lines        35623    35630       +7     
  Branches      9030     9033       +3     
===========================================
+ Hits         22784    22791       +7     
  Misses       12839    12839              
Impacted Files Coverage Δ
...nents/component-library/avatar-base/avatar-base.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@georgewrmarshall georgewrmarshall merged commit 3117890 into develop Mar 17, 2023
@georgewrmarshall georgewrmarshall deleted the fix/avatar-fallback branch March 17, 2023 17:07
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-UI Relating to the user interface. team-design-system All issues relating to design system in Extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants