From e25a6d3be9b9ae443dd3e1cd57a8c5912cc088b2 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Tue, 9 Jul 2024 21:21:00 -0400 Subject: Add VITE_IS_LANDING_DEFAULT flag for conditional rendering of landing page --- src/views/components/NavBar.jsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/views/components') diff --git a/src/views/components/NavBar.jsx b/src/views/components/NavBar.jsx index 939c9fd..2da09f5 100644 --- a/src/views/components/NavBar.jsx +++ b/src/views/components/NavBar.jsx @@ -71,12 +71,18 @@ const NavBar = () => { const location = useLocation() // if url has /landing then remove the navbar: if ( - ['/', '/signup', '/login', '/landing', '/forgot-password'].includes( + ['/signup', '/login', '/landing', '/forgot-password'].includes( location.pathname, ) ) { return null } + if ( + location.pathname === '/' && + import.meta.env.VITE_IS_LANDING_DEFAULT === 'true' + ) { + return null + } return (