From a4ae49d4106a916e46a7b2362b8a811e20fe4562 Mon Sep 17 00:00:00 2001 From: Santhoshkumar R Date: Sat, 29 Apr 2023 14:22:42 +0530 Subject: [PATCH] WEB-413 - External broken links - fix --- src/components/Footer.jsx | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx index a097fee..ce08ecd 100644 --- a/src/components/Footer.jsx +++ b/src/components/Footer.jsx @@ -2,29 +2,16 @@ import React, { Component } from 'react'; import './Footer.scss'; import SubscribeButton from "../components/SubscribeButton" import FeedbackButtons from "../components/FeedbackButtons" +import { useLocation } from "@reach/router"; -class Footer extends Component { - constructor(props) { - super(props); - - this.state = { - pathRoute: '' - }; - } - - componentDidMount() { - this.setState({ - pathRoute: window.location.pathname.slice(0, -1), - }); - } - - render() { - const { pathRoute } = this.state; - return ( - <> - - -
+const Footer = ()=> { + const { pathname } = useLocation(); + const pathRoute = pathname.slice(0, -1); + return ( + <> + + +
); } -} + export default Footer;