Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

minor fix

daniel31x13d0cf95173123
diff --git a/apps/web/components/CollectionListing.tsx b/apps/web/components/CollectionListing.tsx
index dee61ad3..e2ee1ae2 100644
--- a/apps/web/components/CollectionListing.tsx
+++ b/apps/web/components/CollectionListing.tsx
@@ -24,12 +24,14 @@ import Icon from "./Icon";
import { IconWeight } from "@phosphor-icons/react";
import Droppable from "./Droppable";
import { cn } from "@linkwarden/lib";
+import { Active, useDndContext } from "@dnd-kit/core";
interface ExtendedTreeItem extends TreeItem {
data: Collection;
}
const CollectionListing = () => {
+ const { active: droppableActive } = useDndContext();
const { t } = useTranslation();
const updateCollection = useUpdateCollection();
const { data: collections = [], isLoading } = useCollections();
@@ -278,7 +280,9 @@ const CollectionListing = () => {
return (
<Tree
tree={tree}
- renderItem={(itemProps) => renderItem({ ...itemProps }, currentPath)}
+ renderItem={(itemProps) =>
+ renderItem({ ...itemProps }, currentPath, droppableActive)
+ }
onExpand={onExpand}
onCollapse={onCollapse}
onDragEnd={onDragEnd}
@@ -292,7 +296,8 @@ export default CollectionListing;
const renderItem = (
{ item, onExpand, onCollapse, provided }: RenderItemParams,
- currentPath: string
+ currentPath: string,
+ droppableActive: Active | null
) => {
const collection = item.data;
@@ -315,7 +320,9 @@ const renderItem = (
className={cn(
currentPath === `/collections/${collection.id}`
? "bg-primary/20 is-active"
- : "group-[&:not([data-over])]:hover:bg-neutral/20",
+ : droppableActive
+ ? "select-none"
+ : "hover:bg-neutral/20",
"duration-100 flex gap-1 items-center pr-2 pl-1 rounded-md"
)}
>
diff --git a/apps/web/components/Droppable.tsx b/apps/web/components/Droppable.tsx
index bbfbcb8d..b1520e52 100644
--- a/apps/web/components/Droppable.tsx
+++ b/apps/web/components/Droppable.tsx
@@ -28,17 +28,15 @@ const Droppable = ({
data,
});
- const extraProps = isOver ? { "data-over": "" } : {};
return (
<div
ref={setNodeRef}
className={cn(
isOver &&
"bg-primary/10 outline-2 outline-dashed outline-primary rounded-lg",
- "transition-colors duration-200",
className
)}
- {...extraProps}
+ data-over={isOver ? "true" : undefined}
style={{
position: "relative",
zIndex: isOver ? 1 : "auto",
diff --git a/apps/web/components/TagListing.tsx b/apps/web/components/TagListing.tsx
index 7a287aa1..5be097c4 100644
--- a/apps/web/components/TagListing.tsx
+++ b/apps/web/components/TagListing.tsx
@@ -3,13 +3,16 @@ import Link from "next/link";
import { useTranslation } from "react-i18next";
import Droppable from "./Droppable";
import { cn } from "@linkwarden/lib";
+import { useDndContext } from "@dnd-kit/core";
interface TagListingProps {
tags: Tag[];
active?: string;
}
export function TagListing({ tags, active }: TagListingProps) {
+ const { active: droppableActive } = useDndContext();
const { t } = useTranslation();
+
if (!tags[0]) {
return (
<div
@@ -39,7 +42,9 @@ export function TagListing({ tags, active }: TagListingProps) {
className={cn(
active === `/tags/${e.id}`
? "bg-primary/20"
- : "group-[&:not([data-over])]:hover:bg-neutral/20",
+ : droppableActive
+ ? "select-none"
+ : "hover:bg-neutral/20",
"duration-100 py-1 px-2 cursor-pointer flex items-center gap-2 w-full rounded-md h-8"
)}
>