Skip to content

Commit 949d346

Browse files
committed
feat: add FolderIcon and Files button to Sidebar component
1 parent 8a938e4 commit 949d346

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

app/src/renderer/src/components/chat/Sidebar.tsx

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ import {
2828
ChevronDown,
2929
ChevronUp,
3030
Globe,
31-
AlarmCheckIcon
31+
AlarmCheckIcon,
32+
FolderIcon
3233
} from 'lucide-react'
3334
import { useMutation } from '@apollo/client'
3435
import { client } from '@renderer/graphql/lib'
@@ -342,6 +343,39 @@ export function Sidebar({ chats, setSidebarOpen, shortcuts, collapsed = false }:
342343
</Tooltip>
343344
</TooltipProvider>
344345

346+
<TooltipProvider>
347+
<Tooltip delayDuration={collapsed ? 300 : 1000}>
348+
<TooltipTrigger asChild>
349+
<Button
350+
variant="ghost"
351+
data-active={location.pathname === '/files'}
352+
className={cn(
353+
'group h-9 transition-all',
354+
collapsed
355+
? 'w-10 p-0 justify-center text-foreground hover:bg-accent [&[data-active=true]]:text-foreground [&[data-active=true]]:bg-accent'
356+
: 'w-full justify-start px-2 text-sidebar-foreground hover:text-sidebar-accent-foreground [&[data-active=true]]:text-sidebar-accent-foreground [&[data-active=true]]:bg-sidebar-accent'
357+
)}
358+
onClick={() => navigate({ to: '/files' })}
359+
>
360+
<FolderIcon
361+
className={cn(
362+
'w-4 h-4 transition-colors duration-100',
363+
collapsed
364+
? 'w-5 h-5 text-foreground/60 group-hover:text-foreground'
365+
: 'text-sidebar-foreground/60 group-hover:text-sidebar-foreground'
366+
)}
367+
/>
368+
{!collapsed && <span className="text-sm">Files</span>}
369+
</Button>
370+
</TooltipTrigger>
371+
{collapsed && (
372+
<TooltipContent side="right" align="center">
373+
<span>Tasks</span>
374+
</TooltipContent>
375+
)}
376+
</Tooltip>
377+
</TooltipProvider>
378+
345379
<TooltipProvider>
346380
<Tooltip delayDuration={collapsed ? 300 : 1000}>
347381
<TooltipTrigger asChild>

0 commit comments

Comments
 (0)