HomePhabricator
Diffusion Comm 0bb06f9eb4c7

[lib] introduce loading logic to useRelationshipPrompt

Description

[lib] introduce loading logic to useRelationshipPrompt

Summary: This diff introduces the loading logic needed for the relationship prompts on both web and native. Initially, I thought about using createLoadingStatusSelector to implement the loading logic; however, the issue with this was that we sometimes show two relationship buttons and using a single createLoadingStatusSelector would cause both button to show loading spinners at the same time even though one button was pressed, which I felt was a bit strange. So I introduced 4 separate loading states (one for each action) and returned those values in this hook to be consumed on both web + native

Test Plan:
At the end of the stack confirmed that the relationship prompt buttons were being disabled + showing some sort of visual indication to the user that the action is loading

Depends on D12651

Reviewers: inka, ashoat

Reviewed By: ashoat

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D12593

Details

Provenance
ginsuAuthored on Wed, Jun 26, 11:23 PM
Reviewer
ashoat
Differential Revision
D12593: [lib] introduce loading logic to useRelationshipPrompt
Parents
rCOMM4577aa80a243: [native] introduce LoadableButton
Branches
Unknown
Tags
Unknown