feat(twenty-front/workspace-menu): improve workspace menu (#10642)

New workspace menu
This commit is contained in:
Antoine Moreaux
2025-03-17 16:31:31 +01:00
committed by GitHub
parent 78b3b7edab
commit bda835b9f8
28 changed files with 706 additions and 265 deletions

View File

@ -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 {

View File

@ -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 {