Skip to content

Commit e46a68b

Browse files
authored
Refactor pathname retrieval in Footer component
Replaced useLocation hook with window.location for pathname retrieval. Signed-off-by: Lee Calcote <leecalcote@gmail.com>
1 parent e5d5e6e commit e46a68b

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/sections/General/Footer/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from "react";
22
import { Link } from "gatsby";
33
import { Container, Row, Col } from "../../../reusecore/Layout";
4-
import { useLocation } from "@reach/router";
54
import logo from "../../../assets/images/layer5/layer5-only/svg/layer5-light-bg.svg";
65
import SocialLinksColor from "../../../components/SocialLinks-Color";
76
import Button from "../../../reusecore/Button";
@@ -10,8 +9,7 @@ import bubblesElement from "./images/bubbles-element.svg";
109

1110
const Footer = ({ location: locationProp }) => {
1211
var currentYear = new Date().getFullYear();
13-
const routerLocation = useLocation();
14-
const pathname = locationProp?.pathname || routerLocation?.pathname || "/";
12+
const pathname = locationProp?.pathname || (typeof window !== "undefined" ? window.location.pathname : "/");
1513

1614
const getUrl = (pathname) => {
1715
// remove ".html" that results in live production build

0 commit comments

Comments
 (0)