Merge pull request #519 from ajnart/feature/spotlight-search-bar

This commit is contained in:
Thomas Camlong
2022-11-29 21:10:05 +09:00
committed by GitHub
6 changed files with 210 additions and 220 deletions

View File

@@ -9,7 +9,7 @@ export function Logo({ style, withoutText }: any) {
const { primaryColor, secondaryColor } = useColorTheme();
return (
<Group spacing="xs">
<Group spacing="xs" noWrap>
<Image
width={50}
src={config.settings.logo || '/imgs/logo/logo.png'}

View File

@@ -1,27 +1,16 @@
import { Box, createStyles, Group, Header as Head, useMantineColorScheme } from '@mantine/core';
import { Group, Header as Head, useMantineColorScheme, useMantineTheme } from '@mantine/core';
import { useViewportSize } from '@mantine/hooks';
import { AddItemShelfButton } from '../../AppShelf/AddAppShelfItem';
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';
const useStyles = createStyles((theme) => ({
hide: {
[theme.fn.smallerThan('xs')]: {
display: 'none',
},
},
burger: {
[theme.fn.largerThan('sm')]: {
display: 'none',
},
},
}));
import { SearchModuleComponent } from '../../../modules/search/SearchModule';
export function Header(props: any) {
const { classes } = useStyles();
const { width } = useViewportSize();
const MIN_WIDTH_MOBILE = useMantineTheme().breakpoints.xs;
const { config } = useConfig();
const { colorScheme } = useMantineColorScheme();
@@ -35,12 +24,10 @@ export function Header(props: any) {
${(config.settings.appOpacity || 100) / 100}`,
}}
>
<Group p="xs" position="apart">
<Box className={classes.hide}>
<Logo style={{ fontSize: 22 }} />
</Box>
<Group noWrap>
<SearchBar />
<Group p="xs" noWrap grow>
{width > MIN_WIDTH_MOBILE && <Logo style={{ fontSize: 22 }} />}
<Group position="right" noWrap>
<SearchModuleComponent />
<DockerMenuButton />
<SettingsMenuButton />
<AddItemShelfButton />