mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
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:
1 parent
8bca8dd7dc
commit
6b123dc4c0
5 files changed
+23
-10
No files matched your search
@@ -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";
|
||||
Reference in new issue
Block a user