mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Move all RouteParam's and URL builders to src/common (#2778)
- Prevents some circular dependencies - Allowed main to use them as needed Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
540c6dac37
commit
5ee2ab5b4a
134 files changed
+462
-515
No files matched your search
@@ -22,9 +22,9 @@
|
||||
import type { LocationDescriptor } from "history";
|
||||
import { createPath } from "history";
|
||||
import { matchPath, RouteProps } from "react-router";
|
||||
import { PageParam, PageParamInit } from "./page-param";
|
||||
import { clusterViewRoute, IClusterViewRouteParams } from "../components/cluster-manager/cluster-view.route";
|
||||
import { navigation } from "./history";
|
||||
import { ClusterViewRouteParams, clusterViewRoute } from "../../common/routes";
|
||||
import { PageParam, PageParamInit } from "./page-param";
|
||||
|
||||
export function navigate(location: LocationDescriptor) {
|
||||
const currentLocation = createPath(navigation.location);
|
||||
@@ -51,7 +51,7 @@ export function isActiveRoute(route: string | string[] | RouteProps): boolean {
|
||||
}
|
||||
|
||||
export function getMatchedClusterId(): string {
|
||||
const matched = matchPath<IClusterViewRouteParams>(navigation.location.pathname, {
|
||||
const matched = matchPath<ClusterViewRouteParams>(navigation.location.pathname, {
|
||||
exact: true,
|
||||
path: clusterViewRoute.path
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user