Page MenuHomePhabricator

D11425.id38437.diff
No OneTemporary

D11425.id38437.diff

diff --git a/lib/components/fid-provider.react.js b/lib/components/fid-provider.react.js
new file mode 100644
--- /dev/null
+++ b/lib/components/fid-provider.react.js
@@ -0,0 +1,26 @@
+// @flow
+
+import * as React from 'react';
+
+type FIDContextType = {
+ +setFID: string => void,
+ +fid: ?string,
+};
+
+const FIDContext: React.Context<?FIDContextType> =
+ React.createContext<?FIDContextType>();
+
+type Props = {
+ +children: React.Node,
+};
+function FIDProvider(props: Props): React.Node {
+ const [fid, setFID] = React.useState<?string>();
+
+ const context = React.useMemo(() => ({ fid, setFID }), [fid]);
+
+ return (
+ <FIDContext.Provider value={context}>{props.children}</FIDContext.Provider>
+ );
+}
+
+export { FIDContext, FIDProvider };
diff --git a/native/root.react.js b/native/root.react.js
--- a/native/root.react.js
+++ b/native/root.react.js
@@ -27,6 +27,7 @@
import { EditUserAvatarProvider } from 'lib/components/edit-user-avatar-provider.react.js';
import { ENSCacheProvider } from 'lib/components/ens-cache-provider.react.js';
import { FarcasterDataHandler } from 'lib/components/farcaster-data-handler.react.js';
+import { FIDProvider } from 'lib/components/fid-provider.react.js';
import IntegrityHandler from 'lib/components/integrity-handler.react.js';
import KeyserverConnectionsHandler from 'lib/components/keyserver-connections-handler.js';
import { MediaCacheProvider } from 'lib/components/media-cache-provider.react.js';
@@ -314,42 +315,44 @@
<ActionSheetProvider>
<ENSCacheProvider provider={provider}>
<NeynarClientProvider apiKey={neynarKey}>
- <MediaCacheProvider
- persistence={filesystemMediaCache}
- >
- <EditUserAvatarProvider>
- <NativeEditThreadAvatarProvider>
- <MarkdownContextProvider>
- <MessageSearchProvider>
- <BottomSheetProvider>
- <RegistrationContextProvider>
- <SQLiteDataHandler />
- <ConnectedStatusBar />
- <ReduxPersistGate
- persistor={getPersistor()}
- >
- {gated}
- </ReduxPersistGate>
- <PersistedStateGate>
- <KeyserverConnectionsHandler
- socketComponent={Socket}
- detectUnsupervisedBackgroundRef={
- detectUnsupervisedBackgroundRef
- }
- />
- <VersionSupportedChecker />
- <PrekeysHandler />
- <ReportHandler />
- <FarcasterDataHandler />
- </PersistedStateGate>
- {navigation}
- </RegistrationContextProvider>
- </BottomSheetProvider>
- </MessageSearchProvider>
- </MarkdownContextProvider>
- </NativeEditThreadAvatarProvider>
- </EditUserAvatarProvider>
- </MediaCacheProvider>
+ <FIDProvider>
+ <MediaCacheProvider
+ persistence={filesystemMediaCache}
+ >
+ <EditUserAvatarProvider>
+ <NativeEditThreadAvatarProvider>
+ <MarkdownContextProvider>
+ <MessageSearchProvider>
+ <BottomSheetProvider>
+ <RegistrationContextProvider>
+ <SQLiteDataHandler />
+ <ConnectedStatusBar />
+ <ReduxPersistGate
+ persistor={getPersistor()}
+ >
+ {gated}
+ </ReduxPersistGate>
+ <PersistedStateGate>
+ <KeyserverConnectionsHandler
+ socketComponent={Socket}
+ detectUnsupervisedBackgroundRef={
+ detectUnsupervisedBackgroundRef
+ }
+ />
+ <VersionSupportedChecker />
+ <PrekeysHandler />
+ <ReportHandler />
+ <FarcasterDataHandler />
+ </PersistedStateGate>
+ {navigation}
+ </RegistrationContextProvider>
+ </BottomSheetProvider>
+ </MessageSearchProvider>
+ </MarkdownContextProvider>
+ </NativeEditThreadAvatarProvider>
+ </EditUserAvatarProvider>
+ </MediaCacheProvider>
+ </FIDProvider>
</NeynarClientProvider>
</ENSCacheProvider>
</ActionSheetProvider>

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 9, 11:11 PM (12 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2831142
Default Alt Text
D11425.id38437.diff (6 KB)

Event Timeline