-
Notifications
You must be signed in to change notification settings - Fork 5k
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: center token icon #26013
fix: center token icon #26013
Conversation
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR centers the token icon in the MultichainTokenListItem
by adjusting the CSS properties.
- Modified
ui/components/component-library/badge-wrapper/badge-wrapper.scss
to change.mm-badge-wrapper
'salign-self
fromstart
tocenter
. - Ensure this change does not negatively impact other components relying on the previous alignment.
1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings
@@ -36,7 +36,7 @@ | |||
--badge-wrapper-position-rectangular: 0; | |||
|
|||
position: relative; | |||
align-self: start; // prevents stretching of badge-wrapper when in flexbox container to maintain badge positioning | |||
align-self: center; // prevents stretching of badge-wrapper when in flexbox container to maintain badge positioning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Info: Changed align-self
from start
to center
to center the badge wrapper in its flexbox container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
This PR centers the token icon in the MultichainTokenListItem
by adjusting CSS properties and adding a class to the BadgeWrapper
component.
- Modified
ui/components/component-library/badge-wrapper/badge-wrapper.scss
to change.mm-badge-wrapper
'salign-self
fromcenter
tostart
. - Updated
ui/components/multichain/token-list-item/index.scss
to add a new CSS rule for centering the badge within the token list item. - Added
className="multichain-token-list-item__badge"
to theBadgeWrapper
inui/components/multichain/token-list-item/token-list-item.js
.
Ensure these changes do not negatively impact other components relying on the previous alignment.
3 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings
&__badge { | ||
align-self: center; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Info: Added CSS rule to center the badge within the token list item.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding custom CSS is the right move here because the Box component doesn't currently support and alignSelf
style utility prop
@@ -220,6 +220,7 @@ export const TokenListItem = ({ | |||
/> | |||
} | |||
marginRight={3} | |||
className="multichain-token-list-item__badge" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Info: Added className
attribute to BadgeWrapper
for centering the token icon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
The PR centers the token icon in the MultichainTokenListItem
by adjusting CSS properties and adding a class to the BadgeWrapper
component.
- Modified
ui/components/component-library/badge-wrapper/badge-wrapper.scss
to change.mm-badge-wrapper
'salign-self
fromcenter
tostart
. - Updated
ui/components/multichain/token-list-item/index.scss
to add a new CSS rule for centering the badge within the token list item. - Added
className="multichain-token-list-item__badge"
to theBadgeWrapper
inui/components/multichain/token-list-item/token-list-item.js
.
Ensure these changes do not negatively impact other components relying on the previous alignment.
No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
The PR centers the token icon in the MultichainTokenListItem
by adjusting CSS properties and adding a class to the BadgeWrapper
component.
- Modified
ui/components/component-library/badge-wrapper/badge-wrapper.scss
to change.mm-badge-wrapper
'salign-self
fromcenter
tostart
. - Updated
ui/components/multichain/token-list-item/index.scss
to add a new CSS rule for centering the badge within the token list item. - Added
className="multichain-token-list-item__badge"
to theBadgeWrapper
inui/components/multichain/token-list-item/token-list-item.js
.
Ensure these changes do not negatively impact other components relying on the previous alignment.
No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
The PR centers the token icon in the MultichainTokenListItem
by adjusting CSS properties and adding a class to the BadgeWrapper
component.
- Modified
ui/components/component-library/badge-wrapper/badge-wrapper.scss
to change.mm-badge-wrapper
'salign-self
fromcenter
tostart
. - Updated
ui/components/multichain/token-list-item/index.scss
to add a new CSS rule for centering the badge within the token list item. - Added
className="multichain-token-list-item__badge"
to theBadgeWrapper
inui/components/multichain/token-list-item/token-list-item.js
.
Ensure these changes do not negatively impact other components relying on the previous alignment.
No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
The PR centers the token icon in the MultichainTokenListItem
by adjusting CSS properties and adding a class to the BadgeWrapper
component.
- Modified
ui/components/component-library/badge-wrapper/badge-wrapper.scss
to change.mm-badge-wrapper
'salign-self
fromcenter
tostart
. - Updated
ui/components/multichain/token-list-item/index.scss
to add a new CSS rule for centering the badge within the token list item. - Added
className="multichain-token-list-item__badge"
to theBadgeWrapper
inui/components/multichain/token-list-item/token-list-item.js
.
Ensure these changes do not negatively impact other components relying on the previous alignment.
No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! It might also be worth sharing this with the @MetaMask/wallet-ux team
- Checked update alignment of
AvatarToken
inMultichainTokenListItem
in storybook ✅
&__badge { | ||
align-self: center; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding custom CSS is the right move here because the Box component doesn't currently support and alignSelf
style utility prop
Builds ready [88d04bb]
Page Load Metrics (251 ± 261 ms)
Bundle size diffs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
The PR centers the token icon in the MultichainTokenListItem
by adjusting CSS properties and adding a class to the BadgeWrapper
component.
- Modified
ui/components/component-library/badge-wrapper/badge-wrapper.scss
to change.mm-badge-wrapper
'salign-self
fromcenter
tostart
. - Updated
ui/components/multichain/token-list-item/index.scss
to add a new CSS rule for centering the badge within the token list item. - Added
className="multichain-token-list-item__badge"
to theBadgeWrapper
inui/components/multichain/token-list-item/token-list-item.js
.
Ensure these changes do not negatively impact other components relying on the previous alignment.
51 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Quality Gate passedIssues Measures |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #26013 +/- ##
========================================
Coverage 69.69% 69.69%
========================================
Files 1405 1405
Lines 49723 49723
Branches 13740 13740
========================================
Hits 34650 34650
Misses 15073 15073 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
The PR centers the token icon in the MultichainTokenListItem
by adjusting CSS properties and adding a class to the BadgeWrapper
component.
- Modified
.circleci/config.yml
to remove thetest-e2e-swap-playwright - OPTIONAL
job, potentially streamlining the CI/CD pipeline. - Updated
app/scripts/background.js
to introduceFakeLedgerBridge
andFakeTrezorBridge
for testing. - Added
FakeKeyringBridge
type inapp/scripts/lib/hardware-keyring-builder-factory.ts
for mock bridge implementation. - Enhanced
ui/components/multichain/token-list-item/token-list-item.js
to center the token icon by modifying CSS and adding a class. - Introduced
test/stub/keyring-bridge.js
to simulate keyring bridges for testing purposes.
28 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Builds ready [1a55669]
Page Load Metrics (79 ± 25 ms)
Bundle size diffs
|
Description
This PR centers the tokenIcon in
MultichainTokenListItem
Related issues
Fixes:
https://consensyssoftware.atlassian.net/browse/MMASSETS-251
Manual testing steps
Screenshots/Recordings
Before
Asset picker modal
After
Asset Picker modal
Pre-merge author checklist
Pre-merge reviewer checklist