diff --git a/src/components/ShareButton.tsx b/src/components/ShareButton.tsx index e06c7a6..d9387b7 100644 --- a/src/components/ShareButton.tsx +++ b/src/components/ShareButton.tsx @@ -3,11 +3,11 @@ import React, { useEffect, useState } from "react"; import { Dialog, - DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, + DialogContent, } from "./ui/dialog"; import { Copy } from "lucide-react"; import toast from "react-hot-toast"; @@ -16,25 +16,34 @@ import QR from "./qr"; import { Button } from "./ui/button"; import { usePathname } from "next/navigation"; -export default function ShareButton() { +interface ShareButtonProps { + isFullscreen: boolean; + viewerRef: React.RefObject; +} + +export default function ShareButton({ isFullscreen, viewerRef }: ShareButtonProps) { const [origin, setOrigin] = useState(""); + const pathname = usePathname(); useEffect(() => { - if (typeof window !== "undefined") { - setOrigin(window.location.origin); - } + setOrigin(window.location.origin); }, []); - const pathname = usePathname(); const paperPath = origin + pathname; return ( - - + Share Papers with your friends! @@ -42,21 +51,18 @@ export default function ShareButton() {
- +
); -} +} \ No newline at end of file diff --git a/src/components/newPdfViewer.tsx b/src/components/newPdfViewer.tsx index a2c47ab..634765e 100644 --- a/src/components/newPdfViewer.tsx +++ b/src/components/newPdfViewer.tsx @@ -25,6 +25,7 @@ interface ControlProps { forceMobile?: boolean; isMobile: boolean; isSmall: boolean; + viewerRef: React.RefObject; } interface PdfViewerProps { @@ -57,7 +58,7 @@ function useBreakpoint() { } const Controls = memo(function Controls({documentId, toggleFullscreen, isFullscreen, onDownload, - forceMobile, isMobile, isSmall}: ControlProps) { + forceMobile, isMobile, isSmall, viewerRef}: ControlProps) { const { provides: zoomProv, state: zoomState } = useZoom(documentId); const { provides: scrollProv, state: scrollState } = useScroll(documentId); @@ -127,7 +128,7 @@ const Controls = memo(function Controls({documentId, toggleFullscreen, isFullscr - +