From 5df94460f669a53e0d6ba699693fa601f78c7e4a Mon Sep 17 00:00:00 2001 From: PranavKeshav24 <127531721+PranavKeshav24@users.noreply.github.com> Date: Sun, 19 May 2024 21:08:13 +0530 Subject: [PATCH] Fixed issues when the page is already in the homepage. --- src/Components/Footer/Footer.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Components/Footer/Footer.jsx b/src/Components/Footer/Footer.jsx index c0d78b5..2a16b5b 100644 --- a/src/Components/Footer/Footer.jsx +++ b/src/Components/Footer/Footer.jsx @@ -4,15 +4,23 @@ import footer_logo from "../Assets/logo_big.png"; import instagram_icon from "../Assets/instagram_icon.png"; import pintester_icon from "../Assets/pintester_icon.png"; import whatsapp_icon from "../Assets/whatsapp_icon.png"; -import { Link } from "react-router-dom"; +import { Link, useLocation } from "react-router-dom"; import { ShopContext } from "../../Context/ShopContext"; const Footer = () => { const { theme } = useContext(ShopContext); + const location = useLocation(); + + const handleLogoClick = () => { + if (location.pathname === "/") { + window.scrollTo({ top: 0, behavior: "smooth" }); + } + }; + return (
ShopNex