mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-17 18:51:14 +01:00
✨ Re-add burger menu on mobile
This commit is contained in:
@@ -103,6 +103,8 @@ export const MainLayout = ({ children }: MainLayoutProps) => {
|
|||||||
<IconSettings2 size="1rem" />
|
<IconSettings2 size="1rem" />
|
||||||
</ThemeIcon>
|
</ThemeIcon>
|
||||||
}
|
}
|
||||||
|
component={Link}
|
||||||
|
href="/manage/preferences"
|
||||||
/>
|
/>
|
||||||
<NavLink
|
<NavLink
|
||||||
label="Help"
|
label="Help"
|
||||||
@@ -139,6 +141,9 @@ export const MainLayout = ({ children }: MainLayoutProps) => {
|
|||||||
</NavLink>
|
</NavLink>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const burgerMenu = screenLargerThanMd ? undefined : <Burger opened={burgerMenuOpen} onClick={toggleBurgerMenu} />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<CommonHeader />
|
<CommonHeader />
|
||||||
@@ -155,7 +160,13 @@ export const MainLayout = ({ children }: MainLayoutProps) => {
|
|||||||
</Navbar.Section>
|
</Navbar.Section>
|
||||||
</Navbar>
|
</Navbar>
|
||||||
}
|
}
|
||||||
header={<MainHeader showExperimental logoHref="/manage" />}
|
header={
|
||||||
|
<MainHeader
|
||||||
|
showExperimental
|
||||||
|
logoHref="/manage"
|
||||||
|
leftIcon={burgerMenu}
|
||||||
|
/>
|
||||||
|
}
|
||||||
footer={
|
footer={
|
||||||
<Footer height={25}>
|
<Footer height={25}>
|
||||||
<Group position="apart" px="md">
|
<Group position="apart" px="md">
|
||||||
|
|||||||
@@ -12,12 +12,14 @@ type MainHeaderProps = {
|
|||||||
logoHref?: string;
|
logoHref?: string;
|
||||||
showExperimental?: boolean;
|
showExperimental?: boolean;
|
||||||
headerActions?: React.ReactNode;
|
headerActions?: React.ReactNode;
|
||||||
|
leftIcon?: React.ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MainHeader = ({
|
export const MainHeader = ({
|
||||||
showExperimental = false,
|
showExperimental = false,
|
||||||
logoHref = '/',
|
logoHref = '/',
|
||||||
headerActions,
|
headerActions,
|
||||||
|
leftIcon
|
||||||
}: MainHeaderProps) => {
|
}: MainHeaderProps) => {
|
||||||
const { breakpoints } = useMantineTheme();
|
const { breakpoints } = useMantineTheme();
|
||||||
const isSmallerThanMd = useMediaQuery(`(max-width: ${breakpoints.sm})`);
|
const isSmallerThanMd = useMediaQuery(`(max-width: ${breakpoints.sm})`);
|
||||||
@@ -28,9 +30,12 @@ export const MainHeader = ({
|
|||||||
<Header height={headerHeight} pb="sm" pt={0}>
|
<Header height={headerHeight} pb="sm" pt={0}>
|
||||||
<ExperimentalHeaderNote visible={showExperimental} height={experimentalHeaderNoteHeight} />
|
<ExperimentalHeaderNote visible={showExperimental} height={experimentalHeaderNoteHeight} />
|
||||||
<Group spacing="xl" mt="xs" px="md" position="apart" noWrap>
|
<Group spacing="xl" mt="xs" px="md" position="apart" noWrap>
|
||||||
<UnstyledButton component={Link} href={logoHref} style={{ flex: 1 }}>
|
<Group noWrap>
|
||||||
<Logo />
|
{leftIcon}
|
||||||
</UnstyledButton>
|
<UnstyledButton component={Link} href={logoHref} style={{ flex: 1 }}>
|
||||||
|
<Logo />
|
||||||
|
</UnstyledButton>
|
||||||
|
</Group>
|
||||||
|
|
||||||
<Search />
|
<Search />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user