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

chore: Polish multichain token list styles #26300

Merged
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5648f9c
Bump Avatar Network marginRight to 16px
gambinish Aug 1, 2024
d64de36
Tweak top & bottom padding on AssetList item
gambinish Aug 1, 2024
7dd7a1d
Bump border width on AvatarBase and set to default background
gambinish Aug 1, 2024
50affff
Convert stakeableTitle to in-line rather than Flexbox to avoid incosi…
gambinish Aug 1, 2024
ec3ed11
Bump font weight on Stake button to match token title
gambinish Aug 1, 2024
4f53c6b
Update snapshots
gambinish Aug 1, 2024
9e420ff
Tweak padding on Import Token modal
gambinish Aug 2, 2024
4ebdb9c
Tweak padding on Account Overview tabs
gambinish Aug 2, 2024
7bd5456
Use outline instead of border for AvatarNetwork, remove border from A…
gambinish Aug 2, 2024
3aff29b
Update snapshots
gambinish Aug 2, 2024
919ea3a
Lint
gambinish Aug 2, 2024
49453a1
Lint
gambinish Aug 2, 2024
be1befe
Lint scss file
gambinish Aug 2, 2024
f8c9881
Remove all borders from NetworkAvatar icons, in network tab, network …
gambinish Aug 2, 2024
ce838ef
Lint css
gambinish Aug 2, 2024
1ff64c5
Move padding to jsx, rather than scss
gambinish Aug 2, 2024
a957253
Merge branch 'develop' into chore/mmassets-328_polish-multichain-toke…
gambinish Aug 22, 2024
0e4494a
Replace border to AvatarNetwork component-library, remove custom outl…
gambinish Aug 22, 2024
dc6c39e
Merge branch 'develop' into chore/mmassets-328_polish-multichain-toke…
gambinish Aug 22, 2024
7eba1d1
Merge branch 'chore/mmassets-328_polish-multichain-token-list-styles'…
gambinish Aug 22, 2024
160cdcc
Update snapshots
gambinish Aug 22, 2024
f3a46d0
Add content-box to mm-avatar-network styles
gambinish Aug 22, 2024
cbabd33
Revert borderColor to existing implementation of alternative
gambinish Aug 22, 2024
be4ed7d
chore: adding storybook for token-list moving avatar network updates …
georgewrmarshall Aug 23, 2024
0d3d34e
chore: moving border to outside of network badge in mutlichain token …
georgewrmarshall Aug 23, 2024
dae0ccf
chore: updating snapshots
georgewrmarshall Aug 23, 2024
fd3c3b7
Merge branch 'develop' into chore/mmassets-328_polish-multichain-toke…
gambinish Aug 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ exports[`NFT Details should match minimal props and state snapshot 1`] = `
style="top: -4px; right: -4px;"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network nft-item__network-badge mm-text--body-sm 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-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network nft-item__network-badge mm-text--body-sm 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-full mm-box--border-color-background-default mm-box--border-width-2 box--border-style-solid"
data-testid="nft-network-badge"
>
C
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ exports[`Token Cell should match snapshot 1`] = `
data-testid="multichain-token-list-item"
>
<a
class="mm-box multichain-token-list-item__container-cell multichain-token-list-item__container-cell--clickable mm-box--padding-4 mm-box--display-flex mm-box--flex-direction-row"
class="mm-box multichain-token-list-item__container-cell multichain-token-list-item__container-cell--clickable mm-box--padding-top-2 mm-box--padding-right-4 mm-box--padding-bottom-2 mm-box--padding-left-4 mm-box--display-flex mm-box--flex-direction-row"
data-testid="multichain-token-list-button"
href="#"
>
<div
class="mm-box mm-badge-wrapper multichain-token-list-item__badge mm-box--margin-right-3 mm-box--display-inline-block"
class="mm-box mm-badge-wrapper multichain-token-list-item__badge mm-box--margin-right-4 mm-box--display-inline-block"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-md mm-avatar-token mm-text--body-sm 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-full"
Expand All @@ -27,7 +27,7 @@ exports[`Token Cell should match snapshot 1`] = `
class="mm-box mm-badge-wrapper__badge-container mm-badge-wrapper__badge-container--circular-top-right"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-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--rounded-full mm-box--border-color-border-muted box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-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--rounded-full"
>
?
</div>
Expand Down
5 changes: 4 additions & 1 deletion ui/components/app/import-token/token-list/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
&__token_component {
display: flex;
flex-flow: row nowrap;
padding: 16px;
padding-left: 16px;
padding-right: 16px;
padding-top: 8px;
padding-bottom: 8px;
bergeron marked this conversation as resolved.
Show resolved Hide resolved
align-items: center;
cursor: pointer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ exports[`IncomingTransactionToggle should render existing incoming transaction p
class="mm-box network-toggle-wrapper__overflow-container mm-box--display-flex mm-box--gap-4 mm-box--align-items-center mm-box--width-full mm-box--background-color-transparent"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full"
>
<img
alt="Ethereum Mainnet logo"
Expand Down Expand Up @@ -110,7 +110,7 @@ exports[`IncomingTransactionToggle should render existing incoming transaction p
class="mm-box network-toggle-wrapper__overflow-container mm-box--display-flex mm-box--gap-4 mm-box--align-items-center mm-box--width-full mm-box--background-color-transparent"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full"
>
<img
alt="Linea Mainnet logo"
Expand Down Expand Up @@ -197,7 +197,7 @@ exports[`IncomingTransactionToggle should render existing incoming transaction p
class="mm-box network-toggle-wrapper__overflow-container mm-box--display-flex mm-box--gap-4 mm-box--align-items-center mm-box--width-full mm-box--background-color-transparent"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full"
>
F
</div>
Expand Down Expand Up @@ -280,7 +280,7 @@ exports[`IncomingTransactionToggle should render existing incoming transaction p
class="mm-box network-toggle-wrapper__overflow-container mm-box--display-flex mm-box--gap-4 mm-box--align-items-center mm-box--width-full mm-box--background-color-transparent"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full"
>
G
</div>
Expand Down Expand Up @@ -363,7 +363,7 @@ exports[`IncomingTransactionToggle should render existing incoming transaction p
class="mm-box network-toggle-wrapper__overflow-container mm-box--display-flex mm-box--gap-4 mm-box--align-items-center mm-box--width-full mm-box--background-color-transparent"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full"
>
S
</div>
Expand Down Expand Up @@ -446,7 +446,7 @@ exports[`IncomingTransactionToggle should render existing incoming transaction p
class="mm-box network-toggle-wrapper__overflow-container mm-box--display-flex mm-box--gap-4 mm-box--align-items-center mm-box--width-full mm-box--background-color-transparent"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full"
>
<img
alt="Linea Goerli logo"
Expand Down Expand Up @@ -533,7 +533,7 @@ exports[`IncomingTransactionToggle should render existing incoming transaction p
class="mm-box network-toggle-wrapper__overflow-container mm-box--display-flex mm-box--gap-4 mm-box--align-items-center mm-box--width-full mm-box--background-color-transparent"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-sm mm-avatar-network mm-text--body-sm 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-full"
>
<img
alt="Linea Sepolia logo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`AvatarNetwork should render correctly 1`] = `
<div>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-md mm-avatar-network mm-text--body-sm 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-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-md mm-avatar-network mm-text--body-sm 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-full"
data-testid="avatar-network"
>
<img
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.mm-avatar-network {
outline: solid 2px;
outline-color: var(--color-background-default);

&--with-halo {
position: relative;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
JustifyContent,
TextColor,
BackgroundColor,
BorderColor,
} from '../../../helpers/constants/design-system';
import type { PolymorphicRef } from '../box';
import { AvatarBase, AvatarBaseProps } from '../avatar-base';
Expand All @@ -21,8 +20,7 @@ export const AvatarNetwork: AvatarNetworkComponent = React.forwardRef(
src,
showHalo,
color = TextColor.textDefault,
backgroundColor = BackgroundColor.backgroundAlternative,
borderColor = BorderColor.transparent,
gambinish marked this conversation as resolved.
Show resolved Hide resolved
backgroundColor = BackgroundColor.backgroundDefault,
className = '',
...props
}: AvatarNetworkProps<C>,
Expand Down Expand Up @@ -54,7 +52,6 @@ export const AvatarNetwork: AvatarNetworkComponent = React.forwardRef(
)}
{...{
backgroundColor,
borderColor,
color,
...(props as AvatarBaseProps<C>),
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`PickerNetwork should render the label inside the PickerNetwork 1`] = `
data-testid="picker-network"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-avatar-network mm-picker-network__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-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-avatar-network mm-picker-network__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-full"
>
I
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
&:not([disabled]):active {
background-color: var(--color-background-default-hover);
}

.mm-avatar-network {
outline: none;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export const AccountOverviewTabs = ({
const t = useI18nContext();
const trackEvent = useContext(MetaMetricsContext);

const tabPadding = 4;
const tabProps = useMemo(
() => ({
activeClassName: 'account-overview__tab--active',
Expand Down Expand Up @@ -128,7 +127,7 @@ export const AccountOverviewTabs = ({
///: END:ONLY_INCLUDE_IF

return (
<Box style={{ flexGrow: '1' }} paddingTop={tabPadding}>
<Box style={{ flexGrow: '1' }}>
<Tabs
defaultActiveTabKey={defaultHomeActiveTabName}
onTabClick={handleTabClick}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`App Header locked state matches snapshot: locked 1`] = `
data-testid="network-display"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-avatar-network mm-picker-network__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-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-avatar-network mm-picker-network__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-full"
role="img"
>
C
Expand Down Expand Up @@ -441,7 +441,7 @@ exports[`App Header unlocked state matches snapshot: unlocked 1`] = `
disabled=""
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-avatar-network mm-picker-network__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-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-avatar-network mm-picker-network__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-full"
role="img"
>
C
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ exports[`AssetPicker matches snapshot 1`] = `
class="mm-box mm-badge-wrapper__badge-container mm-badge-wrapper__badge-container--circular-top-right"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-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-full mm-box--border-color-border-muted box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-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-full mm-box--border-color-border-muted box--border-style-solid box--border-width-1"
>
?
</div>
Expand Down Expand Up @@ -93,7 +93,7 @@ exports[`AssetPicker render if disabled 1`] = `
class="mm-box mm-badge-wrapper__badge-container mm-badge-wrapper__badge-container--circular-top-right"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-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-full mm-box--border-color-border-default box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-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-full mm-box--border-color-border-default box--border-style-solid box--border-width-1"
>
?
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`NetworkListItem renders properly 1`] = `
class="mm-box multichain-network-list-item mm-box--padding-4 mm-box--display-flex mm-box--gap-4 mm-box--justify-content-space-between mm-box--align-items-center mm-box--width-full mm-box--background-color-transparent"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-md mm-avatar-network mm-text--body-sm 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-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-md mm-avatar-network mm-text--body-sm 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-full"
>
<img
alt="Polygon logo"
Expand Down
10 changes: 10 additions & 0 deletions ui/components/multichain/network-list-item/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
&:hover,
&:focus-within {
background: var(--color-background-default-hover);

.mm-avatar-network {
outline: solid 2px;
outline-color: var(--color-background-default-hover);
}
}
}

Expand All @@ -20,6 +25,11 @@
.multichain-network-list-item__delete {
visibility: visible;
}

.mm-avatar-network {
outline: solid 2px;
outline-color: transparent;
}
}

&__network-name {
Expand Down
Loading