From 3134e8c1cf3f9ca39212065cad952d9e47baadc5 Mon Sep 17 00:00:00 2001 From: rahulkeswani101 Date: Mon, 29 Jul 2024 11:42:55 +0530 Subject: [PATCH] feat: removed top nav from new alerts landing page (#5538) * feat: removed top nav from new alerts landing page * feat: added new function to check new alerts landing page --------- Co-authored-by: Vikrant Gupta --- frontend/src/container/TopNav/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/container/TopNav/index.tsx b/frontend/src/container/TopNav/index.tsx index 5277908240..8219395568 100644 --- a/frontend/src/container/TopNav/index.tsx +++ b/frontend/src/container/TopNav/index.tsx @@ -31,7 +31,14 @@ function TopNav(): JSX.Element | null { [location.pathname], ); - if (isSignUpPage || isDisabled || isRouteToSkip) { + const isNewAlertsLandingPage = useMemo( + () => + matchPath(location.pathname, { path: ROUTES.ALERTS_NEW, exact: true }) && + !location.search, + [location.pathname, location.search], + ); + + if (isSignUpPage || isDisabled || isRouteToSkip || isNewAlertsLandingPage) { return null; }