Skip to content

Commit

Permalink
Fixes 5048: Hide global filter bar (#390)
Browse files Browse the repository at this point in the history
App: Hide global filter bar

This change is borrowed from Image Builder's frontend:
https://github.com/osbuild/image-builder-frontend/blob/4a893e10baa0500136e9be98b15645d908b8f0b7/src/App.tsx#L14
  • Loading branch information
ochosi authored Nov 25, 2024
1 parent a0f3037 commit 642890a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@redhat-cloud-services/frontend-components-utilities/styles/_all';
import 'react18-json-view/src/style.css';
import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';
import NotificationsPortal from '@redhat-cloud-services/frontend-components-notifications/NotificationPortal';
import { Bullseye, Spinner } from '@patternfly/react-core';
import { useEffect, useMemo, useState } from 'react';
Expand All @@ -19,6 +20,7 @@ export default function App() {
const storedPerPage = Number(localStorage.getItem(perPageKey)) || 20;
const { pathname } = useLocation();
const pageSafe = usePageSafe();
const { hideGlobalFilter } = useChrome();

const isDefaultRoute = useMemo(
() => last(pathname.split('/')) === REPOSITORIES_ROUTE,
Expand All @@ -42,6 +44,11 @@ export default function App() {
isDefaultRoute && zeroState, // We only check if the route is correct and zerostate is true (defaults to true)
);

// Hide Insights' global filter bar
useEffect(() => {
hideGlobalFilter(true);
}, [hideGlobalFilter]);

// Check for user's custom repositories to determine whether we need to show zero state
useEffect(() => {
// Zero state may be true AND a user may have repositories if they have signed in via a different machine for the first time
Expand Down

0 comments on commit 642890a

Please sign in to comment.