mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-06 21:45:47 +01:00
✨ Add search bar in top bar
This commit is contained in:
@@ -1,11 +1,14 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { createStyles, Header as Head, Group, Drawer, Center } from '@mantine/core';
|
import {
|
||||||
import { useBooleanToggle } from '@mantine/hooks';
|
createStyles,
|
||||||
|
Header as Head,
|
||||||
|
Group,
|
||||||
|
} from '@mantine/core';
|
||||||
import { NextLink } from '@mantine/next';
|
import { NextLink } from '@mantine/next';
|
||||||
import { Logo } from './Logo';
|
import { Logo } from './Logo';
|
||||||
import CalendarComponent from '../modules/calendar/CalendarModule';
|
|
||||||
import { SettingsMenuButton } from '../Settings/SettingsMenu';
|
import { SettingsMenuButton } from '../Settings/SettingsMenu';
|
||||||
import { AddItemShelfButton } from '../AppShelf/AddAppShelfItem';
|
import { AddItemShelfButton } from '../AppShelf/AddAppShelfItem';
|
||||||
|
import SearchBar from '../SearchBar/SearchBar';
|
||||||
|
|
||||||
const HEADER_HEIGHT = 60;
|
const HEADER_HEIGHT = 60;
|
||||||
|
|
||||||
@@ -83,8 +86,7 @@ interface HeaderResponsiveProps {
|
|||||||
links: { link: string; label: string }[];
|
links: { link: string; label: string }[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Header({ links }: HeaderResponsiveProps) {
|
export function Header(props: any) {
|
||||||
const [opened, toggleOpened] = useBooleanToggle(false);
|
|
||||||
const { classes, cx } = useStyles();
|
const { classes, cx } = useStyles();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -94,24 +96,11 @@ export function Header({ links }: HeaderResponsiveProps) {
|
|||||||
<Logo style={{ fontSize: 22 }} />
|
<Logo style={{ fontSize: 22 }} />
|
||||||
</NextLink>
|
</NextLink>
|
||||||
<Group>
|
<Group>
|
||||||
|
<SearchBar />
|
||||||
<SettingsMenuButton />
|
<SettingsMenuButton />
|
||||||
<AddItemShelfButton />
|
<AddItemShelfButton />
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Drawer
|
|
||||||
opened={opened}
|
|
||||||
overlayOpacity={0.55}
|
|
||||||
overlayBlur={3}
|
|
||||||
onClose={() => toggleOpened()}
|
|
||||||
position="right"
|
|
||||||
>
|
|
||||||
{opened ?? (
|
|
||||||
<Center>
|
|
||||||
<CalendarComponent />
|
|
||||||
</Center>
|
|
||||||
)}
|
|
||||||
</Drawer>
|
|
||||||
</Head>
|
</Head>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user