Skip to content

Commit

Permalink
Merge pull request austintgriffith#244 from leapdao/fix/222-simple-ba…
Browse files Browse the repository at this point in the history
…lance-crash

Fix austintgriffith#222 simple balance crash
  • Loading branch information
MaxStalker authored Aug 7, 2019
2 parents f2510d9 + 0e51aa8 commit bdfd3fc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 6 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU"
crossorigin="anonymous"
/>

<link
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700&display=swap"
rel="stylesheet"
/>

<title>Plasma Burner</title>
<meta name="description" content="Transfer PDAI quickly" />
<meta
Expand Down
5 changes: 3 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export default class App extends Component {

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

return formatter.format(amount);
}

/*
Expand Down
8 changes: 3 additions & 5 deletions src/components/SimpleBalance.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const StyledBalance = styled.div`
}
span {
font-size: 200%;
font-size: 2.5em;
font-weight: 700;
}
.integer {
Expand Down Expand Up @@ -49,14 +50,11 @@ export default ({ mainAmount, otherAmounts, currencyDisplay }) => {
(acc, curr) => acc + parseInt(curr, 10),
0
);
const parts = currencyDisplay(mainAmount, true);

return (
<>
<StyledBalance>
{parts.map(({ type, value }) => (
<Text.span className={type} key={type}>{value}</Text.span>
))}
<Text.span>{currencyDisplay(mainAmount)}</Text.span>
{otherAssetsTotal > 0 && (
<Text className="otherAssets" italic fontSize={1} textAlign="center">
+{currencyDisplay(otherAssetsTotal)} in other assets
Expand Down

5 comments on commit bdfd3fc

@skywinder
Copy link

@skywinder skywinder commented on bdfd3fc Aug 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MaxStalker can you clarify, how it fixes austintgriffith#244 ?
does it mean, that "incognito mode" is just background image, that reveals, when correct data doesn't load?

@MaxStalker
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skywinder not sure how it end up here :D
Original issue was on plasma-burner-wallet. This one in particular leapdao#244

@skywinder
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha! It's even interesting! :) May I ask you about the status of leapdao plasma project and burner integration?

@TimDaub
Copy link

@TimDaub TimDaub commented on bdfd3fc Sep 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Status is that it's live under https://peep.cash :)

@skywinder
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Good luck with this project!

Please sign in to comment.