mobile: add explicit close button to nav drawer
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { NavLink, useLocation, useNavigate } from 'react-router-dom';
|
import { NavLink, useLocation, useNavigate } from 'react-router-dom';
|
||||||
import { ChevronRight, ExternalLink, Folder, MessageSquare, Plus, Settings as SettingsIcon } from 'lucide-react';
|
import { ChevronRight, ExternalLink, Folder, MessageSquare, Plus, Settings as SettingsIcon, X } from 'lucide-react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { sessionEvents } from '@/hooks/sessionEvents';
|
import { sessionEvents } from '@/hooks/sessionEvents';
|
||||||
@@ -221,9 +221,21 @@ export function ProjectSidebar() {
|
|||||||
<NavLink to="/" className="font-semibold tracking-tight text-base">
|
<NavLink to="/" className="font-semibold tracking-tight text-base">
|
||||||
BooCode
|
BooCode
|
||||||
</NavLink>
|
</NavLink>
|
||||||
<Button size="icon-sm" variant="ghost" onClick={() => setAddOpen(true)} aria-label="Add project">
|
<div className="flex items-center gap-1">
|
||||||
<Plus />
|
<Button size="icon-sm" variant="ghost" onClick={() => setAddOpen(true)} aria-label="Add project">
|
||||||
</Button>
|
<Plus />
|
||||||
|
</Button>
|
||||||
|
{isMobile && (
|
||||||
|
<Button
|
||||||
|
size="icon-sm"
|
||||||
|
variant="ghost"
|
||||||
|
onClick={() => setDrawerOpen(false)}
|
||||||
|
aria-label="Close sidebar"
|
||||||
|
>
|
||||||
|
<X />
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{isMobile && (pull.pullDist > 0 || pull.refreshing) && (
|
{isMobile && (pull.pullDist > 0 || pull.refreshing) && (
|
||||||
|
|||||||
Reference in New Issue
Block a user