2021-09-02 19:05:13 -07:00
|
|
|
import { useContext } from 'react';
|
|
|
|
import { AppConfigContext } from '../appConfigContext';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fetch an instance of AppConfig from the React context.
|
|
|
|
*/
|
|
|
|
export function useAppConfig() {
|
|
|
|
return useContext(AppConfigContext);
|
|
|
|
}
|
2023-06-29 17:13:50 -04:00
|
|
|
|
|
|
|
export function useIsShowAcrylInfoEnabled() {
|
|
|
|
const appConfig = useAppConfig();
|
|
|
|
return appConfig.config.featureFlags.showAcrylInfo;
|
|
|
|
}
|
2023-09-18 16:14:33 -04:00
|
|
|
|
|
|
|
export function useIsNestedDomainsEnabled() {
|
|
|
|
const appConfig = useAppConfig();
|
|
|
|
return appConfig.config.featureFlags.nestedDomainsEnabled;
|
|
|
|
}
|
2024-04-16 04:49:21 +05:30
|
|
|
|
|
|
|
export function useBusinessAttributesFlag() {
|
|
|
|
const appConfig = useAppConfig();
|
|
|
|
return appConfig.config.featureFlags.businessAttributeEntityEnabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function useIsAppConfigContextLoaded() {
|
|
|
|
const appConfig = useAppConfig();
|
|
|
|
return appConfig.loaded;
|
|
|
|
}
|
2024-07-19 13:41:18 -04:00
|
|
|
|
2024-08-09 11:02:17 -05:00
|
|
|
export function useIsEditableDatasetNameEnabled() {
|
|
|
|
const appConfig = useAppConfig();
|
|
|
|
return appConfig.config.featureFlags.editableDatasetNameEnabled;
|
|
|
|
}
|
|
|
|
|
2024-07-19 13:41:18 -04:00
|
|
|
export function useIsShowSeparateSiblingsEnabled() {
|
|
|
|
const appConfig = useAppConfig();
|
|
|
|
return appConfig.config.featureFlags.showSeparateSiblings;
|
|
|
|
}
|