HomePhabricator

[Cashtab] Move balance header fiat to its own component

Description

[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)

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D9861

Details

Provenance
Joey King <joseph.roy.king@gmail.com>Authored on Aug 9 2021, 21:25
bytesofmanPushed on Aug 10 2021, 15:37
Reviewer
Restricted Project
Differential Revision
D9861: [Cashtab] Move balance header fiat to its own component
Parents
rABC1f07a6833500: Introduce EraseLastKElementsIf to simplify the node eviction code
Branches
Unknown
Tags
Unknown