diff --git a/src/app/(main)/App.tsx b/src/app/(main)/App.tsx index ee95850b..16676523 100644 --- a/src/app/(main)/App.tsx +++ b/src/app/(main)/App.tsx @@ -1,10 +1,10 @@ 'use client'; -import { Grid, Loading, Column, Row, List, ListItem } from '@umami/react-zen'; +import { Grid, Loading, Column, Row } 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'; +import { MobileNav } from '@/app/(main)/MobileNav'; export function App({ children }) { const { user, isLoading, error } = useLoginQuery(); @@ -29,15 +29,9 @@ export function App({ children }) { } return ( - - - - - Websites - Links - Pixels - - + + + diff --git a/src/app/(main)/MobileNav.tsx b/src/app/(main)/MobileNav.tsx new file mode 100644 index 00000000..9e5565c0 --- /dev/null +++ b/src/app/(main)/MobileNav.tsx @@ -0,0 +1,77 @@ +import { + Row, + Dialog, + DialogTrigger, + Button, + Icon, + Modal, + NavMenu, + NavMenuItem, + IconLabel, + Text, + Grid, +} from '@umami/react-zen'; +import { Globe, Grid2x2, LinkIcon, Menu } from '@/components/icons'; +import { useMessages, useNavigation } from '@/components/hooks'; +import Link from 'next/link'; +import { WebsiteNav } from '@/app/(main)/websites/[websiteId]/WebsiteNav'; +import { Logo } from '@/components/svg'; + +export function MobileNav() { + const { formatMessage, labels } = useMessages(); + const { websiteId } = useNavigation(); + + const links = [ + { + id: 'websites', + label: formatMessage(labels.websites), + path: '/websites', + icon: , + }, + { + id: 'links', + label: formatMessage(labels.links), + path: '/links', + icon: , + }, + { + id: 'pixels', + label: formatMessage(labels.pixels), + path: '/pixels', + icon: , + }, + ]; + + return ( + + + + + + + {links.map(link => { + return ( + + + + + + ); + })} + + {websiteId && } + + + + + } style={{ width: 'auto' }}> + umami + + + + ); +} diff --git a/src/app/(main)/websites/[websiteId]/WebsiteLayout.tsx b/src/app/(main)/websites/[websiteId]/WebsiteLayout.tsx index d357c6a3..c92bbd9c 100644 --- a/src/app/(main)/websites/[websiteId]/WebsiteLayout.tsx +++ b/src/app/(main)/websites/[websiteId]/WebsiteLayout.tsx @@ -12,6 +12,7 @@ export function WebsiteLayout({ websiteId, children }: { websiteId: string; chil - - - {children} - - - ); -} diff --git a/src/components/input/WebsiteSelect.tsx b/src/components/input/WebsiteSelect.tsx index 01861fbd..29ae040b 100644 --- a/src/components/input/WebsiteSelect.tsx +++ b/src/components/input/WebsiteSelect.tsx @@ -1,6 +1,11 @@ import { useState } from 'react'; import { Select, SelectProps, ListItem, Text, Row } from '@umami/react-zen'; -import { useUserWebsitesQuery, useMessages, useLoginQuery, useWebsite } from '@/components/hooks'; +import { + useUserWebsitesQuery, + useMessages, + useLoginQuery, + useWebsiteQuery, +} from '@/components/hooks'; import { Empty } from '@/components/common/Empty'; export function WebsiteSelect({ @@ -15,7 +20,7 @@ export function WebsiteSelect({ includeTeams?: boolean; } & SelectProps) { const { formatMessage, messages } = useMessages(); - const website = useWebsite(); + const { data: website } = useWebsiteQuery(websiteId); const [name, setName] = useState(website?.name); const [search, setSearch] = useState(''); const { user } = useLoginQuery();