Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

feat: add brand to notion page nav

Marc Seitz3ca59f95b65f
diff --git a/components/NotionPage.tsx b/components/NotionPage.tsx
index 40a9542b..921a1e6f 100644
--- a/components/NotionPage.tsx
+++ b/components/NotionPage.tsx
@@ -3,6 +3,8 @@ import { ExtendedRecordMap } from "notion-types";
import { NotionRenderer } from "react-notion-x";
// core styles shared by all of react-notion-x (required)
import "react-notion-x/src/styles.css";
+import Nav from "./view/nav";
+import { Brand } from "@prisma/client";
export const NotionPage = ({
recordMap,
@@ -11,6 +13,7 @@ export const NotionPage = ({
linkId,
documentId,
versionNumber,
+ brand,
}: {
recordMap: ExtendedRecordMap;
rootPageId?: string;
@@ -18,6 +21,7 @@ export const NotionPage = ({
linkId: string;
documentId: string;
versionNumber: number;
+ brand?: Brand;
}) => {
const [pageNumber, setPageNumber] = useState<number>(1); // start on first page
const [maxScrollPercentage, setMaxScrollPercentage] = useState<number>(0);
@@ -108,25 +112,7 @@ export const NotionPage = ({
return (
<>
<div className="bg-white">
- <nav className="bg-black">
- <div className="mx-auto px-2 sm:px-6 lg:px-8">
- <div className="relative flex h-16 items-center justify-between">
- <div className="flex flex-1 items-center justify-center sm:items-stretch sm:justify-start">
- <div className="flex flex-shrink-0 items-center">
- <p className="text-2xl font-bold tracking-tighter text-white">
- Papermark
- </p>
- </div>
- </div>
- <div className="absolute inset-y-0 right-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-6 sm:pr-0">
- <div className="bg-gray-900 text-white rounded-md px-3 py-2 text-sm font-medium">
- {/* <span>{pageNumber}</span>
- <span className="text-gray-400"> / {numPages}</span> */}
- </div>
- </div>
- </div>
- </div>
- </nav>
+ <Nav brand={brand} />
<div>
<NotionRenderer
diff --git a/components/links/link-sheet/index.tsx b/components/links/link-sheet/index.tsx
index 52cab4fe..91d76620 100644
--- a/components/links/link-sheet/index.tsx
+++ b/components/links/link-sheet/index.tsx
@@ -18,9 +18,7 @@ import { mutate } from "swr";
import { Button } from "@/components/ui/button";
import { toast } from "sonner";
import { Label } from "@/components/ui/label";
-import { cn, convertDataUrlToFile, uploadImage } from "@/lib/utils";
-import { UpgradePlanModal } from "@/components/billing/upgrade-plan-modal";
-import Link from "next/link";
+import { convertDataUrlToFile, uploadImage } from "@/lib/utils";
import DomainSection from "./domain-section";
import AllowDownloadSection from "./allow-download-section";
import { useTeam } from "@/context/team-context";
@@ -29,7 +27,6 @@ import AllowNotificationSection from "./allow-notification-section";
import FeedbackSection from "./feedback-section";
import OGSection from "./og-section";
import { ScrollArea } from "@/components/ui/scroll-area";
-import { upload } from "@vercel/blob/client";
export const DEFAULT_LINK_PROPS = {
id: null,
diff --git a/components/view/document-view.tsx b/components/view/document-view.tsx
index 7ef27fc1..0f70b53b 100644
--- a/components/view/document-view.tsx
+++ b/components/view/document-view.tsx
@@ -160,7 +160,12 @@ export default function DocumentView({
return (
<div className="bg-gray-950">
{submitted ? (
- <ViewData link={link} viewData={viewData} notionData={notionData} />
+ <ViewData
+ link={link}
+ viewData={viewData}
+ notionData={notionData}
+ brand={brand}
+ />
) : (
<div className="h-screen flex items-center justify-center">
<LoadingSpinner className="h-20 w-20" />
diff --git a/components/view/nav.tsx b/components/view/nav.tsx
index ab521c57..6b5b5d10 100644
--- a/components/view/nav.tsx
+++ b/components/view/nav.tsx
@@ -14,8 +14,8 @@ export default function Nav({
file,
brand,
}: {
- pageNumber: number;
- numPages: number;
+ pageNumber?: number;
+ numPages?: number;
allowDownload?: boolean;
assistantEnabled?: boolean;
file?: { name: string; url: string };
@@ -99,10 +99,12 @@ export default function Nav({
</Button>
</div>
) : null}
- <div className="bg-gray-900 text-white rounded-md h-10 px-4 py-2 items-center flex text-sm font-medium">
- <span>{pageNumber}</span>
- <span className="text-gray-400"> / {numPages}</span>
- </div>
+ {pageNumber && numPages ? (
+ <div className="bg-gray-900 text-white rounded-md h-10 px-4 py-2 items-center flex text-sm font-medium">
+ <span>{pageNumber}</span>
+ <span className="text-gray-400"> / {numPages}</span>
+ </div>
+ ) : null}
</div>
</div>
</div>
diff --git a/components/view/view-data.tsx b/components/view/view-data.tsx
index 15b4976a..36b8d3a3 100644
--- a/components/view/view-data.tsx
+++ b/components/view/view-data.tsx
@@ -4,11 +4,13 @@ import PagesViewer from "@/components/view/PagesViewer";
import PDFViewer from "@/components/view/PDFViewer";
import { NotionPage } from "@/components/NotionPage";
import { ExtendedRecordMap } from "notion-types";
+import { Brand } from "@prisma/client";
export default function ViewData({
viewData,
link,
notionData,
+ brand,
}: {
viewData: DEFAULT_DOCUMENT_VIEW_TYPE;
link: LinkWithDocument;
@@ -16,6 +18,7 @@ export default function ViewData({
rootNotionPageId: string | null;
recordMap: ExtendedRecordMap | null;
};
+ brand?: Brand;
}) {
const { document } = link;
return notionData?.recordMap ? (
@@ -26,6 +29,7 @@ export default function ViewData({
linkId={link.id}
documentId={document.id}
versionNumber={document.versions[0].versionNumber}
+ brand={brand}
/>
) : viewData.pages ? (
<PagesViewer
@@ -34,7 +38,9 @@ export default function ViewData({
linkId={link.id}
documentId={document.id}
assistantEnabled={document.assistantEnabled}
+ feedbackEnabled={link.enableFeedback!}
versionNumber={document.versions[0].versionNumber}
+ brand={brand}
/>
) : (
<PDFViewer