mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Added MobileMenuButton component.
This commit is contained in:
parent
d9b08d9491
commit
be5f0494cc
5 changed files with 36 additions and 9 deletions
|
|
@ -1,9 +1,10 @@
|
|||
'use client';
|
||||
import { Grid, Loading, Column, Row } from '@umami/react-zen';
|
||||
import { Grid, Loading, Column, Row, List, ListItem } from '@umami/react-zen';
|
||||
import Script from 'next/script';
|
||||
import { UpdateNotice } from './UpdateNotice';
|
||||
import { SideNav } from '@/app/(main)/SideNav';
|
||||
import { useLoginQuery, useConfig, useNavigation } from '@/components/hooks';
|
||||
import { MobileMenuButton } from '@/components/input/MobileMenuButton';
|
||||
|
||||
export function App({ children }) {
|
||||
const { user, isLoading, error } = useLoginQuery();
|
||||
|
|
@ -29,7 +30,15 @@ export function App({ children }) {
|
|||
|
||||
return (
|
||||
<Grid columns={{ xs: '1fr', lg: 'auto 1fr' }} height="100vh" width="100%" backgroundColor="2">
|
||||
<Row display={{ xs: 'flex', lg: 'none' }} alignItems="center" gap></Row>
|
||||
<Row display={{ xs: 'flex', lg: 'none' }} alignItems="center" gap padding>
|
||||
<MobileMenuButton>
|
||||
<List>
|
||||
<ListItem>Websites</ListItem>
|
||||
<ListItem>Links</ListItem>
|
||||
<ListItem>Pixels</ListItem>
|
||||
</List>
|
||||
</MobileMenuButton>
|
||||
</Row>
|
||||
<Column display={{ xs: 'none', lg: 'flex' }}>
|
||||
<SideNav />
|
||||
</Column>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export function PageHeader({
|
|||
{icon}
|
||||
</Icon>
|
||||
)}
|
||||
{title && <Heading size="4">{title}</Heading>}
|
||||
{title && <Heading size={{ xs: '2', md: '3', lg: '4' }}>{title}</Heading>}
|
||||
</Row>
|
||||
{description && (
|
||||
<Text color="muted" truncate style={{ maxWidth: 600 }} title={description}>
|
||||
|
|
|
|||
18
src/components/input/MobileMenuButton.tsx
Normal file
18
src/components/input/MobileMenuButton.tsx
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { Button, Icon, DialogTrigger, Dialog, Modal } from '@umami/react-zen';
|
||||
import { Menu } from '@/components/icons';
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
export function MobileMenuButton({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<DialogTrigger>
|
||||
<Button>
|
||||
<Icon>
|
||||
<Menu />
|
||||
</Icon>
|
||||
</Button>
|
||||
<Modal position="left" offset="20px">
|
||||
<Dialog variant="sheet">{children}</Dialog>
|
||||
</Modal>
|
||||
</DialogTrigger>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue