This commit replaces all calls to the insights.chrome global with calls to the useChrome() hook (or the useGetEnvironment() custom hook that wraps useChrome()).
10 lines
392 B
JavaScript
10 lines
392 B
JavaScript
import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';
|
|
|
|
export const useGetEnvironment = () => {
|
|
const { isBeta, isProd, getEnvironment } = useChrome();
|
|
// Expose beta features in the ephemeral environment
|
|
if (isBeta() || getEnvironment() === 'qa') {
|
|
return { isBeta: () => true, isProd: isProd };
|
|
}
|
|
return { isBeta: () => false, isProd: isProd };
|
|
};
|