LandingPage/ImagesTable/Wizard: Remove all insights global calls

This commit replaces all calls to the insights.chrome global with calls
to the useChrome() hook (or the useGetEnvironment() custom hook that
wraps useChrome()).
This commit is contained in:
lucasgarfield 2023-04-26 16:40:54 +02:00 committed by Lucas Garfield
parent ef1d077c2e
commit 7bca4c7438
10 changed files with 55 additions and 98 deletions

View file

@ -1,10 +1,10 @@
import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';
export const useGetEnvironment = () => {
const { isBeta, getEnvironment } = useChrome();
const { isBeta, isProd, getEnvironment } = useChrome();
// Expose beta features in the ephemeral environment
if (isBeta() || getEnvironment() === 'qa') {
return { isBeta: () => true };
return { isBeta: () => true, isProd: isProd };
}
return { isBeta: () => false };
return { isBeta: () => false, isProd: isProd };
};