Skip to content

Commit

Permalink
chore: set flags from exxternal config
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Flitton <[email protected]>
  • Loading branch information
FrankFlitton committed Jul 25, 2023
1 parent f447ed6 commit ab8b58b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/console/src/basics/FeatureFlags/FeatureFlags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ interface FeatureFlagState {
}

interface FeatureFlagProviderProps {
externalFlags?: { [k: string]: boolean };
children?: React.ReactNode;
}

Expand All @@ -77,6 +78,7 @@ export const FeatureFlagsProvider = (props: FeatureFlagProviderProps) => {
const [flags, setFlags] = useState<FeatureFlagConfig>({
...defaultFlagConfig,
...runtimeConfig,
...props.externalFlags,
});

const setFeatureFlag = useCallback((flag: FeatureFlag, newValue: boolean) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/console/src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const AppComponent: React.FC<AppComponentProps> = (
`${env.HORIZONTAL_LAYOUT}`.trim().toLowerCase() === 'true';

return (
<FeatureFlagsProvider>
<FeatureFlagsProvider externalFlags={props.env}>
<GlobalStyles />
<LocalCacheProvider>
<StylesProvider
Expand Down

0 comments on commit ab8b58b

Please sign in to comment.