Redirect from /catalog to last catalog page (#3807)

* Redirect from /catalog to last catalog page

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Cleaning up

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Cleaning up more

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Splitting url params to pass in catalogURL()

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev authored and GitHub committed 2021-09-29 09:04:54 +03:00
1 parent 8bca8dd7dc
commit 6b123dc4c0
5 files changed
+23 -10

No files matched your search

+13
View File
@@ -30,4 +30,17 @@ export const catalogRoute: RouteProps = {
path: "/catalog/:group?/:kind?"
};
export const getPreviousTabUrl = (path: string) => {
const [group, kind] = path.split("/");
return catalogURL({
params: {
group: group || browseCatalogTab,
kind
}
});
};
export const catalogURL = buildURL<CatalogViewRouteParam>(catalogRoute.path);
export const browseCatalogTab = "browse";