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

Fix/18885 migrate avatar token #19080

Merged
merged 6 commits into from
Jul 26, 2023

Conversation

thebinij
Copy link
Contributor

@thebinij thebinij commented May 9, 2023

Explanation

Screenshots/Screencaps

Before

before.mp4

After

after.mp4

Manual Testing Steps

No functional changes

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
  • 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.

@thebinij thebinij requested a review from a team as a code owner May 9, 2023 17:29
@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2023

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.

@thebinij thebinij mentioned this pull request May 9, 2023
6 tasks
@georgewrmarshall georgewrmarshall requested review from georgewrmarshall and garrettbear and removed request for pedronfigueiredo May 10, 2023 00:21
@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system in Extension label May 10, 2023
Copy link
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.

Hey @thebinij, I've checked out your branch and tried a few things to get the types to work but I can't seem to find a reliable pattern. I think for now we just make AvatarBaseProps accept all variant size types as a union type for now and update it in the future once we find a scalable pattern to use.

@codecov
Copy link

codecov bot commented May 14, 2023

Codecov Report

Merging #19080 (7c476f1) into develop (d6cb724) will decrease coverage by 0.01%.
Report is 2 commits behind head on develop.
The diff coverage is 95.65%.

@@             Coverage Diff             @@
##           develop   #19080      +/-   ##
===========================================
- Coverage    69.46%   69.45%   -0.01%     
===========================================
  Files          983      982       -1     
  Lines        37299    37297       -2     
  Branches     10025    10026       +1     
===========================================
- Hits         25908    25904       -4     
- Misses       11391    11393       +2     
Files Changed Coverage Δ
...ts/component-library/avatar-token/avatar-token.tsx 95.65% <95.65%> (ø)

... and 2 files with indirect coverage changes

@thebinij thebinij force-pushed the fix/18885-Migrate-AvatarToken branch 2 times, most recently from 8ee5ca4 to dea4413 Compare May 29, 2023 06:55
@georgewrmarshall
Copy link
Contributor

Hey @thebinij, Thanks for your time and effort in creating this pull request. As you're probably aware we have identified an issue related to the typing of the Box component, specifically with the polymorphic as prop. To address this issue, we have an open ticket at #19239 and a draft pull request at #19363 that needs to be merged before we can proceed with your PR. Thanks for your patience

thebinij and others added 2 commits July 24, 2023 15:37
fix lint

fixing error

replace BoxTextAlign with TextAlign

using AvatarTokenSize

fix avatar-base-type
fix lint

fixing error

replace BoxTextAlign with TextAlign

using AvatarTokenSize

fix avatar-base-type

Added union AvatarTokenSize

TokenProps extends BaseProps

remove children prop from BaseProps

replace deprecated

lint fix
@garrettbear garrettbear force-pushed the fix/18885-Migrate-AvatarToken branch from 137259d to b0468e8 Compare July 24, 2023 22:38
@@ -13,7 +13,7 @@ export enum AvatarNetworkSize {
* Props for the AvatarNetwork component
*/
export interface AvatarNetworkStyleUtilityProps
extends Omit<AvatarBaseStyleUtilityProps, 'size'> {
extends Omit<AvatarBaseStyleUtilityProps, 'size' | 'children'> {
Copy link
Contributor

Choose a reason for hiding this comment

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

@georgewrmarshall double-check that this is the right solution.

Before

Screenshot 2023-07-25 at 3 55 24 PM

After

Screenshot 2023-07-25 at 3 55 41 PM

Copy link
Contributor

@georgewrmarshall georgewrmarshall Jul 26, 2023

Choose a reason for hiding this comment

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

I think this makes sense to my limited TypeScript knowledged brain. We are adjusting the types at the same level we are increasing the specificity of the component. We can omit the children prop because we are supplying the children using the <img /> element or fallbackString I think it makes more sense that making children optional on the AvatarBase level

@garrettbear
Copy link
Contributor

ButtonLink lint error that is probably coming from the ButtonBase update and hopefully will be fixed when converting ButtonLink to TS.

Screenshot 2023-07-25 at 3 59 55 PM

Copy link
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.

Looks alll G to ME! Thanks for your contribution @thebinij and for supporting @garrettbear 💯

@georgewrmarshall
Copy link
Contributor

ButtonLink lint error that is probably coming from the ButtonBase update and hopefully will be fixed when converting ButtonLink to TS.

Screenshot 2023-07-25 at 3 59 55 PM

Looks like we are safe for the most part as the only use in tsx files are in stories which are ignored from the linter. I think we can prioritize buttons next

Screenshot 2023-07-25 at 5 29 05 PM

@garrettbear garrettbear merged commit d3c9d4a into MetaMask:develop Jul 26, 2023
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
external-contributor team-design-system All issues relating to design system in Extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate components to TS: AvatarToken
3 participants