Page MenuHomePhabricator

D6948.diff
No OneTemporary

D6948.diff

diff --git a/native/components/feature-flags-provider.react.js b/native/components/feature-flags-provider.react.js
new file mode 100644
--- /dev/null
+++ b/native/components/feature-flags-provider.react.js
@@ -0,0 +1,34 @@
+// @flow
+
+import * as React from 'react';
+
+type FeatureFlagsConfiguration = {
+ +[feature: string]: boolean,
+};
+
+type FeatureFlagsContextType = {
+ +configuration: FeatureFlagsConfiguration,
+ +loaded: boolean,
+};
+
+const defaultContext = {
+ configuration: {},
+ loaded: false,
+};
+
+const FeatureFlagsContext: React.Context<FeatureFlagsContextType> =
+ React.createContext<FeatureFlagsContextType>(defaultContext);
+
+type Props = {
+ +children: React.Node,
+};
+function FeatureFlagsProvider(props: Props): React.Node {
+ const { children } = props;
+ return (
+ <FeatureFlagsContext.Provider value={defaultContext}>
+ {children}
+ </FeatureFlagsContext.Provider>
+ );
+}
+
+export { FeatureFlagsContext, FeatureFlagsProvider };
diff --git a/native/root.react.js b/native/root.react.js
--- a/native/root.react.js
+++ b/native/root.react.js
@@ -22,6 +22,7 @@
import { actionLogger } from 'lib/utils/action-logger.js';
import ChatContextProvider from './chat/chat-context-provider.react.js';
+import { FeatureFlagsProvider } from './components/feature-flags-provider.react.js';
import PersistedStateGate from './components/persisted-state-gate.js';
import ConnectedStatusBar from './connected-status-bar.react.js';
import { SQLiteDataHandler } from './data/sqlite-data-handler.js';
@@ -245,35 +246,37 @@
return (
<GestureHandlerRootView style={styles.app}>
<StaffContextProvider>
- <NavContext.Provider value={navContext}>
- <RootContext.Provider value={rootContext}>
- <InputStateContainer>
- <SafeAreaProvider initialMetrics={initialWindowMetrics}>
- <ActionSheetProvider>
- <ENSCacheProvider provider={provider}>
- <MarkdownContextProvider>
- <ChatContextProvider>
- <SQLiteDataHandler />
- <ConnectedStatusBar />
- <ReduxPersistGate persistor={getPersistor()}>
- {gated}
- </ReduxPersistGate>
- <PersistedStateGate>
- <Socket
- detectUnsupervisedBackgroundRef={
- detectUnsupervisedBackgroundRef
- }
- />
- </PersistedStateGate>
- {navigation}
- </ChatContextProvider>
- </MarkdownContextProvider>
- </ENSCacheProvider>
- </ActionSheetProvider>
- </SafeAreaProvider>
- </InputStateContainer>
- </RootContext.Provider>
- </NavContext.Provider>
+ <FeatureFlagsProvider>
+ <NavContext.Provider value={navContext}>
+ <RootContext.Provider value={rootContext}>
+ <InputStateContainer>
+ <SafeAreaProvider initialMetrics={initialWindowMetrics}>
+ <ActionSheetProvider>
+ <ENSCacheProvider provider={provider}>
+ <MarkdownContextProvider>
+ <ChatContextProvider>
+ <SQLiteDataHandler />
+ <ConnectedStatusBar />
+ <ReduxPersistGate persistor={getPersistor()}>
+ {gated}
+ </ReduxPersistGate>
+ <PersistedStateGate>
+ <Socket
+ detectUnsupervisedBackgroundRef={
+ detectUnsupervisedBackgroundRef
+ }
+ />
+ </PersistedStateGate>
+ {navigation}
+ </ChatContextProvider>
+ </MarkdownContextProvider>
+ </ENSCacheProvider>
+ </ActionSheetProvider>
+ </SafeAreaProvider>
+ </InputStateContainer>
+ </RootContext.Provider>
+ </NavContext.Provider>
+ </FeatureFlagsProvider>
</StaffContextProvider>
</GestureHandlerRootView>
);

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 5:10 PM (3 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2612482
Default Alt Text
D6948.diff (4 KB)

Event Timeline