From 5e828bf1746975e5f0d8a9a71bdef0b3fa30261b Mon Sep 17 00:00:00 2001 From: Mohmn <37132584+Mohmn@users.noreply.github.com> Date: Thu, 2 Dec 2021 19:04:13 +0530 Subject: [PATCH] fix(FE): removed time filter from settings page #374 (#385) * fix(FE): removed time filter from settings page #374 * declared an array consisting of routes,in which we won't have to render time filter component Co-authored-by: Mohmin2 --- frontend/src/container/Header/index.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/src/container/Header/index.tsx b/frontend/src/container/Header/index.tsx index ef6359f075..4b37763aaf 100644 --- a/frontend/src/container/Header/index.tsx +++ b/frontend/src/container/Header/index.tsx @@ -2,12 +2,17 @@ import { Col } from 'antd'; import ROUTES from 'constants/routes'; import history from 'lib/history'; import React from 'react'; +import { useLocation } from 'react-router-dom'; import ShowBreadcrumbs from './Breadcrumbs'; import DateTimeSelector from './DateTimeSelection'; import { Container } from './styles'; +const routesToSkip = [ROUTES.SETTINGS]; + const TopNav = (): JSX.Element | null => { + const { pathname } = useLocation(); + if (history.location.pathname === ROUTES.SIGN_UP) { return null; } @@ -18,9 +23,11 @@ const TopNav = (): JSX.Element | null => { - - - + {!routesToSkip.includes(pathname) && ( + + + + )} ); };