diff options
| author | Mohamed Bassem <me@mbassem.com> | 2026-02-08 23:34:06 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-08 23:34:06 +0000 |
| commit | 485e9948b1d6d40df44a781c5133f6698b1f872b (patch) | |
| tree | 5e2680e271dd85f260ae527c77ae35bd47dfbefb /apps/web/components/shared | |
| parent | c8464e303f6e7fba6b88c7f29c0570c2b49a494d (diff) | |
| download | karakeep-485e9948b1d6d40df44a781c5133f6698b1f872b.tar.zst | |
feat: Add drag-and-drop support for bookmarks to lists (#2469)
* feat: add drag and drop bookmark cards into sidebar lists
Co-authored-by: Claude <noreply@anthropic.com>
Diffstat (limited to 'apps/web/components/shared')
| -rw-r--r-- | apps/web/components/shared/sidebar/SidebarItem.tsx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/web/components/shared/sidebar/SidebarItem.tsx b/apps/web/components/shared/sidebar/SidebarItem.tsx index e602a435..eb61d48b 100644 --- a/apps/web/components/shared/sidebar/SidebarItem.tsx +++ b/apps/web/components/shared/sidebar/SidebarItem.tsx @@ -14,6 +14,11 @@ export default function SidebarItem({ style, collapseButton, right = null, + dropHighlight = false, + onDrop, + onDragOver, + onDragEnter, + onDragLeave, }: { name: string; logo: React.ReactNode; @@ -23,6 +28,11 @@ export default function SidebarItem({ linkClassName?: string; right?: React.ReactNode; collapseButton?: React.ReactNode; + dropHighlight?: boolean; + onDrop?: React.DragEventHandler; + onDragOver?: React.DragEventHandler; + onDragEnter?: React.DragEventHandler; + onDragLeave?: React.DragEventHandler; }) { const currentPath = usePathname(); return ( @@ -32,9 +42,14 @@ export default function SidebarItem({ path == currentPath ? "bg-accent/50 text-foreground" : "text-muted-foreground", + dropHighlight && "bg-accent ring-2 ring-primary", className, )} style={style} + onDrop={onDrop} + onDragOver={onDragOver} + onDragEnter={onDragEnter} + onDragLeave={onDragLeave} > <div className="flex-1"> {collapseButton} |
