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:
Sebastian Malton authored and GitHub committed 2021-06-10 08:52:09 -04:00
1 parent 540c6dac37
commit 5ee2ab5b4a
134 files changed
+462 -515

No files matched your search

+3 -3
View File
@@ -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
});