[Cashtab] Add support for multiple fiat currencies
Summary:
MVP implementation for multiple fiat currencies. Some parts of the app had been written assuming hardcoded USD only support, and these had to be refactored.
Overview
- Convert fiat price API fetch from ongoing interval to named interval stored in state that can be cleared
- Add new settings parameter to local storage. For now, only fiat currency is here. Going forward this is extensible for other app settings.
- Add function changeCashtabSettings to useWallet.js to update app settings (and lock UI until update is complete)
- Add a select menu to Configure.js to update currencies
- Replace 'USD' with '!== XEC' in comparisons that were checking for fiat or crypto
Test Plan:
- npm start
- Navigate to settings screen and change currency
- Verify that displayed balance and currency symbol have updated when navigate back to Home or Send
- Send a tx in a non-USD currency
- Switch currencies several times and verify balance and currency symbol update
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D9829