From 232f8dedb5f2a90e0784d40739e2f6f3e0823377 Mon Sep 17 00:00:00 2001 From: Akalanka Perera Date: Wed, 21 Aug 2024 20:00:18 +0530 Subject: [PATCH] Refactor: used routes from constants --- src/components/layout/header.jsx | 5 +++-- src/constants/index.js | 1 + src/constants/routes.js | 3 ++- src/routes/index.jsx | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/layout/header.jsx b/src/components/layout/header.jsx index 05b5e9b..f6c1bb0 100644 --- a/src/components/layout/header.jsx +++ b/src/components/layout/header.jsx @@ -4,7 +4,7 @@ import { Link } from "react-router-dom"; import { useLocation } from "react-router-dom"; import { twMerge } from "tailwind-merge"; import { portalURL } from "@/constants"; -import { hallOfFame } from "@/constants/routes"; +import { HALL_OF_FAME } from "@/constants/routes"; import { useBreakpoint } from "@/hooks"; import { BashawayLeaderboard } from "@/icons"; import { AnimatedSwitcher, Button } from "@sliit-foss/bashaway-ui/components"; @@ -19,9 +19,10 @@ const Header = ({ className }) => { const [mobileNavOpen, setMobileNavOpen] = useState(false); const breakpoints = useBreakpoint(); + const { pathname } = useLocation(); - const isHallOfFame = pathname === hallOfFame; + const isHallOfFame = pathname === HALL_OF_FAME; return (
{ @@ -7,8 +8,8 @@ const AnimatedRoutes = () => { return ( - } /> - } /> + } /> + } /> } />