Page MenuHomePhabricator

[Cashtab] Move balance header fiat to its own component
ClosedPublic

Authored by bytesofman on Aug 9 2021, 21:30.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC25bb30df5522: [Cashtab] Move balance header fiat to its own component
Summary

BalanceHeaderFiat gradually became a complex component as more features were added to Cashtab, i.e. support for multiple fiat currencies. As it became more complicated, this additions were added everywhere the component appeared (Send.js, Wallet.js, Tokens.js).

Better practice is to keep this type of component in one place and then import it where it is used. That way, you only have to edit things in one place.

This diff does that. While I was at it, I couldn't resist also displaying the fiat currency as a locale string (i.e. with commas for americans, spaces for others) -- since this is also a task and some currencies generate very large numbers.

T1691 T1692

Test Plan

npm start and verify that the balance in fiat on the Send, Tokens, and Wallet screens matches what is displayed at cashtabapp.com (but with commas or spaces for larger #s)

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable