Skip to content

Commit

Permalink
Use TextVariant: Inherit to keep correct font-size
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing committed Jul 17, 2023
1 parent 3fb4b02 commit e6376e6
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ exports[`ConfirmGasDisplay should match snapshot 1`] = `
title="0"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0
</span>
Expand All @@ -86,12 +86,12 @@ exports[`ConfirmGasDisplay should match snapshot 1`] = `
title="0 ETH"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0
</span>
<span
class="box mm-text currency-display-component__suffix mm-text--body-md box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__suffix mm-text--inherit box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
>
ETH
</span>
Expand Down Expand Up @@ -131,12 +131,12 @@ exports[`ConfirmGasDisplay should match snapshot 1`] = `
title="0 ETH"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0
</span>
<span
class="box mm-text currency-display-component__suffix mm-text--body-md box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__suffix mm-text--inherit box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
>
ETH
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ exports[`ConfirmLegacyGasDisplay should match snapshot 1`] = `
title="0.000021"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0.000021
</span>
Expand All @@ -66,12 +66,12 @@ exports[`ConfirmLegacyGasDisplay should match snapshot 1`] = `
title="0.000021 ETH"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0.000021
</span>
<span
class="box mm-text currency-display-component__suffix mm-text--body-md box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__suffix mm-text--inherit box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
>
ETH
</span>
Expand All @@ -96,12 +96,12 @@ exports[`ConfirmLegacyGasDisplay should match snapshot 1`] = `
title="0.000021 ETH"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0.000021
</span>
<span
class="box mm-text currency-display-component__suffix mm-text--body-md box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__suffix mm-text--inherit box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
>
ETH
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ exports[`Confirm Detail Row Component should match snapshot 1`] = `
>
<div
class="mm-box currency-display-component__prefix mm-box--margin-inline-end-1"
variant="inherit"
>
<i
class="fab fa-ethereum"
style="font-size: 18px;"
/>
</div>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0
</span>
Expand All @@ -35,14 +36,15 @@ exports[`Confirm Detail Row Component should match snapshot 1`] = `
>
<div
class="mm-box currency-display-component__prefix mm-box--margin-inline-end-1"
variant="inherit"
>
<i
class="fab fa-ethereum"
style="font-size: 14px;"
/>
</div>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ exports[`CurrencyInput Component rendering should render properly with a fiat va
title="0.00432788 ETH"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0.00432788
</span>
<span
class="box mm-text currency-display-component__suffix mm-text--body-md box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__suffix mm-text--inherit box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
>
ETH
</span>
Expand Down Expand Up @@ -129,12 +129,12 @@ exports[`CurrencyInput Component rendering should render properly with an ETH va
title="$231.06 USD"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
$231.06
</span>
<span
class="box mm-text currency-display-component__suffix mm-text--body-md box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__suffix mm-text--inherit box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
>
USD
</span>
Expand Down Expand Up @@ -183,12 +183,12 @@ exports[`CurrencyInput Component rendering should render properly without a suff
title="$0.00 USD"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
$0.00
</span>
<span
class="box mm-text currency-display-component__suffix mm-text--body-md box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__suffix mm-text--inherit box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
>
USD
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ exports[`CancelTransactionGasFee Component should render 1`] = `
title="0 ETH"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0
</span>
<span
class="box mm-text currency-display-component__suffix mm-text--body-md box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__suffix mm-text--inherit box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
>
ETH
</span>
Expand All @@ -25,12 +25,12 @@ exports[`CancelTransactionGasFee Component should render 1`] = `
title="0 ETH"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0
</span>
<span
class="box mm-text currency-display-component__suffix mm-text--body-md box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__suffix mm-text--inherit box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
>
ETH
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ exports[`Multi layer fee message when balance and token price checker is enabled
title="$0.56"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
$0.56
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ exports[`UserPreferencedCurrencyDisplay Component rendering should match snapsho
title="0 ETH"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0
</span>
<span
class="box mm-text currency-display-component__suffix mm-text--body-md box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__suffix mm-text--inherit box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
>
ETH
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ exports[`AccountListItem renders AccountListItem component and shows account nam
title="0.006 ETH"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0.006
</span>
<span
class="box mm-text currency-display-component__suffix mm-text--body-md box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__suffix mm-text--inherit box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
>
ETH
</span>
Expand Down Expand Up @@ -111,12 +111,12 @@ exports[`AccountListItem renders AccountListItem component and shows account nam
title="0.006 ETH"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
0.006
</span>
<span
class="box mm-text currency-display-component__suffix mm-text--body-md box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__suffix mm-text--inherit box--margin-inline-start-1 box--flex-direction-row box--color-text-default"
>
ETH
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`CurrencyDisplay Component should match default snapshot 1`] = `
title="null"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
/>
</div>
</div>
Expand All @@ -20,7 +20,7 @@ exports[`CurrencyDisplay Component should render text with a className 1`] = `
title="$123.45"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
$123.45
</span>
Expand All @@ -35,7 +35,7 @@ exports[`CurrencyDisplay Component should render text with a prefix 1`] = `
title="-$123.45"
>
<span
class="box mm-text currency-display-component__text mm-text--body-md mm-text--ellipsis box--flex-direction-row box--color-text-default"
class="box mm-text currency-display-component__text mm-text--inherit mm-text--ellipsis box--flex-direction-row box--color-text-default"
>
-
$123.45
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
AlignItems,
Display,
FlexWrap,
TextVariant,
} from '../../../helpers/constants/design-system';

export default function CurrencyDisplay({
Expand Down Expand Up @@ -54,6 +55,7 @@ export default function CurrencyDisplay({
<Box
className="currency-display-component__prefix"
marginInlineEnd={1}
variant={TextVariant.inherit}
{...prefixComponentWrapperProps}
>
{prefixComponent}
Expand All @@ -63,6 +65,7 @@ export default function CurrencyDisplay({
as="span"
className="currency-display-component__text"
ellipsis
variant={TextVariant.inherit}
{...textProps}
>
{parts.prefix}
Expand All @@ -73,6 +76,7 @@ export default function CurrencyDisplay({
as="span"
className="currency-display-component__suffix"
marginInlineStart={1}
variant={TextVariant.inherit}
{...suffixProps}
>
{parts.suffix}
Expand Down
Loading

0 comments on commit e6376e6

Please sign in to comment.