Skip to content

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

remove LinkAction open control prop

Kha Nguyen787e4c49a44e
diff --git a/apps/web/components/DashboardLinks.tsx b/apps/web/components/DashboardLinks.tsx
index 6cbae5d8..e0b546aa 100644
--- a/apps/web/components/DashboardLinks.tsx
+++ b/apps/web/components/DashboardLinks.tsx
@@ -79,7 +79,6 @@ type Props = {
};
export function Card({ link, editMode, dashboardType }: Props) {
- const [linkDropdownMenuOpen, setLinkDropdownMenuOpen] = useState(false);
const { attributes, listeners, setNodeRef, isDragging } = useDraggable({
id: `${link.id}-${dashboardType}`,
data: {
@@ -256,12 +255,7 @@ export function Card({ link, editMode, dashboardType }: Props) {
collection={collection}
linkModal={linkModal}
setLinkModal={(e) => setLinkModal(e)}
- onLinkDropdownMenuOpen={(e) => setLinkDropdownMenuOpen(e)}
- dropdownMenuOpen={linkDropdownMenuOpen}
- className={cn(
- "absolute top-3 right-3 group-hover:opacity-100 opacity-0 duration-100 text-neutral z-20",
- linkDropdownMenuOpen && "opacity-100"
- )}
+ className="absolute top-3 right-3 group-hover:opacity-100 group-focus-within:opacity-100 opacity-0 duration-100 text-neutral z-20"
/>
{!isPublicRoute && <LinkPin link={link} />}
</div>
diff --git a/apps/web/components/LinkViews/LinkComponents/LinkActions.tsx b/apps/web/components/LinkViews/LinkComponents/LinkActions.tsx
index 03b44ebb..2df5c14b 100644
--- a/apps/web/components/LinkViews/LinkComponents/LinkActions.tsx
+++ b/apps/web/components/LinkViews/LinkComponents/LinkActions.tsx
@@ -29,8 +29,6 @@ type Props = {
className?: string;
setLinkModal: (value: boolean) => void;
ghost?: boolean;
- onLinkDropdownMenuOpen: (value: boolean) => void;
- dropdownMenuOpen: boolean;
};
export default function LinkActions({
@@ -39,8 +37,6 @@ export default function LinkActions({
className,
setLinkModal,
ghost,
- onLinkDropdownMenuOpen,
- dropdownMenuOpen,
}: Props) {
const { t } = useTranslation();
@@ -95,10 +91,7 @@ export default function LinkActions({
<i title="More" className="bi-info-circle text-xl" />
</Button>
) : (
- <DropdownMenu
- open={dropdownMenuOpen}
- onOpenChange={onLinkDropdownMenuOpen}
- >
+ <DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
asChild