refactor: use useRouterHelper (#1422)

Co-authored-by: himself65 <himself65@outlook.com>
This commit is contained in:
sheben
2023-03-09 06:58:20 +08:00
committed by GitHub
parent 7f77619515
commit 8dc022c808
10 changed files with 68 additions and 106 deletions

View File

@@ -24,6 +24,19 @@ export function useRouterHelper(router: NextRouter) {
},
});
},
jumpToPublicWorkspacePage: (
workspaceId: string,
pageId: string,
logic: RouteLogic = RouteLogic.PUSH
) => {
return router[logic]({
pathname: `/public-workspace/[workspaceId]/[pageId]`,
query: {
workspaceId,
pageId,
},
});
},
jumpToSubPath: (
workspaceId: string,
subPath: WorkspaceSubPath,