hamburger nav on all touch devices, add eruda for debugging
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,8 @@ import { useState } from 'react';
|
||||
import { Link, useLocation } from 'react-router';
|
||||
import { Menu } from 'lucide-react';
|
||||
import { Sheet, SheetContent, SheetHeader, SheetTitle } from '@/components/ui/sheet';
|
||||
import { useIsMobile } from 'hooks/useIsMobile';
|
||||
import type { DockItem } from '../Dock';
|
||||
import { useIsTouch } from '../useIsTouch';
|
||||
import { UserMenu } from './UserMenu';
|
||||
|
||||
type HeaderProps = {
|
||||
@@ -12,7 +12,7 @@ type HeaderProps = {
|
||||
|
||||
export function Header({ dockItems }: HeaderProps) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const isMobile = useIsMobile();
|
||||
const isTouch = useIsTouch();
|
||||
const location = useLocation();
|
||||
|
||||
const isActive = (to: string) => (to === '/' ? location.pathname === '/' : location.pathname.startsWith(to));
|
||||
@@ -24,7 +24,7 @@ export function Header({ dockItems }: HeaderProps) {
|
||||
style={{ backgroundColor: 'rgba(255, 255, 255, 0.25)', borderColor: 'rgba(255, 255, 255, 0.35)' }}
|
||||
>
|
||||
<div className="flex items-center gap-2">
|
||||
{isMobile && dockItems && (
|
||||
{isTouch && dockItems && (
|
||||
<button onClick={() => setOpen(true)} className="p-1.5 rounded-md hover:bg-white/20 transition-colors">
|
||||
<Menu className="h-5 w-5 text-white" />
|
||||
</button>
|
||||
@@ -41,7 +41,7 @@ export function Header({ dockItems }: HeaderProps) {
|
||||
<UserMenu />
|
||||
</div>
|
||||
|
||||
{isMobile && dockItems && (
|
||||
{isTouch && dockItems && (
|
||||
<Sheet open={open} onOpenChange={setOpen}>
|
||||
<SheetContent side="left">
|
||||
<SheetHeader>
|
||||
|
||||
Reference in New Issue
Block a user