Skip to content

Commit

Permalink
It might be working, but the internet is too slow to properly test it
Browse files Browse the repository at this point in the history
  • Loading branch information
aamirazad committed Jun 27, 2024
1 parent ad8702a commit 1078b50
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 15 deletions.
5 changes: 2 additions & 3 deletions src/app/@modal/(.)paperless/document/[id]/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ export function Modal({ children }: { children: React.ReactNode }) {
return createPortal(
<dialog
ref={dialogRef}
className="absolute h-screen w-screen bg-black/90"
className="absolute h-screen w-screen bg-zinc-900/60"
onClose={onDismiss}
>
{children}
{/* <button onClick={onDismiss} className="close-button" /> */}
<div className="p-20">{children}</div>
</dialog>,
document.getElementById("modal-root")!,
);
Expand Down
2 changes: 2 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import OpenLinkInNewPage from "@/components/open-link-in-new-page";
import Link from "next/link";

export default function HomePage() {
return (
Expand All @@ -16,6 +17,7 @@ export default function HomePage() {
</div>
<div>Or sign in to access the dashboard.</div>
</div>
<Link href="/paperless/document/259">button</Link>
</main>
);
}
36 changes: 24 additions & 12 deletions src/components/document-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
import { useState, useEffect } from "react";
import { getPaperlessDocument } from "@/app/actions";
import LoadingSpinner from "@/components/loading-spinner";
import { Button } from "./ui/button";
import { useRouter } from "next/navigation";

export default function DocumentViewer(props: { id: number }) {
const router = useRouter();

const [pdfUrl, setPdfUrl] = useState<string | null>(null);
const [loading, setLoading] = useState(true);

Expand Down Expand Up @@ -36,18 +40,26 @@ export default function DocumentViewer(props: { id: number }) {
}

return (
<div className="flex h-full w-screen min-w-0 justify-center text-white">
<div className="flex-shrink flex-grow">
<embed
src={pdfUrl}
className=""
type="application/pdf"
width="100%"
height="100%"
/>
</div>
<div className="flex h-full w-56 flex-shrink-0 flex-col border-l">
Hello
<div className="flex h-screen w-full min-w-0 justify-center text-white">
<div className="flex h-4/5 w-1/2 justify-center gap-16">
<div className="flex-shrink flex-grow">
<embed
src={pdfUrl}
className=""
type="application/pdf"
width="100%"
height="100%"
/>
</div>
<div className="flex flex-shrink-0 flex-col">
<Button
onClick={() => {
router.back();
}}
>
Back
</Button>
</div>
</div>
</div>
);
Expand Down

0 comments on commit 1078b50

Please sign in to comment.