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