Page MenuHomePhabricator

[native] flip farcaster prompt based on fid prop instead of context
ClosedPublic

Authored by ginsu on Apr 9 2024, 9:59 AM.
Tags
None
Referenced Files
F1778503: D11597.diff
Fri, May 17, 1:59 PM
Unknown Object (File)
Apr 16 2024, 12:09 PM
Unknown Object (File)
Apr 15 2024, 7:07 PM
Unknown Object (File)
Apr 15 2024, 6:20 PM
Unknown Object (File)
Apr 14 2024, 9:28 AM
Unknown Object (File)
Apr 13 2024, 2:46 PM
Unknown Object (File)
Apr 13 2024, 7:29 AM
Unknown Object (File)
Apr 12 2024, 9:13 AM
Subscribers

Details

Summary

When reusing the FarcasterPrompt component in the connect farcaster bottom sheet I run into the issue that when the bottom sheet closes the FarcasterPrompt displays the disconnected text since the fid is now set. To give me more control of when the FarcasterPrompt displays the disconnect text I changed the condition to be based on a prop rather than the context

Depends on D11561

Test Plan

Confirmed that the FarcasterPrompt component has no regressions in the registration flow + farcaster account settings + connect farcaster bottom sheet

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu requested review of this revision.Apr 9 2024, 10:15 AM
This revision is now accepted and ready to land.Apr 9 2024, 10:23 PM
native/profile/farcaster-account-settings.react.js
27

Since the prop is based on the FID in the context, won't the same effect still happen?

native/profile/farcaster-account-settings.react.js
27

Yes it is intentional to have the same effect for FarcasterAccountSettings.

We do want FarcasterAccountSettings to be able to show both the connect + the disconnect text; however, for the registration flow + the connect farcaster bottom sheet we only want to show the connect text and this is why FarcasterPrompt only passes the showDisconnectText

native/profile/farcaster-account-settings.react.js
27

Ah, got it – for FarcasterAccountSettings we want the FarcasterPrompt to flip as soon as the request succeeds

native/profile/farcaster-account-settings.react.js
27

Yes I felt that would be reasonable, but lmk if you disagree or think there is a better way to handle this