Page MenuHomePhabricator

[Cashtab] [extension address passing p5] Add detection of Cashtab installation to GetAddress.tsx
ClosedPublic

Authored by bytesofman on Oct 19 2022, 17:51.

Details

Summary

T2550

Depends on D12317

GetAddress component detects if user has Cashtab installed or not. If not, button becomes a link to install Cashtab.

Test Plan
cd web/cashtab-components
npm run storybook

The GetAddress component still displays as a button
Navigate to brave://extensions and disable your Cashtab extension(s)
Refresh the storybook
The GetAddress component button now says "Install Cashtab and refresh"

Diff Detail

Event Timeline

bytesofman updated this revision to Diff 35862.

Remove address from state as it is not yet used

emack requested changes to this revision.Oct 20 2022, 12:09
emack added a subscriber: emack.


When you click on GetAddress whilst the extension is disabled, it initially displays the GetAddress button before taking a little bit too long to switch to the 'Install Cashtab & refresh' button.

This revision now requires changes to proceed.Oct 20 2022, 12:09

Display loading until Cashtab extension status is confirmed


When you click on GetAddress whilst the extension is disabled, it initially displays the GetAddress button before taking a little bit too long to switch to the 'Install Cashtab & refresh' button.

The fix to this is not ideal. However, the component here is designed as a proof of concept / example. Actual implementations will vary depending on the website.

The right way to do this would be to upgrade the entire cashtab-components library to use hooks instead of classes. New task for this in T2756.

Since this is a separate task, I don't think this should hold up this extension feature.

This revision is now accepted and ready to land.Oct 25 2022, 02:25