Skip to content

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

fix(web): show more button on link card while dropdown menu opens

Kha Nguyen5c07687e1a59
diff --git a/apps/web/components/DashboardLinks.tsx b/apps/web/components/DashboardLinks.tsx
index 12a6dc79..eec35303 100644
--- a/apps/web/components/DashboardLinks.tsx
+++ b/apps/web/components/DashboardLinks.tsx
@@ -65,6 +65,7 @@ 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: {
@@ -239,7 +240,12 @@ export function Card({ link, editMode, dashboardType }: Props) {
collection={collection}
linkModal={linkModal}
setLinkModal={(e) => setLinkModal(e)}
- className="absolute top-3 right-3 group-hover:opacity-100 opacity-0 duration-100 text-neutral z-20"
+ 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"
+ )}
/>
{!isPublicRoute && <LinkPin link={link} />}
</div>
diff --git a/apps/web/components/LinkViews/LinkComponents/LinkActions.tsx b/apps/web/components/LinkViews/LinkComponents/LinkActions.tsx
index 2df5c14b..03b44ebb 100644
--- a/apps/web/components/LinkViews/LinkComponents/LinkActions.tsx
+++ b/apps/web/components/LinkViews/LinkComponents/LinkActions.tsx
@@ -29,6 +29,8 @@ type Props = {
className?: string;
setLinkModal: (value: boolean) => void;
ghost?: boolean;
+ onLinkDropdownMenuOpen: (value: boolean) => void;
+ dropdownMenuOpen: boolean;
};
export default function LinkActions({
@@ -37,6 +39,8 @@ export default function LinkActions({
className,
setLinkModal,
ghost,
+ onLinkDropdownMenuOpen,
+ dropdownMenuOpen,
}: Props) {
const { t } = useTranslation();
@@ -91,7 +95,10 @@ export default function LinkActions({
<i title="More" className="bi-info-circle text-xl" />
</Button>
) : (
- <DropdownMenu>
+ <DropdownMenu
+ open={dropdownMenuOpen}
+ onOpenChange={onLinkDropdownMenuOpen}
+ >
<DropdownMenuTrigger asChild>
<Button
asChild
diff --git a/apps/web/components/LinkViews/LinkComponents/LinkPin.tsx b/apps/web/components/LinkViews/LinkComponents/LinkPin.tsx
index 1cd063fa..cc475299 100644
--- a/apps/web/components/LinkViews/LinkComponents/LinkPin.tsx
+++ b/apps/web/components/LinkViews/LinkComponents/LinkPin.tsx
@@ -21,7 +21,7 @@ export default function LinkPin({ link, btnStyle }: Props) {
variant="simple"
size="icon"
className={clsx(
- "absolute top-3 right-[3.25rem] group-hover:opacity-100 group-focus-within:opacity-100 opacity-0 duration-100 text-neutral",
+ "absolute top-3 right-[3.25rem] group-hover:opacity-100 opacity-0 duration-100 text-neutral",
btnStyle
)}
onClick={() => pinLink(link)}