Files
Homarr/src/components/layout/header/Header.tsx

52 lines
1.5 KiB
TypeScript
Raw Normal View History

import { Box, createStyles, Group, Header as Head, useMantineColorScheme } from '@mantine/core';
import { AddItemShelfButton } from '../../AppShelf/AddAppShelfItem';
2022-07-22 13:20:02 +02:00
import DockerMenuButton from '../../../modules/docker/DockerModule';
import SearchBar from '../../../modules/search/SearchModule';
import { SettingsMenuButton } from '../../Settings/SettingsMenu';
import { Logo } from '../Logo';
import { useConfig } from '../../../tools/state';
2022-04-25 00:11:32 +02:00
const useStyles = createStyles((theme) => ({
2022-05-16 15:56:16 +02:00
hide: {
2022-05-16 14:34:01 +02:00
[theme.fn.smallerThan('xs')]: {
2022-04-25 00:11:32 +02:00
display: 'none',
},
},
burger: {
[theme.fn.largerThan('sm')]: {
display: 'none',
},
},
2022-04-25 00:11:32 +02:00
}));
2022-05-16 13:54:08 +02:00
export function Header(props: any) {
const { classes } = useStyles();
const { config } = useConfig();
const { colorScheme } = useMantineColorScheme();
2022-04-25 00:11:32 +02:00
return (
<Head
height="auto"
style={{
background: `rgba(${colorScheme === 'dark' ? '37, 38, 43,' : '255, 255, 255,'} \
${(config.settings.appOpacity || 100) / 100}`,
borderColor: `rgba(${colorScheme === 'dark' ? '37, 38, 43,' : '233, 236, 239,'} \
${(config.settings.appOpacity || 100) / 100}`,
}}
>
<Group p="xs" position="apart">
2022-05-16 15:56:16 +02:00
<Box className={classes.hide}>
<Logo style={{ fontSize: 22 }} />
</Box>
<Group noWrap>
2022-05-16 13:54:08 +02:00
<SearchBar />
<DockerMenuButton />
2022-05-04 07:12:22 +02:00
<SettingsMenuButton />
<AddItemShelfButton />
2022-05-04 07:12:22 +02:00
</Group>
</Group>
2022-04-25 00:11:32 +02:00
</Head>
);
}