Skip to content

Commit

Permalink
fix(28081): design tweak for network badge (#29324)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
This PR address feedback from design quality check to tweak board color
and width for network badge.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29324?quickstart=1)

## **Related issues**

Fixes: #28081

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**
See PR for related changes
<!-- [screenshots/recordings] -->

### **After**
See PR for related changes
<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
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.

---------

Co-authored-by: georgewrmarshall <[email protected]>
  • Loading branch information
DDDDDanica and georgewrmarshall authored Dec 20, 2024
1 parent 29cbe95 commit 63597c1
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports[`Token Cell should match snapshot 1`] = `
class="mm-box mm-badge-wrapper__badge-container mm-badge-wrapper__badge-container--rectangular-bottom-right"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-avatar-network multichain-token-list-item__badge__avatar-network mm-text--body-xs mm-text--text-transform-uppercase mm-box--display-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-text-default mm-box--background-color-background-alternative mm-box--rounded-md mm-box--border-color-background-default mm-box--border-width-1 box--border-style-solid"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-avatar-network multichain-token-list-item__badge__avatar-network mm-text--body-xs mm-text--text-transform-uppercase mm-box--display-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-text-default mm-box--background-color-background-default mm-box--rounded-md mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
>
<img
alt="network logo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const DetectedTokenDetails = ({
src={CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP[chainId]}
name={currentNetwork?.nickname || ''}
backgroundColor={testNetworkBackgroundColor}
borderWidth={2}
/>
}
marginRight={2}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ exports[`AccountListItem renders AccountListItem component and shows account nam
style="bottom: -1px; right: 2px;"
>
<div
class="mm-box multichain-badge-status__badge mm-box--background-color-border-muted mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-4 box--border-style-solid"
class="mm-box multichain-badge-status__badge mm-box--background-color-icon-alternative mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
/>
</div>
</div>
Expand Down Expand Up @@ -424,7 +424,7 @@ exports[`AccountListItem renders AccountListItem component and shows account nam
style="bottom: -1px; right: 2px;"
>
<div
class="mm-box multichain-badge-status__badge mm-box--background-color-border-muted mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-4 box--border-style-solid"
class="mm-box multichain-badge-status__badge mm-box--background-color-icon-alternative mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import {
getMultichainShouldShowFiat,
} from '../../../selectors/multichain';
import { useMultichainAccountTotalFiatBalance } from '../../../hooks/useMultichainAccountTotalFiatBalance';
import { ConnectedStatus } from '../connected-status/connected-status';
import { ConnectedStatus } from '../connected-status';
///: BEGIN:ONLY_INCLUDE_IF(build-mmi)
import { getCustodianIconForAddress } from '../../../selectors/institutional/selectors';
import { useTheme } from '../../../hooks/useTheme';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const DefaultStory = Template.bind({});

export const NotConnectedStory = Template.bind({});
NotConnectedStory.args = {
badgeBackgroundColor: Color.borderMuted,
badgeBackgroundColor: BackgroundColor.iconAlternative,
badgeBorderColor: BackgroundColor.backgroundDefault,
};

Expand Down
2 changes: 1 addition & 1 deletion ui/components/multichain/badge-status/badge-status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const BadgeStatus: React.FC<BadgeStatusProps> = ({
backgroundColor={badgeBackgroundColor}
borderRadius={BorderRadius.full}
borderColor={badgeBorderColor}
borderWidth={isConnectedAndNotActive ? 2 : 4}
borderWidth={2}
/>
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ exports[`Connect More Accounts Modal should render correctly 1`] = `
style="bottom: -1px; right: 2px;"
>
<div
class="mm-box multichain-badge-status__badge mm-box--background-color-border-muted mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-4 box--border-style-solid"
class="mm-box multichain-badge-status__badge mm-box--background-color-icon-alternative mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports[`Connected Site Menu should render the site menu in connected state 1`]
style="bottom: -1px; right: -4px; z-index: 1;"
>
<div
class="mm-box multichain-connected-site-menu__badge mm-box--background-color-success-default mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-3 box--border-style-solid"
class="mm-box multichain-connected-site-menu__badge mm-box--background-color-success-default mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
/>
</div>
</div>
Expand Down Expand Up @@ -74,7 +74,7 @@ exports[`Connected Site Menu should render the site menu in not connected state
style="bottom: -1px; right: -4px; z-index: 1;"
>
<div
class="mm-box multichain-connected-site-menu__badge mm-box--background-color-icon-alternative mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-3 box--border-style-solid"
class="mm-box multichain-connected-site-menu__badge mm-box--background-color-icon-alternative mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ export const ConnectedSiteMenu = ({
borderColor={
isConnectedtoOtherAccountOrSnap
? BorderColor.successDefault
: BackgroundColor.backgroundDefault
: BorderColor.backgroundDefault
}
borderWidth={isConnectedtoOtherAccountOrSnap ? 2 : 3}
borderWidth={2}
/>
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useSelector } from 'react-redux';
import {
BackgroundColor,
BorderColor,
Color,
} from '../../../helpers/constants/design-system';
import { isAccountConnectedToCurrentTab } from '../../../selectors';
import {
Expand Down Expand Up @@ -43,11 +42,11 @@ export const ConnectedStatus: React.FC<ConnectedStatusProps> = ({
status = STATUS_CONNECTED_TO_ANOTHER_ACCOUNT;
}

let badgeBorderColor = BackgroundColor.backgroundDefault; // TODO: Replace it once border-color has this value.
let badgeBackgroundColor = Color.borderMuted; // //TODO: Replace it once Background color has this value.
let badgeBorderColor = BorderColor.backgroundDefault; // TODO: Replace it once border-color has this value.
let badgeBackgroundColor = BackgroundColor.iconAlternative;
let tooltipText = t('statusNotConnected');
if (status === STATUS_CONNECTED) {
badgeBorderColor = BackgroundColor.backgroundDefault;
badgeBorderColor = BorderColor.backgroundDefault;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: type 'string' can't be used to index type '{}'
badgeBackgroundColor = BackgroundColor.successDefault;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ exports[`Connections Content should render correctly 1`] = `
style="bottom: -1px; right: 2px;"
>
<div
class="mm-box multichain-badge-status__badge mm-box--background-color-success-default mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-4 box--border-style-solid"
class="mm-box multichain-badge-status__badge mm-box--background-color-success-default mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ exports[`SendPage render and initialization should render correctly even when a
style="bottom: -1px; right: 2px;"
>
<div
class="mm-box multichain-badge-status__badge mm-box--background-color-border-muted mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-4 box--border-style-solid"
class="mm-box multichain-badge-status__badge mm-box--background-color-icon-alternative mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ exports[`SendPageYourAccounts render renders correctly 1`] = `
style="bottom: -1px; right: 2px;"
>
<div
class="mm-box multichain-badge-status__badge mm-box--background-color-border-muted mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-4 box--border-style-solid"
class="mm-box multichain-badge-status__badge mm-box--background-color-icon-alternative mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
/>
</div>
</div>
Expand Down Expand Up @@ -421,7 +421,7 @@ exports[`SendPageYourAccounts render renders correctly 1`] = `
style="bottom: -1px; right: 2px;"
>
<div
class="mm-box multichain-badge-status__badge mm-box--background-color-border-muted mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-4 box--border-style-solid"
class="mm-box multichain-badge-status__badge mm-box--background-color-icon-alternative mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
/>
</div>
</div>
Expand Down Expand Up @@ -720,7 +720,7 @@ exports[`SendPageYourAccounts render renders correctly 1`] = `
style="bottom: -1px; right: 2px;"
>
<div
class="mm-box multichain-badge-status__badge mm-box--background-color-border-muted mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-4 box--border-style-solid"
class="mm-box multichain-badge-status__badge mm-box--background-color-icon-alternative mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
/>
</div>
</div>
Expand Down Expand Up @@ -1028,7 +1028,7 @@ exports[`SendPageYourAccounts render renders correctly 1`] = `
style="bottom: -1px; right: 2px;"
>
<div
class="mm-box multichain-badge-status__badge mm-box--background-color-border-muted mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-4 box--border-style-solid"
class="mm-box multichain-badge-status__badge mm-box--background-color-icon-alternative mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
/>
</div>
</div>
Expand Down Expand Up @@ -1327,7 +1327,7 @@ exports[`SendPageYourAccounts render renders correctly 1`] = `
style="bottom: -1px; right: 2px;"
>
<div
class="mm-box multichain-badge-status__badge mm-box--background-color-border-muted mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-4 box--border-style-solid"
class="mm-box multichain-badge-status__badge mm-box--background-color-icon-alternative mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
/>
</div>
</div>
Expand Down Expand Up @@ -1639,7 +1639,7 @@ exports[`SendPageYourAccounts render renders correctly 1`] = `
style="bottom: -1px; right: 2px;"
>
<div
class="mm-box multichain-badge-status__badge mm-box--background-color-border-muted mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-4 box--border-style-solid"
class="mm-box multichain-badge-status__badge mm-box--background-color-icon-alternative mm-box--rounded-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
/>
</div>
</div>
Expand Down
Loading

0 comments on commit 63597c1

Please sign in to comment.