feat(twenty-front/workspace-menu): improve workspace menu (#10642)
New workspace menu
This commit is contained in:
@ -4,8 +4,8 @@
|
||||
import { useDebouncedCallback } from 'use-debounce';
|
||||
|
||||
export const useRedirect = () => {
|
||||
const redirect = useDebouncedCallback((url: string) => {
|
||||
window.location.href = url;
|
||||
const redirect = useDebouncedCallback((url: string, target?: string) => {
|
||||
window.open(url, target ?? '_self');
|
||||
}, 1);
|
||||
|
||||
return {
|
||||
|
||||
@ -12,9 +12,10 @@ export const useRedirectToWorkspaceDomain = () => {
|
||||
baseUrl: string,
|
||||
pathname?: string,
|
||||
searchParams?: Record<string, string | boolean>,
|
||||
target?: string,
|
||||
) => {
|
||||
if (!isMultiWorkspaceEnabled) return;
|
||||
redirect(buildWorkspaceUrl(baseUrl, pathname, searchParams));
|
||||
redirect(buildWorkspaceUrl(baseUrl, pathname, searchParams), target);
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user