datahub/datahub-web-react/src/app/useAppConfig.ts

15 lines
378 B
TypeScript
Raw Normal View History

import { useContext } from 'react';
import { AppConfigContext } from '../appConfigContext';
/**
* Fetch an instance of AppConfig from the React context.
*/
export function useAppConfig() {
return useContext(AppConfigContext);
}
export function useIsShowAcrylInfoEnabled() {
const appConfig = useAppConfig();
return appConfig.config.featureFlags.showAcrylInfo;
}