Skip to content

chore: consolidating spinner color and refactoring institutional qr code modal#25011

Merged
georgewrmarshall merged 3 commits intodevelopfrom
update-qr-code-modal
Jun 7, 2024
Merged

chore: consolidating spinner color and refactoring institutional qr code modal#25011
georgewrmarshall merged 3 commits intodevelopfrom
update-qr-code-modal

Conversation

@georgewrmarshall
Copy link
Copy Markdown
Contributor

@georgewrmarshall georgewrmarshall commented Jun 3, 2024

Description

Breaking out parts of #24971 for easier review. This PR replaces deprecated colors in favor of the most updated design system colors. I also noticed that this particular component could benefit from some layout and overflow updates.

Open in GitHub Codespaces

Related issues

Part of: #24964

Manual testing steps

  1. Go to the storybook build of this page
  2. Search for Spinner and QRCodeModal
  3. Check colors have been updated properly in light and dark mode

Screenshots/Recordings

Before

before720.mov

After

after.mov

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • 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.

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

github-actions bot commented Jun 3, 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.

**/
@import 'jwt-dropdown/jwt-dropdown';
@import 'note-to-trader/index';
@import 'qr-code-modal/qr-code-modal';
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.

importing stylesheet to main index styles file

@@ -0,0 +1,5 @@
.institutional-qr-code-modal {
&__qr-code {
background-color: var(--qr-code-white-background);
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.

Moving inline styles to custom classname


const meta: Meta<typeof QRCodeModal> = {
title: 'Components/QRCodeModal',
title: 'Components/Institutional/QRCodeModal',
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.

Fixing storybook title

Before

Screenshot 2024-06-03 at 1 54 11 PM

After

Screenshot 2024-06-03 at 1 43 26 PM

Comment on lines -211 to -217
style={{
padding: 20,
backgroundColor: 'var(--qr-code-white-background)',
display: 'flex',
alignItems: 'center',
flexDirection: 'column',
}}
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.

Removing inlines styles in favor of style utility props and custom classname

flexDirection: 'column',
}}

<ModalBody>
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.

ModalBody handles overflow using a scroll container

<QRCode value={qrCodeValue} size={270} />
</Box>
) : (
<Spinner />
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.

We can remove the color as it now defaults to the correct icon-muted color


const Spinner = ({ className = '', color = 'var(--color-text-default)' }) => {
const Spinner = ({ className = '', color = 'var(--color-icon-muted)' }) => {
return (
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.

Before

before.mov

After

after.mov

},
args: {
color: 'var(--color-warning-default)',
color: 'var(--color-icon-muted)',
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.

Same as above

@georgewrmarshall georgewrmarshall marked this pull request as ready for review June 3, 2024 23:08
@georgewrmarshall georgewrmarshall requested review from a team as code owners June 3, 2024 23:08
brianacnguyen
brianacnguyen previously approved these changes Jun 3, 2024
Copy link
Copy Markdown
Contributor

@brianacnguyen brianacnguyen left a comment

Choose a reason for hiding this comment

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

approved on ds side

@albertolive
Copy link
Copy Markdown
Contributor

Hi @georgewrmarshall,

The refactoring looks great! I really appreciate your work on this.

I have one small request: Could you please reduce the size of the loader? It currently appears quite large, and adjusting it to a smaller size would be perfect.

albertolive
albertolive previously approved these changes Jun 4, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [3a9c51c]
Page Load Metrics (339 ± 320 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint701591022512
domContentLoaded85316126
load422174339667320
domInteractive85316126
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -2 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.70%. Comparing base (88b0fdb) to head (7fa0895).
Report is 45 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #25011   +/-   ##
========================================
  Coverage    65.70%   65.70%           
========================================
  Files         1369     1369           
  Lines        54364    54365    +1     
  Branches     14149    14150    +1     
========================================
+ Hits         35716    35717    +1     
  Misses       18648    18648           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +6 to +8
&__spinner {
width: 100px;
}
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.

Reducing the size of the spinner

@georgewrmarshall
Copy link
Copy Markdown
Contributor Author

Hi @georgewrmarshall,

The refactoring looks great! I really appreciate your work on this.

I have one small request: Could you please reduce the size of the loader? It currently appears quite large, and adjusting it to a smaller size would be perfect.

Not a problem! Updated and updated screencasts in description @albertolive

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [7fa0895]
Page Load Metrics (52 ± 3 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint681058373
domContentLoaded9201131
load44705273
domInteractive9201131
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -2 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@georgewrmarshall georgewrmarshall added the needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. label Jun 6, 2024
@georgewrmarshall georgewrmarshall merged commit c1a5959 into develop Jun 7, 2024
@georgewrmarshall georgewrmarshall deleted the update-qr-code-modal branch June 7, 2024 19:53
@github-actions github-actions bot locked and limited conversation to collaborators Jun 7, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 7, 2024
@georgewrmarshall georgewrmarshall changed the title chore: refactoring institutional qr code modal chore: consolidating spinner color and refactoring institutional qr code modal Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-design-system All issues relating to design system in Extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants