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 = + React.createContext(defaultContext); + +type Props = { + +children: React.Node, +}; +function FeatureFlagsProvider(props: Props): React.Node { + const { children } = props; + return ( + + {children} + + ); +} + +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 ( - - - - - - - - - - - - {gated} - - - - - {navigation} - - - - - - - - + + + + + + + + + + + + + {gated} + + + + + {navigation} + + + + + + + + + );