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)
Sun, Apr 7, 11:08 PM
Unknown Object (File)
Sun, Apr 7, 8:57 PM
Unknown Object (File)
Sun, Apr 7, 12:55 PM
Unknown Object (File)
Sun, Apr 7, 1:25 AM
Unknown Object (File)
Fri, Apr 5, 3:16 PM
Unknown Object (File)
Fri, Apr 5, 12:37 PM
Unknown Object (File)
Fri, Apr 5, 12:13 PM
Unknown Object (File)
Fri, Apr 5, 7:17 AM
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?