Skip to content

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

full width expanded mode

daniel31x13c3873b030f9f
diff --git a/components/LinkDetails.tsx b/components/LinkDetails.tsx
index ad6e5526..f0d21843 100644
--- a/components/LinkDetails.tsx
+++ b/components/LinkDetails.tsx
@@ -194,21 +194,23 @@ export default function LinkDetails({
<div className={clsx(className)}>
<div
className={clsx(
- standalone &&
- "sm:border sm:border-neutral-content sm:rounded-2xl sm:overflow-auto",
- width >= 640 && "flex h-[80vh]"
+ standalone && "sm:flex h-screen w-screen",
+ !standalone && "sm:flex sm:h-[80vh]"
)}
>
{width >= 640 && (
<div className="w-1/2 lg:w-2/3 overflow-y-auto">
- {link.id && <Preservation link={link} />}
+ {link.id && (
+ <Preservation link={link} standalone={standalone || false} />
+ )}
</div>
)}
<div className={clsx(width >= 640 && "w-1/2 lg:w-1/3 overflow-y-auto")}>
<div
className={clsx(
- "overflow-hidden select-none relative group/banner h-40 opacity-80 rounded-t-2xl sm:rounded-tr-2xl sm:rounded-tl-none -mt-5 sm:mt-0",
- !standalone && "-mx-5 sm:mx-0"
+ "overflow-hidden select-none relative group/banner h-40 opacity-80 -mt-5 sm:mt-0",
+ !standalone &&
+ "-mx-5 sm:mx-0 rounded-t-2xl sm:rounded-tr-2xl sm:rounded-tl-none"
)}
>
{formatAvailable(link, "preview") ? (
diff --git a/components/Preservation/Preservation.tsx b/components/Preservation/Preservation.tsx
index ab76a1b2..83148815 100644
--- a/components/Preservation/Preservation.tsx
+++ b/components/Preservation/Preservation.tsx
@@ -18,7 +18,7 @@ export default function Preservation({
standalone,
}: {
link: LinkIncludingShortenedCollectionAndTags;
- standalone?: boolean;
+ standalone: boolean;
}) {
const { t } = useTranslation();
const router = useRouter();
@@ -214,6 +214,7 @@ export default function Preservation({
link={link}
format={format}
isExpanded={isExpanded}
+ standalone={standalone}
containerRef={containerRef}
setIsExpanded={setIsExpanded}
/>
@@ -229,12 +230,14 @@ const RenderFormat = ({
link,
format,
isExpanded,
+ standalone,
containerRef,
setIsExpanded,
}: {
link: LinkIncludingShortenedCollectionAndTags;
format: ArchivedFormat;
isExpanded: boolean;
+ standalone: boolean;
containerRef: React.RefObject<HTMLDivElement>;
setIsExpanded: (expanded: boolean) => void;
}) => {
@@ -313,6 +316,7 @@ const RenderFormat = ({
link={link}
format={format}
isExpanded={isExpanded}
+ standalone={standalone}
/>
{isExpanded && (
<div
diff --git a/components/Preservation/PreservationContent.tsx b/components/Preservation/PreservationContent.tsx
index 82b9462d..5b1e429e 100644
--- a/components/Preservation/PreservationContent.tsx
+++ b/components/Preservation/PreservationContent.tsx
@@ -11,12 +11,14 @@ type Props = {
format: ArchivedFormat;
isExpanded: boolean;
link?: LinkIncludingShortenedCollectionAndTags;
+ standalone?: boolean;
};
export const PreservationContent: React.FC<Props> = ({
link,
format,
isExpanded,
+ standalone,
}) => {
const [pdfLoaded, setPdfLoaded] = useState(false);
const [monolithLoaded, setMonolithLoaded] = useState(false);
@@ -52,7 +54,11 @@ export const PreservationContent: React.FC<Props> = ({
className={clsx(
"w-full border-none",
monolithLoaded ? "block" : "hidden",
- isExpanded ? "h-full" : "h-[calc(80vh-3.75rem)]"
+ isExpanded
+ ? "h-full"
+ : standalone
+ ? "h-[calc(100vh-3.75rem)]"
+ : "h-[calc(80vh-3.75rem)]"
)}
onLoad={() => setMonolithLoaded(true)}
/>
@@ -67,7 +73,11 @@ export const PreservationContent: React.FC<Props> = ({
className={clsx(
"w-full border-none",
pdfLoaded ? "block" : "hidden",
- isExpanded ? "h-full" : "h-[calc(80vh-3.75rem)]"
+ isExpanded
+ ? "h-full"
+ : standalone
+ ? "h-[calc(100vh-3.75rem)]"
+ : "h-[calc(80vh-3.75rem)]"
)}
onLoad={() => setPdfLoaded(true)}
/>
diff --git a/pages/links/[id].tsx b/pages/links/[id].tsx
index 85bce1f8..6d43b8c0 100644
--- a/pages/links/[id].tsx
+++ b/pages/links/[id].tsx
@@ -19,11 +19,7 @@ const Index = () => {
return (
<div className="flex h-screen">
{getLink.data ? (
- <LinkDetails
- activeLink={getLink.data}
- className="sm:w-[80vw] sm:h-[80vh] sm:m-auto w-screen"
- standalone
- />
+ <LinkDetails activeLink={getLink.data} standalone />
) : (
<div className="sm:max-w-3xl p-5 m-auto w-full flex flex-col items-center gap-5">
<div className="w-20 h-20 skeleton rounded-xl"></div>