361 create a navigation stack for the command menu (#9995)

Closes https://github.com/twentyhq/core-team-issues/issues/361

- Created navigation stack state
- Created navigation functions inside the `useCommandMenu` hook
- Added tests
This commit is contained in:
Raphaël Bosi
2025-02-04 15:47:43 +01:00
committed by GitHub
parent b2e4d0d04d
commit dfc1bb7c29
5 changed files with 279 additions and 38 deletions

View File

@ -0,0 +1,15 @@
import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';
import { IconComponent, createState } from 'twenty-ui';
export type CommandMenuNavigationStackItem = {
page: CommandMenuPages;
pageTitle?: string;
pageIcon?: IconComponent;
};
export const commandMenuNavigationStackState = createState<
CommandMenuNavigationStackItem[]
>({
key: 'command-menu/commandMenuNavigationStackState',
defaultValue: [],
});