Skip to content

Commit 23712db

Browse files
authored
Merge pull request #13568 from TylerAPfledderer/fix/useNav-unused-var
fix(useNav): remove unused `fromPageParameter`
2 parents 9361453 + c352dc0 commit 23712db

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/components/Nav/useNav.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { useRouter } from "next/router"
21
import { useTranslation } from "next-i18next"
32
import { useTheme } from "next-themes"
43
import {
@@ -29,12 +28,9 @@ import { EthereumIcon } from "@/components/icons/EthereumIcon"
2928

3029
import { trackCustomEvent } from "@/lib/utils/matomo"
3130

32-
import { FROM_QUERY } from "@/lib/constants"
33-
3431
import type { NavSections } from "./types"
3532

3633
export const useNav = () => {
37-
const { asPath } = useRouter()
3834
const { isOpen, onToggle } = useDisclosure()
3935
const { t } = useTranslation("common")
4036
const { theme, setTheme } = useTheme()
@@ -472,12 +468,6 @@ export const useNav = () => {
472468
},
473469
}
474470

475-
const splitPath = asPath.split("/")
476-
const fromPageParameter =
477-
splitPath.length > 1 && splitPath[1] !== "languages"
478-
? `?${FROM_QUERY}=/${splitPath.slice(1).join("/")}`
479-
: ""
480-
481471
const toggleColorMode = () => {
482472
setTheme(theme === "dark" ? "light" : "dark")
483473
setColorMode(theme === "dark" ? "light" : "dark")
@@ -489,14 +479,12 @@ export const useNav = () => {
489479
}
490480

491481
const mobileNavProps = {
492-
fromPageParameter,
493482
isOpen,
494483
toggleColorMode,
495484
onToggle,
496485
}
497486

498487
return {
499-
fromPageParameter,
500488
linkSections,
501489
mobileNavProps,
502490
toggleColorMode,

0 commit comments

Comments
 (0)