Skip to content

Commit bdfd3fc

Browse files
authored
Merge pull request #244 from leapdao/fix/222-simple-balance-crash
Fix #222 simple balance crash
2 parents f2510d9 + 0e51aa8 commit bdfd3fc

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

public/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU"
2121
crossorigin="anonymous"
2222
/>
23+
24+
<link
25+
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700&display=swap"
26+
rel="stylesheet"
27+
/>
28+
2329
<title>Plasma Burner</title>
2430
<meta name="description" content="Transfer PDAI quickly" />
2531
<meta

src/App.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export default class App extends Component {
161161

162162
// NOTE: This function is for _displaying_ a currency value to a user. It
163163
// adds a currency unit to the beginning or end of the number!
164-
currencyDisplay(amount, toParts=false, convert=true) {
164+
currencyDisplay(amount, convert=true) {
165165
const { account } = this.state;
166166
const locale = getStoredValue('i18nextLng');
167167
const symbol = getStoredValue('currency', account) || CONFIG.CURRENCY.DEFAULT_CURRENCY;
@@ -175,7 +175,8 @@ export default class App extends Component {
175175
currency: symbol,
176176
maximumFractionDigits: 2
177177
});
178-
return toParts ? formatter.formatToParts(amount) : formatter.format(amount);
178+
179+
return formatter.format(amount);
179180
}
180181

181182
/*

src/components/SimpleBalance.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ const StyledBalance = styled.div`
1616
}
1717
1818
span {
19-
font-size: 200%;
19+
font-size: 2.5em;
20+
font-weight: 700;
2021
}
2122
2223
.integer {
@@ -49,14 +50,11 @@ export default ({ mainAmount, otherAmounts, currencyDisplay }) => {
4950
(acc, curr) => acc + parseInt(curr, 10),
5051
0
5152
);
52-
const parts = currencyDisplay(mainAmount, true);
5353

5454
return (
5555
<>
5656
<StyledBalance>
57-
{parts.map(({ type, value }) => (
58-
<Text.span className={type} key={type}>{value}</Text.span>
59-
))}
57+
<Text.span>{currencyDisplay(mainAmount)}</Text.span>
6058
{otherAssetsTotal > 0 && (
6159
<Text className="otherAssets" italic fontSize={1} textAlign="center">
6260
+{currencyDisplay(otherAssetsTotal)} in other assets

0 commit comments

Comments
 (0)