diff --git a/src/frontend/src/components/buttons/SpotlightButton.tsx b/src/frontend/src/components/buttons/SpotlightButton.tsx new file mode 100644 index 0000000000..c524e0b947 --- /dev/null +++ b/src/frontend/src/components/buttons/SpotlightButton.tsx @@ -0,0 +1,15 @@ +import { t } from '@lingui/macro'; +import { ActionIcon } from '@mantine/core'; +import { spotlight } from '@mantine/spotlight'; +import { IconCommand } from '@tabler/icons-react'; + +/** + * A button which opens the quick command modal + */ +export function SpotlightButton() { + return ( + spotlight.open()} title={t`Open spotlight`}> + + + ); +} diff --git a/src/frontend/src/components/items/MenuLinks.tsx b/src/frontend/src/components/items/MenuLinks.tsx index c75cc565d5..e9e9b10772 100644 --- a/src/frontend/src/components/items/MenuLinks.tsx +++ b/src/frontend/src/components/items/MenuLinks.tsx @@ -16,6 +16,10 @@ export interface MenuLinkItem { docchildren?: React.ReactNode; } +export type menuItemsCollection = { + [key: string]: MenuLinkItem; +}; + function ConditionalDocTooltip({ item, children diff --git a/src/frontend/src/components/nav/Header.tsx b/src/frontend/src/components/nav/Header.tsx index b4f139cfb8..a9505f209e 100644 --- a/src/frontend/src/components/nav/Header.tsx +++ b/src/frontend/src/components/nav/Header.tsx @@ -10,6 +10,7 @@ import { navTabs as mainNavTabs } from '../../defaults/links'; import { ApiEndpoints } from '../../enums/ApiEndpoints'; import { InvenTreeStyle } from '../../globalStyle'; import { apiUrl } from '../../states/ApiState'; +import { SpotlightButton } from '../buttons/SpotlightButton'; import { ScanButton } from '../items/ScanButton'; import { MainMenu } from './MainMenu'; import { NavHoverMenu } from './NavHoverMenu'; @@ -80,6 +81,7 @@ export function Header() { + { export default function LayoutComponent() { const { classes } = InvenTreeStyle(); + const navigate = useNavigate(); + const actions = getActions(navigate); return ( - -
- - - - -