Page MenuHomePhabricator

[landing/lib/native] introduce FarcasterWebView
ClosedPublic

Authored by ginsu on Mar 27 2024, 9:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 9:45 PM
Unknown Object (File)
Tue, Nov 26, 7:47 PM
Unknown Object (File)
Thu, Nov 21, 11:19 PM
Unknown Object (File)
Wed, Nov 13, 12:46 AM
Unknown Object (File)
Tue, Nov 12, 10:55 PM
Unknown Object (File)
Fri, Nov 8, 10:25 AM
Unknown Object (File)
Thu, Nov 7, 10:42 PM
Unknown Object (File)
Thu, Nov 7, 10:16 PM
Subscribers

Details

Summary

This component will be used to talk to BASE_LANDING_URL/connect-farcaster route that was just introduced prior in this stack. Based on the FarcasterWebViewMessage type this webview will either redirect the user to the farcaster app if they have it, safari with a link to download the app if they don't have farcaster, or return the user's fid to the onSuccess callback if the farcaster user data is returned back to the webview

Also in this diff I snuck in factoring out some shared types into their own file rather than copying + pasting the same type across different files

Depends on D11429

Test Plan

Tested the entire sign in flow during the hackathon

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu requested review of this revision.Mar 27 2024, 9:44 PM

Some notes inline

native/components/farcaster-web-view.react.js
45 ↗(On Diff #38415)

Can memoize this

49 ↗(On Diff #38415)

Can def memoize this since it's static

55 ↗(On Diff #38415)

Why do we need the <></> wrapping webView here?

Could we just return webView?

This revision is now accepted and ready to land.Mar 28 2024, 5:57 AM
native/components/farcaster-web-view.react.js
59–65 ↗(On Diff #38415)

Do we really need both of these styles?