Page MenuHomePhabricator

[Cashtab] Improve handling of priceApiError in Send.js
ClosedPublic

Authored by kieran709 on Mar 18 2022, 16:09.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC82937429a224: [Cashtab] Improve handling of priceApiError in Send.js
Summary

Related to task T2315. In Send.js, added checks for priceApiError to grey out send button if priceApiError is true, and another which hides LocaleFormattedValue if priceApiError is true. In EnhancedInputs.js, a disabled prop has been added which is used in Send.js to disable the amount input if priceApiError is true.

Test Plan

cd web/cashtab && npm start
in useWallet.js, introduce a typo into the string to force an error msg
navigate the send tab
in the amount field, select the fiat currency from the dropdown menu
observe that the LocaleFormatted value does not appear
observe that the send button is greyed out
observe that the amount input is disabled

Diff Detail

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

Event Timeline

bytesofman added inline comments.
web/cashtab/src/components/Common/EnhancedInputs.js
206 ↗(On Diff #32847)

Because disabled is already in the inputProps -- this line isn't doing anything. Delete.

web/cashtab/src/components/Send/Send.js
741 ↗(On Diff #32847)

Is this 'disabled' syntax used elsewhere in the app? Or is it in the antd docs?

Not sure where this is coming from.

The line should just be disabled: priceApiError,

This revision now requires changes to proceed.Mar 18 2022, 18:11

responding to review feedback

This revision is now accepted and ready to land.Mar 18 2022, 20:58