Add search bar in top bar

This commit is contained in:
Aj - Thomas
2022-05-16 13:54:08 +02:00
committed by ajnart
parent 5c8b1c4fc4
commit 22cd5c8b93

View File

@@ -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>
); );
} }