1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

fix: navigating to extension page

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2020-11-12 22:53:37 +02:00
parent dc983a757c
commit ad01786fc0
2 changed files with 3 additions and 5 deletions

View File

@ -49,7 +49,7 @@ export class LensExtension {
} }
getPageRoute(baseRoute = "") { getPageRoute(baseRoute = "") {
return this.routePrefix + baseRoute; return this.getPageUrl() + baseRoute;
} }
@action @action

View File

@ -5,7 +5,6 @@ import { remote } from "electron"
import type { Cluster } from "../../../main/cluster"; import type { Cluster } from "../../../main/cluster";
import { DragDropContext, Draggable, DraggableProvided, Droppable, DroppableProvided, DropResult } from "react-beautiful-dnd"; import { DragDropContext, Draggable, DraggableProvided, Droppable, DroppableProvided, DropResult } from "react-beautiful-dnd";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { matchPath } from "react-router";
import { _i18n } from "../../i18n"; import { _i18n } from "../../i18n";
import { t, Trans } from "@lingui/macro"; import { t, Trans } from "@lingui/macro";
import { userStore } from "../../../common/user-store"; import { userStore } from "../../../common/user-store";
@ -15,7 +14,7 @@ import { ClusterIcon } from "../cluster-icon";
import { Icon } from "../icon"; import { Icon } from "../icon";
import { autobind, cssNames, IClassName } from "../../utils"; import { autobind, cssNames, IClassName } from "../../utils";
import { Badge } from "../badge"; import { Badge } from "../badge";
import { navigate, navigation } from "../../navigation"; import { isActiveRoute, navigate } from "../../navigation";
import { addClusterURL } from "../+add-cluster"; import { addClusterURL } from "../+add-cluster";
import { clusterSettingsURL } from "../+cluster-settings"; import { clusterSettingsURL } from "../+cluster-settings";
import { landingURL } from "../+landing-page"; import { landingURL } from "../+landing-page";
@ -153,12 +152,11 @@ export class ClustersMenu extends React.Component<Props> {
const registeredPage = globalPageRegistry.getById(menuItemId); const registeredPage = globalPageRegistry.getById(menuItemId);
if (!registeredPage) return; if (!registeredPage) return;
const { routePath, exact } = registeredPage; const { routePath, exact } = registeredPage;
const isActive = !!matchPath(navigation.location.pathname, { path: routePath, exact });
return ( return (
<Icon <Icon
key={routePath} key={routePath}
tooltip={title} tooltip={title}
active={isActive} active={isActiveRoute({ path: routePath, exact })}
onClick={() => navigate(url)} onClick={() => navigate(url)}
/> />
) )