Skip to content

Commit

Permalink
Merge pull request #2006 from oasisprotocol/lw/mono-amounts
Browse files Browse the repository at this point in the history
Use Roboto Mono font for amounts
  • Loading branch information
lukaw3d authored Jul 16, 2024
2 parents 1f408c3 + f4955f1 commit fbd656d
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 19 deletions.
1 change: 1 addition & 0 deletions .changelog/2006.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use Roboto Mono for amounts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ exports[`<AddEscrowForm /> should match snapshot 1`] = `
<span>
<div
class="c9"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
456.542341274
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exports[`<AmountFormatter /> should render component 1`] = `
<span>
<div
class="c0"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
456.542341274
</div>
Expand Down Expand Up @@ -69,7 +69,7 @@ exports[`<AmountFormatter /> should render component with small ticker 1`] = `
<span>
<div
class="c0"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
456.542341274
</div>
Expand Down
11 changes: 10 additions & 1 deletion src/app/components/AmountFormatter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,16 @@ export const AmountFormatter = memo(

return (
<span>
<Box style={{ display: 'inline-flex', whiteSpace: 'nowrap' }}>{amountString}</Box>
<Box
style={{
display: 'inline-flex',
whiteSpace: 'nowrap',
fontFamily: '"Roboto mono", monospace',
letterSpacing: 0,
}}
>
{amountString}
</Box>
{!hideTicker && (
<Text size={size} {...tickerProps} {...colorProps}>
<NoTranslate>{` ${ticker}`}</NoTranslate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ exports[`<ReclaimEscrowForm /> should match snapshot 1`] = `
<span>
<div
class="c2"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
0.000001
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ exports[`<Account /> should match snapshot 1`] = `
<span>
<div
class="c11"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
0.000001
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ exports[`<AccountSelector /> should match snapshot 1`] = `
<span>
<div
class="c5"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
0.0000001
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ exports[`<Transaction /> should handle unknown transaction types gracefully 1`]
<span>
<div
class="c15"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
0.001
</div>
Expand Down Expand Up @@ -1411,7 +1411,7 @@ exports[`<Transaction /> should match snapshot 1`] = `
<span>
<div
class="c15"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
0.001
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ exports[`<AccountPage /> should match snapshot 1`] = `
<span>
<div
class="c15"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
100.000001111
</div>
Expand All @@ -991,7 +991,7 @@ exports[`<AccountPage /> should match snapshot 1`] = `
<span>
<div
class="c15"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
100.0
</div>
Expand All @@ -1015,7 +1015,7 @@ exports[`<AccountPage /> should match snapshot 1`] = `
<span>
<div
class="c15"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
0.000001111
</div>
Expand All @@ -1038,7 +1038,7 @@ exports[`<AccountPage /> should match snapshot 1`] = `
<span>
<div
class="c15"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
0.0
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ exports[`<TransactionAmount /> should render component 1`] = `
<span>
<div
class="c15"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
1.0
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ exports[`<ActiveDelegationList /> should match snapshot 1`] = `
<span>
<div
class="c0"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
0.0000001
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ exports[`<DebondingDelegationList /> should match snapshot 1`] = `
<span>
<div
class="c0"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
0.0000001
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ exports[`<ValidatorList /> list should match snapshot 1`] = `
<span>
<div
class="c0"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
0
</div>
Expand Down Expand Up @@ -837,7 +837,7 @@ exports[`<ValidatorList /> list should match snapshot 1`] = `
<span>
<div
class="c0"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
0
</div>
Expand Down Expand Up @@ -909,7 +909,7 @@ exports[`<ValidatorList /> list should match snapshot 1`] = `
<span>
<div
class="c0"
style="display: inline-flex; white-space: nowrap;"
style="display: inline-flex; white-space: nowrap; font-family: "Roboto mono", monospace; letter-spacing: 0;"
>
0
</div>
Expand Down
12 changes: 12 additions & 0 deletions src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@
url("./../fonts/roboto-mono/roboto-mono-v13-latin-300.woff") format("woff");
}

/** Use Rubik for "." and "," instead of Roboto Mono. */
@font-face {
font-family: 'Roboto Mono';
font-style: normal;
font-weight: 300;
font-display: swap;
src:
url("./../fonts/rubik/rubik-v20-latin-ext_latin-300.woff2") format("woff2"),
url("./../fonts/rubik/rubik-v20-latin-ext_latin-300.woff") format("woff");
unicode-range: U+002E, U+002C;
}

a {
color: inherit; /* blue colors for links too */
text-decoration: inherit; /* no underline */
Expand Down

0 comments on commit fbd656d

Please sign in to comment.