Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion extension/extend-account-console-node/src/PageNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,24 @@ import {
import { PropsWithChildren, MouseEvent as ReactMouseEvent, useState } from "react";
import { useTranslation } from "react-i18next";
import { useHref, useLinkClickHandler } from "react-router-dom";
import { environment } from "./environment";
import { routes } from "./routes";

type NavLinkProps = NavItemProps & {
path?: string;
};

function getFullUrl(path: string) {
return `${new URL(environment.baseUrl).pathname}${path}`;
}

const NavLink = ({
path,
isActive,
children,
onClick,
}: PropsWithChildren<NavLinkProps>) => {
const menuItemPath = path!;
const menuItemPath = getFullUrl(path!) + location.search;
const href = useHref(menuItemPath);
const handleClick = useLinkClickHandler(menuItemPath);

Expand Down