diff --git a/src/app/@modal/(.)paperless/document/[id]/modal.tsx b/src/app/@modal/(.)paperless/document/[id]/modal.tsx index 5176ebe..92051fd 100644 --- a/src/app/@modal/(.)paperless/document/[id]/modal.tsx +++ b/src/app/@modal/(.)paperless/document/[id]/modal.tsx @@ -1,12 +1,12 @@ -'use client'; +"use client"; -import { type ElementRef, useEffect, useRef } from 'react'; -import { useRouter } from 'next/navigation'; -import { createPortal } from 'react-dom'; +import { type ElementRef, useEffect, useRef } from "react"; +import { useRouter } from "next/navigation"; +import { createPortal } from "react-dom"; export function Modal({ children }: { children: React.ReactNode }) { const router = useRouter(); - const dialogRef = useRef>(null); + const dialogRef = useRef>(null); useEffect(() => { if (!dialogRef.current?.open) { @@ -19,12 +19,14 @@ export function Modal({ children }: { children: React.ReactNode }) { } return createPortal( -
- - {children} - -
, - document.getElementById('modal-root')! + + {children} + {/* , + document.getElementById("modal-root")!, ); -} \ No newline at end of file +} diff --git a/src/app/@modal/(.)paperless/document/[id]/page.tsx b/src/app/@modal/(.)paperless/document/[id]/page.tsx index b8fc2d7..d4df65a 100644 --- a/src/app/@modal/(.)paperless/document/[id]/page.tsx +++ b/src/app/@modal/(.)paperless/document/[id]/page.tsx @@ -1,5 +1,14 @@ import DocumentViewer from "@/components/document-viewer"; +import { Modal } from "./modal"; -export default function FullPageDocumentPage({ params }: { params: { id: number } }) { - return ; +export default function FullPageDocumentPage({ + params, +}: { + params: { id: number }; +}) { + return ( + + + + ); } diff --git a/src/app/page.tsx b/src/app/page.tsx index 85dbc69..46affb9 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -16,7 +16,6 @@ export default function HomePage() { to get started.
Or sign in to access the dashboard.
- Button ); diff --git a/src/app/paperless/document/[id]/page.tsx b/src/app/paperless/document/[id]/page.tsx index 7248b50..adb1ef9 100644 --- a/src/app/paperless/document/[id]/page.tsx +++ b/src/app/paperless/document/[id]/page.tsx @@ -1,6 +1,5 @@ import DocumentViewer from "@/components/document-viewer"; -export default function FullPageDocumentPage({ params }: { params: { id: number } }) { - console.log("FULLL PAPGJPIGHEGPIUSHEGPIUWEGHPIWUEGH: " + params.id); +export default function ModalDocumentPage({ params }: { params: { id: number } }) { return ; } diff --git a/src/components/document-viewer.tsx b/src/components/document-viewer.tsx index 8f734f5..4387393 100644 --- a/src/components/document-viewer.tsx +++ b/src/components/document-viewer.tsx @@ -5,9 +5,10 @@ import { getUserData } from "@/app/actions"; import LoadingSpinner from "@/components/loading-spinner"; export default function DocumentViewer(props: { id: number }) { - const [pdfUrl, setPdfUrl] = useState(null); + const [pdfUrl, setPdfUrl] = useState( + "https://pdfobject.com/pdf/sample.pdf", + ); const [loading, setLoading] = useState(true); - console.log("docuement viewer: " + props.id) useEffect(() => { const fetchData = async () => { @@ -55,12 +56,19 @@ export default function DocumentViewer(props: { id: number }) { } return ( - +
+
+ +
+
+ Hello +
+
); } diff --git a/src/components/loading-spinner.tsx b/src/components/loading-spinner.tsx index bbc6cab..5697f40 100644 --- a/src/components/loading-spinner.tsx +++ b/src/components/loading-spinner.tsx @@ -1,12 +1,17 @@ +import { cn } from "@/lib/utils"; import { LoaderCircle } from "lucide-react"; interface LoadingSpinnerProps { - children: React.ReactNode; + children?: React.ReactNode; + className?: string; } -export default function LoadingSpinner({ children }: LoadingSpinnerProps) { +export default function LoadingSpinner({ + children, + className, +}: LoadingSpinnerProps) { return ( -
+
{children}
diff --git a/src/styles/globals.css b/src/styles/globals.css index b0e6fff..1fa2c1c 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -1,76 +1,80 @@ @tailwind base; - @tailwind components; - @tailwind utilities; +@tailwind components; +@tailwind utilities; - @layer base { - :root { - --background: 0 0% 100%; - --foreground: 222.2 84% 4.9%; +@layer base { + :root { + --background: 0 0% 100%; + --foreground: 222.2 84% 4.9%; - --card: 0 0% 100%; - --card-foreground: 222.2 84% 4.9%; + --card: 0 0% 100%; + --card-foreground: 222.2 84% 4.9%; - --popover: 0 0% 100%; - --popover-foreground: 222.2 84% 4.9%; + --popover: 0 0% 100%; + --popover-foreground: 222.2 84% 4.9%; - --primary: 222.2 47.4% 11.2%; - --primary-foreground: 210 40% 98%; + --primary: 222.2 47.4% 11.2%; + --primary-foreground: 210 40% 98%; - --secondary: 210 40% 96.1%; - --secondary-foreground: 222.2 47.4% 11.2%; + --secondary: 210 40% 96.1%; + --secondary-foreground: 222.2 47.4% 11.2%; - --muted: 210 40% 96.1%; - --muted-foreground: 215.4 16.3% 46.9%; + --muted: 210 40% 96.1%; + --muted-foreground: 215.4 16.3% 46.9%; - --accent: 210 40% 96.1%; - --accent-foreground: 222.2 47.4% 11.2%; + --accent: 210 40% 96.1%; + --accent-foreground: 222.2 47.4% 11.2%; - --destructive: 0 84.2% 60.2%; - --destructive-foreground: 210 40% 98%; + --destructive: 0 84.2% 60.2%; + --destructive-foreground: 210 40% 98%; - --border: 214.3 31.8% 91.4%; - --input: 214.3 31.8% 91.4%; - --ring: 222.2 84% 4.9%; + --border: 214.3 31.8% 91.4%; + --input: 214.3 31.8% 91.4%; + --ring: 222.2 84% 4.9%; - --radius: 0.5rem; - } + --radius: 0.5rem; + } - .dark { - --background: 222.2 84% 4.9%; - --foreground: 210 40% 98%; + .dark { + --background: 222.2 84% 4.9%; + --foreground: 210 40% 98%; - --card: 222.2 84% 4.9%; - --card-foreground: 210 40% 98%; + --card: 222.2 84% 4.9%; + --card-foreground: 210 40% 98%; - --popover: 222.2 84% 4.9%; - --popover-foreground: 210 40% 98%; + --popover: 222.2 84% 4.9%; + --popover-foreground: 210 40% 98%; - --primary: 210 40% 98%; - --primary-foreground: 222.2 47.4% 11.2%; + --primary: 210 40% 98%; + --primary-foreground: 222.2 47.4% 11.2%; - --secondary: 217.2 32.6% 17.5%; - --secondary-foreground: 210 40% 98%; + --secondary: 217.2 32.6% 17.5%; + --secondary-foreground: 210 40% 98%; - --muted: 217.2 32.6% 17.5%; - --muted-foreground: 215 20.2% 65.1%; + --muted: 217.2 32.6% 17.5%; + --muted-foreground: 215 20.2% 65.1%; - --accent: 217.2 32.6% 17.5%; - --accent-foreground: 210 40% 98%; + --accent: 217.2 32.6% 17.5%; + --accent-foreground: 210 40% 98%; - --destructive: 0 62.8% 30.6%; - --destructive-foreground: 210 40% 98%; + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 210 40% 98%; - --border: 217.2 32.6% 17.5%; - --input: 217.2 32.6% 17.5%; - --ring: 212.7 26.8% 83.9%; - } + --border: 217.2 32.6% 17.5%; + --input: 217.2 32.6% 17.5%; + --ring: 212.7 26.8% 83.9%; } +} - @layer base { - * { - @apply border-border; - } - body { - @apply bg-background text-foreground; - } - } \ No newline at end of file +@layer base { + * { + @apply border-border; + } + body { + @apply bg-background text-foreground; + } + dialog:modal { + max-width: 100vw; + max-height: 100vh; + } +}