Skip to content

Commit

Permalink
Merge pull request #2953 from Hyperkid123/disable-pf4
Browse files Browse the repository at this point in the history
use feature flag to remove PF4 styling support from chrome
  • Loading branch information
Hyperkid123 authored Oct 1, 2024
2 parents 02e4e17 + 16c8e5b commit 633b056
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/components/RootApp/PF4Root.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { useEffect } from 'react';
import { useFlag } from '@unleash/proxy-client-react';
import removePf4Styles from '../../utils/removePf4Styles';

const PF4Root = () => {
const removePF4 = useFlag('platform.chrome.disable-pf4');
useEffect(() => {
if (removePF4) {
removePf4Styles();
}
}, [removePF4]);
return null;
};

export default PF4Root;
3 changes: 3 additions & 0 deletions src/components/RootApp/RootApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { activeModuleAtom } from '../../state/atoms/activeModuleAtom';
import { scalprumConfigAtom } from '../../state/atoms/scalprumConfigAtom';
import { isDebuggerEnabledAtom } from '../../state/atoms/debuggerModalatom';
import { addQuickstartToAppAtom, clearQuickstartsAtom, populateQuickstartsAppAtom, quickstartsAtom } from '../../state/atoms/quickstartsAtom';
import PF4Root from './PF4Root';

const NotEntitledModal = lazy(() => import('../NotEntitledModal'));
const Debugger = lazy(() => import('../Debugger'));
Expand Down Expand Up @@ -108,6 +109,8 @@ const RootApp = memo(({ accountId }: { accountId?: string }) => {
<HistoryRouter history={chromeHistory as unknown as HistoryRouterProps['history']}>
<SegmentProvider>
<FeatureFlagsProvider>
{/* until PF 4 is fully removed from build */}
<PF4Root />
{/* <CrossRequestNotifier /> */}
<Suspense fallback={null}>
<NotEntitledModal />
Expand Down

0 comments on commit 633b056

Please sign in to comment.