refactor: remove NoSsr on top level (#1951)

This commit is contained in:
Himself65
2023-04-14 17:07:41 -05:00
committed by GitHub
parent 43a96fe8e3
commit 2383165470
27 changed files with 211 additions and 133 deletions
+21
View File
@@ -25,6 +25,26 @@ export function useRouterHelper(router: NextRouter) {
},
[router]
);
const jumpToWorkspace = useCallback(
(workspaceId: string, logic: RouteLogic = RouteLogic.PUSH) => {
if (router.pathname === '/workspace/[workspaceId]/[pageId]') {
return router[logic]({
pathname: `/workspace/[workspaceId]`,
query: {
workspaceId: workspaceId,
},
});
} else {
return router[logic]({
pathname: router.pathname,
query: {
workspaceId: workspaceId,
},
});
}
},
[router]
);
const jumpToPublicWorkspacePage = useCallback(
(
workspaceId: string,
@@ -71,6 +91,7 @@ export function useRouterHelper(router: NextRouter) {
return {
jumpToPage,
jumpToWorkspace,
jumpToPublicWorkspacePage,
jumpToSubPath,
openPage,