Navbar customization v2 (#18026)
Adds color support for navigation menu items. --------- Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Co-authored-by: Devessier <baptiste@devessier.fr> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
+4
-2
@@ -1,10 +1,10 @@
|
||||
import { v4 } from 'uuid';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { v4 } from 'uuid';
|
||||
import type { NavigationMenuItem } from '~/generated-metadata/graphql';
|
||||
|
||||
import { navigationMenuItemsDraftState } from '@/navigation-menu-item/states/navigationMenuItemsDraftState';
|
||||
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
|
||||
import { computeInsertIndexAndPosition } from '@/navigation-menu-item/utils/computeInsertIndexAndPosition';
|
||||
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
|
||||
|
||||
export const useAddViewToNavigationMenuDraft = () => {
|
||||
const setNavigationMenuItemsDraft = useSetAtomState(
|
||||
@@ -16,6 +16,7 @@ export const useAddViewToNavigationMenuDraft = () => {
|
||||
currentDraft: NavigationMenuItem[],
|
||||
targetFolderId?: string | null,
|
||||
targetIndex?: number,
|
||||
color?: string | null,
|
||||
): string => {
|
||||
const folderId = targetFolderId ?? null;
|
||||
|
||||
@@ -44,6 +45,7 @@ export const useAddViewToNavigationMenuDraft = () => {
|
||||
folderId: folderId ?? undefined,
|
||||
name: undefined,
|
||||
applicationId: undefined,
|
||||
color,
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user