Skip to content

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

add portal wrapper component

daniel31x1381a35655e967
diff --git a/components/LinkDetails.tsx b/components/LinkDetails.tsx
index dfccb8e7..da55f838 100644
--- a/components/LinkDetails.tsx
+++ b/components/LinkDetails.tsx
@@ -356,8 +356,8 @@ export default function LinkDetails({
</div>
)}
- {mode === "view" && width < 640 && (
- <div>
+ {mode === "view" && (
+ <div className="sm:hidden">
<br />
<div className="flex gap-1 items-center mb-2">
diff --git a/components/PortalWrapper.tsx b/components/PortalWrapper.tsx
new file mode 100644
index 00000000..1ef6969a
--- /dev/null
+++ b/components/PortalWrapper.tsx
@@ -0,0 +1,17 @@
+import ReactDOM from "react-dom";
+
+function PortalWrapper({
+ children,
+ usePortal,
+}: {
+ children: React.ReactNode;
+ usePortal: boolean;
+}) {
+ if (!usePortal) {
+ return <>{children}</>;
+ }
+
+ return ReactDOM.createPortal(children, document.body);
+}
+
+export default PortalWrapper;
diff --git a/components/Preservation.tsx b/components/Preservation.tsx
index 436fc138..aa5a8f11 100644
--- a/components/Preservation.tsx
+++ b/components/Preservation.tsx
@@ -9,7 +9,6 @@ import { useRouter } from "next/router";
import ReadableView from "@/components/ReadableView";
import clsx from "clsx";
import { formatAvailable } from "@/lib/shared/formatStats";
-import useWindowDimensions from "@/hooks/useWindowDimensions";
import { PreservationSkeleton } from "./Skeletons";
import remToPixels from "@/lib/client/remToPixels";
import { useReducedMotion } from "framer-motion";
@@ -407,7 +406,7 @@ const RenderFormat = ({
<div
style={style}
className={clsx(
- "z-[40] overflow-hidden ease-in-out duration-100",
+ "z-[40] overflow-hidden ease-in-out duration-100 pointer-events-auto",
!isExpanded && "rounded-bl-2xl"
)}
data-ignore-click-away