From 34d60bb717d988c24fbbe602a3c62fd6a3204ca9 Mon Sep 17 00:00:00 2001 From: Chrtorres Date: Tue, 19 Mar 2024 10:50:34 -0400 Subject: [PATCH] Corrected lint issues: Unused Varibales --- frontend/src/components/Header.tsx | 40 ++---------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx index b66fa6ddd..764c9e803 100644 --- a/frontend/src/components/Header.tsx +++ b/frontend/src/components/Header.tsx @@ -8,22 +8,15 @@ import { Drawer, ListItem, List, - useMediaQuery, useTheme } from '@mui/material'; -import { - Menu as MenuIcon, - AccountCircle as UserIcon, - ArrowDropDown -} from '@mui/icons-material'; +import { Menu as MenuIcon } from '@mui/icons-material'; import { NavItem } from './NavItem'; -import { useRouteMatch } from 'react-router-dom'; import { useAuthContext } from 'context'; import logo from '../assets/crossfeed.svg'; import { withSearch } from '@elastic/react-search-ui'; import { ContextType } from 'context/SearchProvider'; import { SearchBar } from 'components'; -import { Autocomplete } from '@mui/material'; import { Organization, OrganizationTag } from 'types'; const PREFIX = 'Header'; @@ -101,7 +94,7 @@ const Root = styled('div')(({ theme }) => ({ [`.${classes.mobileNav}`]: { padding: `${theme.spacing(2)} ${theme.spacing()}px` - }, + } })); const GLOBAL_ADMIN = 2; @@ -123,20 +116,11 @@ const HeaderNoCtx: React.FC = (props) => { const history = useHistory(); const location = useLocation(); const { - currentOrganization, - setOrganization, - showAllOrganizations, - setShowAllOrganizations, - setShowMaps, user, logout, apiGet } = useAuthContext(); const [navOpen, setNavOpen] = useState(false); - const [organizations, setOrganizations] = useState< - (Organization | OrganizationTag)[] - >([]); - const [tags, setTags] = useState([]); const theme = useTheme(); let userLevel = 0; @@ -148,26 +132,6 @@ const HeaderNoCtx: React.FC = (props) => { } } - const fetchOrganizations = useCallback(async () => { - try { - const rows = await apiGet('/v2/organizations/'); - let tags: (OrganizationTag | Organization)[] = []; - if (userLevel === GLOBAL_ADMIN) { - tags = await apiGet('/organizations/tags'); - await setTags(tags as OrganizationTag[]); - } - await setOrganizations(tags.concat(rows)); - } catch (e) { - console.log(e); - } - }, [apiGet, setOrganizations, userLevel]); - - React.useEffect(() => { - if (userLevel > 0) { - fetchOrganizations(); - } - }, [fetchOrganizations, userLevel]); - const navItems: NavItemType[] = [ { title: 'Overview',