Skip to content

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

Add light mode (#44)

Marc Seitzd73881e5b892
diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx
index 90c0f872..830d935e 100644
--- a/components/Sidebar.tsx
+++ b/components/Sidebar.tsx
@@ -7,8 +7,9 @@ import {
} from "@heroicons/react/20/solid";
import { FolderIcon, HomeIcon, XMarkIcon, ChartBarIcon } from "@heroicons/react/24/outline";
import Link from "next/link";
-import { classNames } from "@/lib/utils";
+import { classNames, cn } from "@/lib/utils";
import { useRouter } from "next/router";
+import { ModeToggle } from "./theme-toggle";
export default function Sidebar() {
const { data: session } = useSession();
@@ -56,7 +57,7 @@ export default function Sidebar() {
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
- <div className="fixed inset-0 bg-gray-900/80" />
+ <div className="fixed inset-0 bg-background/80" />
</Transition.Child>
<div className="fixed inset-0 flex">
@@ -87,16 +88,16 @@ export default function Sidebar() {
>
<span className="sr-only">Close sidebar</span>
<XMarkIcon
- className="h-6 w-6 text-white"
+ className="h-6 w-6 text-foreground"
aria-hidden="true"
/>
</button>
</div>
</Transition.Child>
- {/* Sidebar component, swap this element with another sidebar if you like */}
- <div className="flex grow flex-col gap-y-5 overflow-y-auto bg-gray-900 px-6 ring-1 ring-white/10">
+ {/* Sidebar for mobile component, swap this element with another sidebar if you like */}
+ <div className="flex grow flex-col gap-y-5 overflow-y-auto bg-gray-50 dark:bg-black px-6 ring-1 ring-foreground/10">
<div className="flex h-16 shrink-0 items-center">
- <p className="text-2xl font-bold tracking-tighter text-white">
+ <p className="text-2xl font-bold tracking-tighter text-black dark:text-white">
Papermark
</p>
</div>
@@ -108,16 +109,16 @@ export default function Sidebar() {
<li key={item.name}>
<button
onClick={() => router.push(item.href)}
- className={classNames(
+ className={cn(
item.current
- ? "bg-gray-800 text-white"
- : "text-gray-400 hover:text-white hover:bg-gray-800",
- "group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold w-full disabled:hover:bg-inherit disabled:text-gray-400 disabled:cursor-default"
+ ? "bg-gray-200 dark:bg-secondary text-secondary-foreground font-semibold"
+ : "text-muted-foreground hover:text-foreground hover:bg-gray-200 hover:dark:bg-muted",
+ "group flex gap-x-3 items-center rounded-md p-2 text-sm leading-6 w-full disabled:hover:bg-transparent disabled:text-muted-foreground disabled:cursor-default"
)}
disabled={item.disabled}
>
<item.icon
- className="h-6 w-6 shrink-0"
+ className="h-5 w-5 shrink-0"
aria-hidden="true"
/>
{item.name}
@@ -138,9 +139,9 @@ export default function Sidebar() {
{/* Static sidebar for desktop */}
<div className="hidden lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-72 lg:flex-col">
{/* Sidebar component, swap this element with another sidebar if you like */}
- <div className="flex grow flex-col gap-y-5 overflow-y-auto bg-black/10 px-6">
+ <div className="flex grow flex-col gap-y-5 overflow-y-auto bg-gray-50 dark:bg-black px-6">
<div className="flex h-16 shrink-0 items-center">
- <p className="text-2xl font-bold tracking-tighter text-white">
+ <p className="text-2xl font-bold tracking-tighter text-black dark:text-white">
Papermark
</p>
</div>
@@ -152,11 +153,11 @@ export default function Sidebar() {
<li key={item.name}>
<button
onClick={() => router.push(item.href)}
- className={classNames(
+ className={cn(
item.current
- ? "bg-gray-800 text-white font-semibold"
- : "text-gray-400 hover:text-white hover:bg-gray-800",
- "group flex gap-x-3 items-center rounded-md p-2 text-sm leading-6 w-full disabled:hover:bg-inherit disabled:text-gray-400 disabled:cursor-default"
+ ? "bg-gray-200 dark:bg-secondary text-secondary-foreground font-semibold"
+ : "text-muted-foreground hover:text-foreground hover:bg-gray-200 hover:dark:bg-muted",
+ "group flex gap-x-3 items-center rounded-md p-2 text-sm leading-6 w-full disabled:hover:bg-transparent disabled:text-muted-foreground disabled:cursor-default"
)}
disabled={item.disabled}
>
@@ -171,57 +172,60 @@ export default function Sidebar() {
</ul>
</li>
<li className="-mx-2 mt-auto mb-4">
- <Menu as="div" className="relative">
- <Menu.Button className="flex items-center group rounded-md gap-x-3 p-2 w-full text-sm font-semibold leading-6 text-white hover:bg-gray-800">
- <img
- className="h-8 w-8 rounded-full bg-gray-800"
- src={session?.user?.image || ""}
- alt={`Profile picture of ${session?.user?.name}`}
- />
- <span className="flex items-center w-full justify-between">
- <span className="sr-only">Your profile</span>
- <span aria-hidden="true">{session?.user?.name}</span>
- <ChevronUpIcon
- className="ml-2 h-5 w-5 text-gray-400"
- aria-hidden="true"
+ <div className="flex justify-between items-center space-x-2">
+ <Menu as="div" className="relative grow">
+ <Menu.Button className="flex items-center group rounded-md gap-x-3 p-2 w-full text-sm font-semibold leading-6 text-foreground hover:bg-gray-200 hover:dark:bg-secondary">
+ <img
+ className="h-8 w-8 rounded-full bg-secondary"
+ src={session?.user?.image || ""}
+ alt={`Profile picture of ${session?.user?.name}`}
/>
- </span>
- </Menu.Button>
- <Transition
- as={Fragment}
- enter="transition ease-out duration-100"
- enterFrom="transform opacity-0 scale-95"
- enterTo="transform opacity-100 scale-100"
- leave="transition ease-in duration-75"
- leaveFrom="transform opacity-100 scale-100"
- leaveTo="transform opacity-0 scale-95"
- >
- <Menu.Items className="absolute left-0 z-10 bottom-0 mb-14 w-full origin-bottom-left rounded-md bg-gray-900 py-2 shadow-lg ring-1 ring-gray-900/5 focus:outline-none">
- {session && (
- <Menu.Item>
- <p className="block px-3 py-1 text-sm leading-6 text-gray-400">
- {session?.user?.email}
- </p>
- </Menu.Item>
- )}
- {session ? (
- <Menu.Item>
- <Link
- onClick={() =>
- signOut({
- callbackUrl: `${window.location.origin}`,
- })
- }
- className="block px-3 py-1 text-sm leading-6 text-white hover:bg-gray-700"
- href={""}
- >
- Sign Out
- </Link>
- </Menu.Item>
- ) : null}
- </Menu.Items>
- </Transition>
- </Menu>
+ <span className="flex items-center w-full justify-between">
+ <span className="sr-only">Your profile</span>
+ <span aria-hidden="true">{session?.user?.name}</span>
+ <ChevronUpIcon
+ className="ml-2 h-5 w-5 text-muted-foreground"
+ aria-hidden="true"
+ />
+ </span>
+ </Menu.Button>
+ <Transition
+ as={Fragment}
+ enter="transition ease-out duration-100"
+ enterFrom="transform opacity-0 scale-95"
+ enterTo="transform opacity-100 scale-100"
+ leave="transition ease-in duration-75"
+ leaveFrom="transform opacity-100 scale-100"
+ leaveTo="transform opacity-0 scale-95"
+ >
+ <Menu.Items className="absolute left-0 z-10 bottom-0 mb-14 w-full origin-bottom-left rounded-md bg-gray-100 dark:bg-primary-foreground py-2 focus:outline-none">
+ {session ? (
+ <>
+ <Menu.Item>
+ <p className="block px-3 py-1 text-sm leading-6 text-muted-foreground">
+ {session?.user?.email}
+ </p>
+ </Menu.Item>
+ <Menu.Item>
+ <Link
+ onClick={() =>
+ signOut({
+ callbackUrl: `${window.location.origin}`,
+ })
+ }
+ className="block px-3 py-1 text-sm leading-6 text-foreground hover:bg-gray-200 hover:dark:bg-muted"
+ href={""}
+ >
+ Sign Out
+ </Link>
+ </Menu.Item>
+ </>
+ ) : null}
+ </Menu.Items>
+ </Transition>
+ </Menu>
+ <ModeToggle />
+ </div>
</li>
</ul>
</nav>
@@ -230,22 +234,16 @@ export default function Sidebar() {
<div className="lg:pl-72">
{/* Navbar */}
- <div className="sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b border-black/10 bg-black/95 px-4 shadow-sm sm:gap-x-6 sm:px-6 lg:px-8 lg:hidden">
+ <div className="sticky top-0 z-40 mb-1 flex h-14 shrink-0 items-center gap-x-4 border-b border-gray-50/90 bg-gray-50 dark:border-black/10 dark:bg-black/95 px-4 sm:gap-x-6 sm:px-6 lg:px-8 lg:hidden">
<button
type="button"
- className="-m-2.5 p-2.5 text-gray-700 lg:hidden"
+ className="-m-2.5 p-2.5 text-muted-foreground lg:hidden"
onClick={() => setSidebarOpen(true)}
>
<span className="sr-only">Open sidebar</span>
<Bars3Icon className="h-6 w-6" aria-hidden="true" />
</button>
- {/* Separator */}
- <div
- className="h-6 w-px bg-gray-900/10 lg:hidden"
- aria-hidden="true"
- />
-
<div className="flex flex-1 gap-x-4 self-stretch items-center lg:gap-x-6 justify-end">
<div className="flex items-center gap-x-4 lg:gap-x-6">
{/* Profile dropdown */}
@@ -253,17 +251,10 @@ export default function Sidebar() {
<Menu.Button className="-m-1.5 flex items-center p-1.5">
<span className="sr-only">Open user menu</span>
<img
- className="h-8 w-8 rounded-full bg-gray-50"
+ className="h-8 w-8 rounded-full bg-secondary"
src={session?.user?.image || ""}
alt={`Profile picture of ${session?.user?.name}`}
/>
- {/* <span className="flex items-center">
-
- <ChevronDownIcon
- className="ml-2 h-5 w-5 text-gray-400"
- aria-hidden="true"
- />
- </span> */}
</Menu.Button>
<Transition
as={Fragment}
@@ -274,32 +265,33 @@ export default function Sidebar() {
leaveFrom="transform opacity-100 scale-100"
leaveTo="transform opacity-0 scale-95"
>
- <Menu.Items className="absolute right-0 z-10 mt-2.5 w-fit origin-top-right rounded-md bg-gray-900 py-2 shadow-lg ring-1 ring-gray-900/5 focus:outline-none">
- {session && (
- <Menu.Item>
- <p className="block px-3 py-1 text-sm leading-6 text-gray-400">
- {session?.user?.email}
- </p>
- </Menu.Item>
- )}
+ <Menu.Items className="absolute right-0 z-10 mt-2.5 w-fit origin-top-right rounded-md bg-primary-foreground shadow-lg py-2 ring-1 ring-primary-foreground/5 focus:outline-none">
{session ? (
- <Menu.Item>
- <Link
- onClick={() =>
- signOut({
- callbackUrl: `${window.location.origin}`,
- })
- }
- className="block px-3 py-1 text-sm leading-6 text-white hover:bg-gray-700"
- href={""}
- >
- Sign Out
- </Link>
- </Menu.Item>
+ <>
+ <Menu.Item>
+ <p className="block px-3 py-1 text-sm leading-6 text-muted-foreground">
+ {session?.user?.email}
+ </p>
+ </Menu.Item>
+ <Menu.Item>
+ <Link
+ onClick={() =>
+ signOut({
+ callbackUrl: `${window.location.origin}`,
+ })
+ }
+ className="block px-3 py-1 text-sm leading-6 text-foreground hover:bg-gray-200 hover:dark:bg-muted"
+ href={""}
+ >
+ Sign Out
+ </Link>
+ </Menu.Item>
+ </>
) : null}
</Menu.Items>
</Transition>
</Menu>
+ <ModeToggle />
</div>
</div>
</div>
diff --git a/components/Skeleton.tsx b/components/Skeleton.tsx
index dacb1d98..b2bb369d 100644
--- a/components/Skeleton.tsx
+++ b/components/Skeleton.tsx
@@ -6,7 +6,7 @@ function Skeleton({
}: React.HTMLAttributes<HTMLDivElement>) {
return (
<div
- className={classNames("animate-pulse rounded-md bg-gray-800", className!)}
+ className={classNames("animate-pulse rounded-md bg-muted", className!)}
{...props}
/>
);
diff --git a/components/charts/bar-chart.tsx b/components/charts/bar-chart.tsx
index e7b4b7f5..9da27bca 100644
--- a/components/charts/bar-chart.tsx
+++ b/components/charts/bar-chart.tsx
@@ -40,7 +40,7 @@ export default function BarChartComponent({data, isSum = false}: {data: any, isS
data={renamedData}
index="pageNumber"
categories={["Time spent per page"]}
- colors={["gray"]}
+ colors={["emerald"]}
valueFormatter={timeFormatter}
yAxisWidth={50}
showGridLines={false}
diff --git a/components/document-upload.tsx b/components/document-upload.tsx
index 06732af6..17f505fe 100644
--- a/components/document-upload.tsx
+++ b/components/document-upload.tsx
@@ -63,10 +63,10 @@ export default function DocumentUpload({
<div className="col-span-full">
<div
{...getRootProps()}
- className="relative cursor-pointer font-semibold text-white hover:text-gray-400 hover:bg-gray-900 block group"
+ className="relative cursor-pointer font-semibold text-foreground hover:text-gray-900 hover:bg-gray-100 hover:dark:text-gray-500 hover:dark:bg-gray-900 block group"
>
<input {...getInputProps()} name="file" className="sr-only" />
- <div className="flex justify-center rounded-lg border border-dashed border-white/25 px-6 py-10 min-h-[200px] md:min-w-full items-center">
+ <div className="flex justify-center rounded-lg border border-dashed border-black/25 dark:border-white/25 px-6 py-10 min-h-[200px] md:min-w-full items-center">
{currentFile ? (
<div
className="absolute inset-0 opacity-10 pointer-events-none group-hover:opacity-5 transition-opacity"
@@ -79,7 +79,7 @@ export default function DocumentUpload({
) : null}
<div className="text-center">
{currentFile ? (
- <div className="flex flex-col sm:flex-row items-center space-y-1 sm:space-x-2 text-white">
+ <div className="flex flex-col sm:flex-row items-center space-y-1 sm:space-x-2 text-foreground">
<div>{fileIcon(currentFile.type)}</div>
<p>{currentFile.name}</p>
<p className="text-gray-500">{bytesToSize(currentFile.size)}</p>
@@ -91,12 +91,12 @@ export default function DocumentUpload({
/>
)}
- <div className="mt-4 flex text-sm leading-6 text-gray-400">
+ <div className="mt-4 flex text-sm leading-6 text-gray-500">
<span className="mx-auto">
{currentFile ? "" : "Choose file to upload or drag and drop"}
</span>
</div>
- <p className="text-xs leading-5 text-gray-400">
+ <p className="text-xs leading-5 text-gray-500">
{currentFile
? "Replace file?"
: "Only *.pdf & 30 MB limit"}
diff --git a/components/documents/add-document-modal.tsx b/components/documents/add-document-modal.tsx
index 8b90623a..8f3333a2 100644
--- a/components/documents/add-document-modal.tsx
+++ b/components/documents/add-document-modal.tsx
@@ -12,6 +12,7 @@ import { put, type PutBlobResult } from "@vercel/blob";
import DocumentUpload from "@/components/document-upload";
import { pdfjs } from "react-pdf";
import { copyToClipboard, getExtension } from "@/lib/utils";
+import { Button } from "../ui/button";
import { usePlausible } from "next-plausible";
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;
@@ -98,12 +99,12 @@ export function AddDocumentModal({children}: {children: React.ReactNode}) {
return (
<Dialog>
<DialogTrigger>{children}</DialogTrigger>
- <DialogContent className="text-white bg-black ring-1 ring-white/10">
+ <DialogContent className="text-foreground bg-background">
<DialogHeader>
<DialogTitle>Share a document</DialogTitle>
<DialogDescription>
- <div className="border-b border-gray-800 py-2">
- <p className="mt-1 text-sm text-gray-400">
+ <div className="border-b border-border py-2">
+ <p className="mb-1 text-sm text-muted-foreground">
After you upload the document, a shareable link will be
generated and copied to your clipboard.
</p>
@@ -125,13 +126,13 @@ export function AddDocumentModal({children}: {children: React.ReactNode}) {
</div>
<div className="flex justify-center">
- <button
+ <Button
type="submit"
- className="rounded-md bg-gray-100 px-3 py-2 w-full lg:w-1/2 text-sm font-semibold text-gray-900 shadow-sm transition-colors hover:text-gray-100 hover:bg-gray-500 disabled:text-gray-400 disabled:bg-gray-800 disabled:cursor-not-allowed"
+ className="w-full lg:w-1/2"
disabled={uploading || !currentFile}
>
{uploading ? "Uploading..." : "Upload Document"}
- </button>
+ </Button>
</div>
</form>
</DialogDescription>
diff --git a/components/documents/document-card.tsx b/components/documents/document-card.tsx
index cc6ce0a9..cc7a6bfe 100644
--- a/components/documents/document-card.tsx
+++ b/components/documents/document-card.tsx
@@ -18,14 +18,20 @@ export default function DocumentsCard({
return (
- <li className="relative rounded-lg bg-gray-800 p-3 border-0 ring-1 ring-gray-700 transition-all hover:ring-gray-500 sm:p-4 flex justify-between items-center">
+ <li className="relative rounded-lg p-3 border-0 dark:bg-secondary ring-1 ring-gray-200 dark:ring-gray-700 transition-all hover:ring-gray-400 hover:dark:ring-gray-500 hover:bg-secondary sm:p-4 flex justify-between items-center">
<div className="min-w-0 flex shrink items-center space-x-4">
<div className="w-8 mx-1 text-center flex justify-center items-center">
- <Image src={`/_icons/${getExtension(document.file)}.svg`} alt="File icon" width={50} height={50} className="" />
+ <Image
+ src={`/_icons/${getExtension(document.file)}.svg`}
+ alt="File icon"
+ width={50}
+ height={50}
+ className=""
+ />
</div>
<div className="flex-col">
<div className="flex items-center">
- <h2 className="min-w-0 text-sm font-semibold leading-6 text-white truncate max-w-[240px] sm:max-w-md">
+ <h2 className="min-w-0 text-sm font-semibold leading-6 text-foreground truncate max-w-[240px] sm:max-w-md">
<Link href={`/documents/${document.id}`}>
<span className="">{document.name}</span>
<span className="absolute inset-0" />
@@ -33,18 +39,18 @@ export default function DocumentsCard({
</h2>
<div className="flex ml-2">
<button
- className="group rounded-full bg-gray-700 z-10 p-1.5 transition-all duration-75 hover:scale-105 hover:bg-blue-50 active:scale-95"
+ className="group rounded-full bg-gray-200 dark:bg-gray-700 z-10 p-1.5 transition-all duration-75 hover:scale-105 hover:bg-emerald-100 hover:dark:bg-emerald-200 active:scale-95"
onClick={() => handleCopyToClipboard(document.links[0].id)}
title="Copy to clipboard"
>
<Copy
- className="text-gray-400 group-hover:text-blue-800"
+ className="text-gray-400 group-hover:text-emerald-700"
aria-hidden="true"
/>
</button>
</div>
</div>
- <div className="mt-1 flex items-center space-x-1 text-xs leading-5 text-gray-400">
+ <div className="mt-1 flex items-center space-x-1 text-xs leading-5 text-muted-foreground">
<p className="truncate">{timeAgo(document.createdAt)}</p>
<p>•</p>
<p className="truncate">{`${document._count.links} ${
@@ -59,10 +65,10 @@ export default function DocumentsCard({
e.stopPropagation();
}}
href={`/documents/${document.id}`}
- className="flex items-center z-10 space-x-1 rounded-md bg-gray-700 px-2 py-0.5 transition-all duration-75 hover:scale-105 active:scale-100"
+ className="flex items-center z-10 space-x-1 rounded-md bg-gray-200 dark:bg-gray-700 px-2 py-0.5 transition-all duration-75 hover:scale-105 active:scale-100"
>
- <BarChart className="h-4 w-4 text-gray-400" />
- <p className="whitespace-nowrap text-sm text-gray-400">
+ <BarChart className="h-4 w-4 text-muted-foreground" />
+ <p className="whitespace-nowrap text-sm text-muted-foreground">
{nFormatter(document._count.views)}
<span className="ml-1 hidden sm:inline-block">views</span>
</p>
diff --git a/components/documents/stats-card.tsx b/components/documents/stats-card.tsx
index 17bc88a4..6a6c99f8 100644
--- a/components/documents/stats-card.tsx
+++ b/components/documents/stats-card.tsx
@@ -39,7 +39,7 @@ export default function StatsCard() {
];
return (
- <div className="grid grid-cols-1 bg-gray-900 sm:grid-cols-3 lg:grid-cols-3 border-b border-white/5">
+ <div className="grid grid-cols-1 sm:grid-cols-3 lg:grid-cols-3 border-b border-foreground/5">
{stats
? statistics.map((stat, statIdx) => (
<StatsElement key={statIdx} stat={stat} statIdx={statIdx} />
diff --git a/components/documents/stats-element-placeholder.tsx b/components/documents/stats-element-placeholder.tsx
index 6b0edfe3..cebf3224 100644
--- a/components/documents/stats-element-placeholder.tsx
+++ b/components/documents/stats-element-placeholder.tsx
@@ -5,12 +5,12 @@ export default function StatsElementPlaceholder({ statIdx }: { statIdx: number }
<div
className={classNames(
statIdx % 2 === 1 ? "sm:border-l" : statIdx === 2 ? "lg:border-l" : "",
- "border-t border-white/5 py-6 px-4 sm:px-6 lg:px-8"
+ "border-t border-foreground/5 py-6 px-4 sm:px-6 lg:px-8"
)}
>
- <div className="h-4 w-full animate-pulse rounded-md bg-gray-800" />
+ <div className="h-4 w-full animate-pulse rounded-md bg-gray-200 dark:bg-gray-800" />
<div className="mt-4 flex gap-x-2">
- <div className="h-8 w-8 animate-pulse rounded-md bg-gray-800" />
+ <div className="h-8 w-8 animate-pulse rounded-md bg-gray-200 dark:bg-gray-800" />
</div>
</div>
);
diff --git a/components/documents/stats-element.tsx b/components/documents/stats-element.tsx
index d825b998..7e95a301 100644
--- a/components/documents/stats-element.tsx
+++ b/components/documents/stats-element.tsx
@@ -17,12 +17,14 @@ export default function StatsElement({ stat, statIdx }: StatsElementProps) {
key={statIdx}
className={classNames(
statIdx % 2 === 1 ? "sm:border-l" : statIdx === 2 ? "lg:border-l" : "",
- "border-t border-white/5 py-6 px-4 sm:px-6 lg:px-8"
+ "border-t border-foreground/5 py-6 px-4 sm:px-6 lg:px-8"
)}
>
<p
className={classNames(
- !stat.active ? "text-gray-700" : "text-gray-400",
+ !stat.active
+ ? "text-gray-300 dark:text-gray-700"
+ : "text-muted-foreground",
"text-sm font-medium leading-6"
)}
>
@@ -31,7 +33,7 @@ export default function StatsElement({ stat, statIdx }: StatsElementProps) {
<p className="mt-2 flex items-baseline gap-x-2">
<span
className={classNames(
- !stat.active ? "text-gray-700" : "text-white",
+ !stat.active ? "text-gray-300 dark:text-gray-700" : "text-foreground",
"text-4xl font-semibold tracking-tight "
)}
>
@@ -40,7 +42,7 @@ export default function StatsElement({ stat, statIdx }: StatsElementProps) {
{stat.unit ? (
<span
className={classNames(
- !stat.active ? "text-gray-700" : "text-gray-400",
+ !stat.active ? "text-gray-300 dark:text-gray-700" : "text-muted-foreground",
"text-sm"
)}
>
diff --git a/components/layouts/app.tsx b/components/layouts/app.tsx
index afbb2231..e3f1d434 100644
--- a/components/layouts/app.tsx
+++ b/components/layouts/app.tsx
@@ -4,12 +4,12 @@ import Sidebar from "../Sidebar";
export default function AppLayout({children}: {children: React.ReactNode}) {
return (
<div>
- <div className="flex flex-col lg:flex-row min-h-screen bg-gradient-to-tl from-black to-gray-950">
+ <div className="flex flex-col lg:flex-row min-h-screen bg-gray-50 dark:bg-black">
<Sidebar />
- <main className="lg:m-2 grow w-full bg-gray-900 shadow rounded-xl">
+ <main className="lg:m-2 grow w-full bg-white dark:bg-gray-900 rounded-xl ring-1 ring-gray-200 dark:ring-gray-800">
{children}
</main>
</div>
</div>
- )
+ );
}
\ No newline at end of file
diff --git a/components/links/link-sheet/email-protection-section.tsx b/components/links/link-sheet/email-protection-section.tsx
index 59d6c9bd..1dfdefd6 100644
--- a/components/links/link-sheet/email-protection-section.tsx
+++ b/components/links/link-sheet/email-protection-section.tsx
@@ -26,7 +26,7 @@ export default function EmailProtectionSection({data, setData}: {data: DEFAULT_L
<h2
className={cn(
"text-sm font-medium leading-6",
- enabled ? "text-white" : "text-gray-400"
+ enabled ? "text-foreground" : "text-muted-foreground"
)}
>
Email Protection
diff --git a/components/links/link-sheet/expiration-section.tsx b/components/links/link-sheet/expiration-section.tsx
index a2a7149c..4f638c37 100644
--- a/components/links/link-sheet/expiration-section.tsx
+++ b/components/links/link-sheet/expiration-section.tsx
@@ -30,16 +30,13 @@ export default function ExpirationSection({data, setData}: {data: DEFAULT_LINK_T
<h2
className={cn(
"text-sm font-medium leading-6",
- enabled ? "text-white" : "text-gray-400"
+ enabled ? "text-foreground" : "text-muted-foreground"
)}
>
Expiration Date
</h2>
</div>
- <Switch
- checked={enabled}
- onCheckedChange={handleEnableExpiration}
- />
+ <Switch checked={enabled} onCheckedChange={handleEnableExpiration} />
</div>
{enabled && (
<motion.div className="mt-3" {...FADE_IN_ANIMATION_SETTINGS}>
@@ -53,7 +50,7 @@ export default function ExpirationSection({data, setData}: {data: DEFAULT_LINK_T
onChange={(e) => {
setData({ ...data, expiresAt: new Date(e.target.value) });
}}
- className="flex w-full rounded-md border-0 py-1.5 text-white bg-black shadow-sm ring-1 ring-inset ring-gray-600 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-gray-300 sm:text-sm sm:leading-6 dark:[color-scheme:dark]"
+ className="flex w-full rounded-md border-0 py-1.5 text-foreground bg-background shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400 sm:text-sm sm:leading-6"
/>
</motion.div>
)}
diff --git a/components/links/link-sheet/index.tsx b/components/links/link-sheet/index.tsx
index d93e68f7..aa080a46 100644
--- a/components/links/link-sheet/index.tsx
+++ b/components/links/link-sheet/index.tsx
@@ -15,6 +15,8 @@ import EmailProtectionSection from "./email-protection-section";
import { useRouter } from "next/router";
import { useDocumentLinks } from "@/lib/swr/use-document";
import { mutate } from "swr";
+import { Button } from "@/components/ui/button";
+import { toast } from "sonner";
export const DEFAULT_LINK_PROPS = {
id: null,
@@ -83,6 +85,7 @@ export default function LinkSheet({ isOpen, setIsOpen, currentLink }: { isOpen:
(links || []).map(link => link.id === currentLink.id ? returnedLink : link),
false
);
+ toast.success("Link updated successfully");
} else {
// Add the new link to the list of links
mutate(
@@ -90,8 +93,11 @@ export default function LinkSheet({ isOpen, setIsOpen, currentLink }: { isOpen:
[...(links || []), returnedLink],
false
);
+ toast.success("Link created successfully");
}
+
+
setData(DEFAULT_LINK_PROPS);
setIsLoading(false);
}
@@ -100,12 +106,12 @@ export default function LinkSheet({ isOpen, setIsOpen, currentLink }: { isOpen:
return (
<Sheet open={isOpen} onOpenChange={(open: boolean) => setIsOpen(open)}>
- {/* <SheetTrigger>{children}</SheetTrigger> */}
- <SheetContent className="bg-black text-white flex flex-col justify-between">
+ <SheetContent className="bg-background text-foreground flex flex-col justify-between">
<SheetHeader>
- <SheetTitle className="text-white">Create a new link</SheetTitle>
- <SheetDescription className="text-white">
- Customize a document link for sharing. Click save when you&apos;re done.
+ <SheetTitle>Create a new link</SheetTitle>
+ <SheetDescription>
+ Customize a document link for sharing. Click save when you&apos;re
+ done.
</SheetDescription>
</SheetHeader>
<form className="flex flex-col grow" onSubmit={handleSubmit}>
@@ -116,9 +122,9 @@ export default function LinkSheet({ isOpen, setIsOpen, currentLink }: { isOpen:
<div>
<label
htmlFor="project-name"
- className="block text-sm font-medium leading-6 text-white"
+ className="block text-sm font-medium leading-6 text-foreground"
>
- Link name
+ Link Name
</label>
<div className="mt-2">
<input
@@ -126,8 +132,8 @@ export default function LinkSheet({ isOpen, setIsOpen, currentLink }: { isOpen:
name="link-name"
id="link-name"
placeholder="Recipient's Organization"
- value={data.name || ''}
- className="flex w-full rounded-md border-0 py-1.5 text-white bg-black shadow-sm ring-1 ring-inset ring-gray-600 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-gray-300 sm:text-sm sm:leading-6"
+ value={data.name || ""}
+ className="flex w-full rounded-md border-0 py-1.5 text-foreground bg-background shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400 sm:text-sm sm:leading-6"
onChange={(e) =>
setData({ ...data, name: e.target.value })
}
@@ -136,9 +142,9 @@ export default function LinkSheet({ isOpen, setIsOpen, currentLink }: { isOpen:
</div>
<div className="flex items-center relative">
- <Separator className="bg-gray-500 absolute" />
+ <Separator className="bg-muted-foreground absolute" />
<div className="relative mx-auto">
- <span className="px-2 bg-black text-gray-500 text-sm">
+ <span className="px-2 bg-background text-muted-foreground text-sm">
Optional
</span>
</div>
@@ -156,25 +162,10 @@ export default function LinkSheet({ isOpen, setIsOpen, currentLink }: { isOpen:
<SheetFooter>
<div className="flex items-center">
- {/* <div className="flex text-sm">
- <a
- href="#"
- className="group inline-flex items-center text-gray-500 hover:text-gray-400"
- >
- <QuestionMarkCircleIcon
- className="h-5 w-5 text-gray-400 group-hover:text-gray-300"
- aria-hidden="true"
- />
- <span className="ml-2">Learn more about sharing</span>
- </a>
- </div> */}
<SheetClose asChild>
- <button
- type="submit"
- className="ml-4 inline-flex justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-950 shadow-sm hover:bg-gray-200"
- >
+ <Button type="submit">
{currentLink ? "Update Link" : "Save Link"}
- </button>
+ </Button>
</SheetClose>
</div>
</SheetFooter>
diff --git a/components/links/link-sheet/password-section.tsx b/components/links/link-sheet/password-section.tsx
index ae660885..b7da5695 100644
--- a/components/links/link-sheet/password-section.tsx
+++ b/components/links/link-sheet/password-section.tsx
@@ -30,14 +30,16 @@ export default function PasswordSection({data, setData}: {data: DEFAULT_LINK_TYP
<div className="pb-5">
<div className="flex items-center justify-between">
<div className="flex items-center justify-between space-x-2">
- <h2 className={cn("text-sm font-medium leading-6", enabled ? "text-white" : "text-gray-400")}>
+ <h2
+ className={cn(
+ "text-sm font-medium leading-6",
+ enabled ? "text-foreground" : "text-muted-foreground"
+ )}
+ >
Password Protection
</h2>
</div>
- <Switch
- checked={enabled}
- onCheckedChange={handleEnablePassword}
- />
+ <Switch checked={enabled} onCheckedChange={handleEnablePassword} />
</div>
{enabled && (
<motion.div
@@ -48,7 +50,7 @@ export default function PasswordSection({data, setData}: {data: DEFAULT_LINK_TYP
name="password"
id="password"
type={showPassword ? "text" : "password"}
- className="flex w-full rounded-md border-0 py-1.5 text-white bg-black shadow-sm ring-1 ring-inset ring-gray-600 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-gray-300 sm:text-sm sm:leading-6"
+ className="flex w-full rounded-md border-0 py-1.5 text-foreground bg-background shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400 sm:text-sm sm:leading-6"
value={password || ""}
placeholder="Enter password"
onChange={(e) => {
@@ -62,9 +64,9 @@ export default function PasswordSection({data, setData}: {data: DEFAULT_LINK_TYP
className="absolute inset-y-0 right-0 flex items-center pr-3"
>
{showPassword ? (
- <Eye className="h-4 w-4 text-gray-400" aria-hidden="true" />
+ <Eye className="h-4 w-4 text-muted-foreground" aria-hidden="true" />
) : (
- <EyeOff className="h-4 w-4 text-gray-400" aria-hidden="true" />
+ <EyeOff className="h-4 w-4 text-muted-foreground" aria-hidden="true" />
)}
</button>
</motion.div>
diff --git a/components/links/links-table.tsx b/components/links/links-table.tsx
index 067ffcfe..66f78396 100644
--- a/components/links/links-table.tsx
+++ b/components/links/links-table.tsx
@@ -119,15 +119,15 @@ export default function LinksTable() {
<Collapsible key={link.id} asChild>
<>
<TableRow key={link.id} className="group/row">
- <TableCell className="hidden sm:table-cell truncate w-[220px]">
+ <TableCell className="hidden sm:table-cell font-medium truncate w-[220px]">
{link.name || "No link name"}
</TableCell>
<TableCell className="max-w-[150px] sm:min-w-[450px]">
- <div className="group/cell flex items-center gap-x-4 rounded-md bg-gray-700 px-3 py-1 group-hover/row:ring-1 group-hover/row:ring-gray-100 hover:bg-gray-200 transition-all">
- <div className="whitespace-nowrap hidden sm:flex text-sm text-gray-300 group-hover/cell:hidden">{`https://papermark.io/view/${link.id}`}</div>
- <div className="flex sm:hidden whitespace-nowrap text-sm text-gray-300 group-hover/cell:hidden truncate">{`${link.id}`}</div>
+ <div className="group/cell flex items-center gap-x-4 rounded-md text-secondary-foreground bg-secondary px-3 py-1 group-hover/row:ring-1 group-hover/row:ring-gray-400 hover:bg-emerald-700 hover:dark:bg-emerald-200 group-hover/row:dark:ring-gray-100 transition-all">
+ <div className="whitespace-nowrap hidden sm:flex text-sm group-hover/cell:hidden">{`https://papermark.io/view/${link.id}`}</div>
+ <div className="flex sm:hidden whitespace-nowrap text-sm group-hover/cell:hidden truncate">{`${link.id}`}</div>
<button
- className="whitespace-nowrap text-sm text-center text-black hidden group-hover/cell:block w-full"
+ className="whitespace-nowrap text-sm text-center group-hover/cell:text-primary-foreground hidden group-hover/cell:block w-full"
onClick={() => handleCopyToClipboard(link.id)}
title="Copy to clipboard"
>
@@ -141,18 +141,18 @@ export default function LinksTable() {
<TableCell>
<CollapsibleTrigger asChild>
<div className="flex items-center space-x-1 [&[data-state=open]>svg.chevron]:rotate-180">
- <BarChart className="h-4 w-4 text-gray-400" />
- <p className="whitespace-nowrap text-sm text-gray-400">
+ <BarChart className="h-4 w-4 text-muted-foreground" />
+ <p className="whitespace-nowrap text-sm text-muted-foreground">
{nFormatter(link._count.views)}
<span className="ml-1 hidden sm:inline-block">
views
</span>
</p>
- <ChevronDown className="h-4 w-4 text-gray-400 shrink-0 transition-transform duration-200 chevron" />
+ <ChevronDown className="h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-200 chevron" />
</div>
</CollapsibleTrigger>
</TableCell>
- <TableCell className="text-sm text-gray-400">
+ <TableCell className="text-sm text-muted-foreground">
{link.views[0] ? (
<time
dateTime={new Date(
@@ -182,7 +182,7 @@ export default function LinksTable() {
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem
- className="text-red-500 focus:text-red-200 focus:bg-red-900"
+ className="text-destructive focus:bg-destructive focus:text-destructive-foreground"
onClick={() =>
handleArchiveLink(
link.id,
@@ -270,14 +270,14 @@ export default function LinksTable() {
.filter((link) => link.isArchived)
.map((link) => (
<>
- <TableRow key={link.id}>
+ <TableRow key={link.id} className="group/row">
<TableCell className="hidden sm:table-cell truncate w-[220px]">
{link.name || "No link name"}
</TableCell>
<TableCell className="max-w-[150px] sm:min-w-[450px]">
- <div className="flex items-center gap-x-4 rounded-md bg-gray-700 px-3 py-1 transition-all">
- <div className="whitespace-nowrap hidden sm:flex text-sm text-gray-300">{`https://papermark.io/view/${link.id}`}</div>
- <div className="flex sm:hidden whitespace-nowrap text-sm text-gray-300 truncate">{`${link.id}`}</div>
+ <div className="flex items-center gap-x-4 rounded-md text-secondary-foreground bg-secondary group-hover/row:ring-1 group-hover/row:ring-gray-400 group-hover/row:dark:ring-gray-100 px-3 py-1">
+ <div className="whitespace-nowrap hidden sm:flex text-sm">{`https://papermark.io/view/${link.id}`}</div>
+ <div className="flex sm:hidden whitespace-nowrap text-sm truncate">{`${link.id}`}</div>
</div>
</TableCell>
<TableCell>
@@ -324,7 +324,7 @@ export default function LinksTable() {
<DropdownMenuSeparator />
<DropdownMenuItem
- className="text-red-500 focus:text-red-200 focus:bg-red-900"
+ className="text-destructive focus:bg-destructive focus:text-destructive-foreground"
onClick={() =>
handleArchiveLink(
link.id,
diff --git a/components/links/links-visitors.tsx b/components/links/links-visitors.tsx
index 31327f69..5bd68741 100644
--- a/components/links/links-visitors.tsx
+++ b/components/links/links-visitors.tsx
@@ -26,7 +26,7 @@ export default function LinksVisitors({linkId, linkName}: {linkId: string, linkN
</Avatar>
<div className="min-w-0 flex-1">
<div className="focus:outline-none">
- <p className="text-sm font-medium text-gray-200 overflow-visible">
+ <p className="text-sm text-gray-800 dark:text-gray-200 overflow-visible">
{view.viewerEmail ? view.viewerEmail : "Anonymous"}
</p>
{/* <p className="text-sm text-gray-500">
@@ -36,11 +36,11 @@ export default function LinksVisitors({linkId, linkName}: {linkId: string, linkN
</div>
</div>
<div className="flex space-x-4 items-center">
- <div className="text-sm text-gray-400">
+ <div className="text-sm text-muted-foreground">
{durationFormat(view.totalDuration)}
</div>
- <div className="text-sm text-gray-400">
+ <div className="text-sm">
<Gauge
value={view.completionRate}
size={"small"}
@@ -63,15 +63,15 @@ export default function LinksVisitors({linkId, linkName}: {linkId: string, linkN
</Avatar>
<div className="min-w-0 flex-1">
<div className="focus:outline-none">
- <p className="text-sm font-medium text-gray-200 overflow-visible">
+ <p className="text-sm font-medium text-muted-foreground overflow-visible">
{view.viewerEmail}
</p>
- <p className="text-sm text-gray-500">
+ <p className="text-sm text-muted-foreground">
<span>{linkName}</span>
<span className="inline-flex">
&nbsp;•&nbsp;
<time
- className="truncate text-sm text-gray-500"
+ className="truncate text-sm text-muted-foreground"
dateTime={new Date(view.viewedAt).toISOString()}
>
{timeAgo(view.viewedAt)}
@@ -82,11 +82,11 @@ export default function LinksVisitors({linkId, linkName}: {linkId: string, linkN
</div>
</div>
<div className="flex space-x-4 items-center">
- <div className="text-sm text-gray-400">
+ <div className="text-sm text-muted-foreground">
{durationFormat(view.totalDuration)}
</div>
- <div className="text-sm text-gray-400">
+ <div className="text-sm">
<Gauge
value={view.completionRate}
size={"small"}
@@ -101,7 +101,7 @@ export default function LinksVisitors({linkId, linkName}: {linkId: string, linkN
<TableCell className="hidden sm:table-cell">
<div>
<time
- className="truncate text-sm text-gray-400"
+ className="truncate text-sm text-muted-foreground"
dateTime={new Date(view.viewedAt).toISOString()}
>
{timeAgo(view.viewedAt)}
diff --git a/components/theme-toggle.tsx b/components/theme-toggle.tsx
new file mode 100644
index 00000000..302d8e89
--- /dev/null
+++ b/components/theme-toggle.tsx
@@ -0,0 +1,42 @@
+"use client";
+
+import * as React from "react";
+import { Moon, Sun } from "lucide-react";
+import { useTheme } from "next-themes";
+
+import { Button } from "@/components/ui/button";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
+
+export function ModeToggle() {
+ const { setTheme } = useTheme();
+
+ return (
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button variant="outline" size="icon">
+ <Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
+ <Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
+ <span className="sr-only">Toggle theme</span>
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end">
+ <DropdownMenuItem onClick={() => setTheme("light")}>
+ Light
+ </DropdownMenuItem>
+ <DropdownMenuItem onClick={() => setTheme("dark")}>
+ Dark
+ </DropdownMenuItem>
+ <DropdownMenuItem onClick={() => setTheme("system")}>
+ System
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ );
+}
+
+
diff --git a/components/ui/avatar.tsx b/components/ui/avatar.tsx
index 991f56ec..c97deac2 100644
--- a/components/ui/avatar.tsx
+++ b/components/ui/avatar.tsx
@@ -37,7 +37,7 @@ const AvatarFallback = React.forwardRef<
<AvatarPrimitive.Fallback
ref={ref}
className={cn(
- "flex h-full w-full items-center justify-center rounded-full bg-muted",
+ "flex h-full w-full items-center justify-center rounded-full bg-gray-300 dark:bg-muted",
className
)}
{...props}
diff --git a/components/ui/gauge.tsx b/components/ui/gauge.tsx
index a716c6f5..8560cbfb 100644
--- a/components/ui/gauge.tsx
+++ b/components/ui/gauge.tsx
@@ -43,7 +43,7 @@ export const Gauge = ({
className="transform -rotate-90"
>
<circle
- className="text-[#333]"
+ className="text-gray-200 dark:text-gray-800"
strokeWidth="12"
stroke="currentColor"
fill="transparent"
@@ -53,7 +53,7 @@ export const Gauge = ({
cy="60"
/>
<circle
- className="text-[hsla(131,41%,46%,1)] animate-gauge_fill"
+ className="text-emerald-500 animate-gauge_fill"
strokeWidth="12"
strokeDasharray={strokeDasharray}
strokeDashoffset={initialOffset}
@@ -72,7 +72,7 @@ export const Gauge = ({
</svg>
{showValue ? (
<div className="absolute flex opacity-0 animate-gauge_fadeIn">
- <p className={`text-gray-100 ${sizes[size].textSize}`}>{value}</p>
+ <p className={`text-foreground ${sizes[size].textSize}`}>{value}</p>
</div>
) : null}
</div>
diff --git a/components/ui/switch.tsx b/components/ui/switch.tsx
index 73eb890f..7693ab07 100644
--- a/components/ui/switch.tsx
+++ b/components/ui/switch.tsx
@@ -11,7 +11,7 @@ const Switch = React.forwardRef<
>(({ className, ...props }, ref) => (
<SwitchPrimitives.Root
className={cn(
- "peer inline-flex h-5 w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-gray-200 data-[state=unchecked]:bg-gray-700",
+ "peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
className
)}
{...props}
@@ -19,7 +19,7 @@ const Switch = React.forwardRef<
>
<SwitchPrimitives.Thumb
className={cn(
- "pointer-events-none block h-4 w-4 rounded-full bg-black shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
+ "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
)}
/>
</SwitchPrimitives.Root>
diff --git a/components/ui/table.tsx b/components/ui/table.tsx
index 11717cfe..34b1da02 100644
--- a/components/ui/table.tsx
+++ b/components/ui/table.tsx
@@ -55,7 +55,7 @@ const TableRow = React.forwardRef<
<tr
ref={ref}
className={cn(
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
+ "border-b transition-colors hover:bg-gray-100 data-[state=selected]:bg-gray-100 hover:dark:bg-muted/50 data-[state=selected]:dark:bg-muted",
className
)}
{...props}
diff --git a/components/visitors/visitors-table.tsx b/components/visitors/visitors-table.tsx
index e8c068d6..fc76dd2f 100644
--- a/components/visitors/visitors-table.tsx
+++ b/components/visitors/visitors-table.tsx
@@ -55,10 +55,10 @@ export default function VisitorsTable({numPages}: {numPages: number}) {
</Avatar>
<div className="min-w-0 flex-1">
<div className="focus:outline-none">
- <p className="text-sm font-medium text-gray-200 overflow-visible">
+ <p className="text-sm font-medium text-gray-800 dark:text-gray-200 overflow-visible">
{view.viewerEmail? view.viewerEmail : "Anonymous"}
</p>
- <p className="text-sm text-gray-500">
+ <p className="text-sm text-muted-foreground/60">
{view.link.name ? view.link.name : view.linkId}
</p>
</div>
@@ -67,13 +67,13 @@ export default function VisitorsTable({numPages}: {numPages: number}) {
</TableCell>
{/* Duration */}
<TableCell className="">
- <div className="text-sm text-gray-400">
+ <div className="text-sm text-muted-foreground">
{durationFormat(view.totalDuration)}
</div>
</TableCell>
{/* Completion */}
<TableCell className="flex justify-start">
- <div className="text-sm text-gray-400">
+ <div className="text-sm text-muted-foreground">
<Gauge
value={view.completionRate}
size={"small"}
@@ -82,7 +82,7 @@ export default function VisitorsTable({numPages}: {numPages: number}) {
</div>
</TableCell>
{/* Last Viewed */}
- <TableCell className="text-sm text-gray-400">
+ <TableCell className="text-sm text-muted-foreground">
<time
dateTime={new Date(
view.viewedAt
@@ -95,7 +95,7 @@ export default function VisitorsTable({numPages}: {numPages: number}) {
<TableCell className="text-center sm:text-right">
<CollapsibleTrigger asChild>
<div className="flex justify-end px-2 space-x-1 [&[data-state=open]>svg.chevron]:rotate-180">
- <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200 chevron" />
+ <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200 chevron" />
</div>
</CollapsibleTrigger>
</TableCell>
diff --git a/components/welcome/intro.tsx b/components/welcome/intro.tsx
index e75274fd..803eb476 100644
--- a/components/welcome/intro.tsx
+++ b/components/welcome/intro.tsx
@@ -1,6 +1,7 @@
import { useRouter } from "next/router";
import { motion } from "framer-motion";
import { STAGGER_CHILD_VARIANTS } from "@/lib/contants"
+import { Button } from "../ui/button";
export default function Intro() {
const router = useRouter();
@@ -24,32 +25,36 @@ export default function Intro() {
className="mx-5 flex flex-col items-center space-y-10 text-center sm:mx-auto"
>
<motion.h1
- className="font-display text-4xl font-bold text-white transition-colors sm:text-5xl"
+ className="font-display text-4xl font-bold text-foreground transition-colors sm:text-5xl"
variants={STAGGER_CHILD_VARIANTS}
>
Welcome to{" "}
<span className="font-bold tracking-tighter">Papermark</span>
</motion.h1>
<motion.p
- className="max-w-md text-gray-200 transition-colors sm:text-lg"
+ className="max-w-md text-accent-foreground/80 transition-colors sm:text-lg"
variants={STAGGER_CHILD_VARIANTS}
>
- Papermark gives you the power to securely share your stories with an impression that lasts.
+ Papermark gives you the power to securely share your stories with an
+ impression that lasts.
</motion.p>
- <motion.button
+ <motion.div
variants={STAGGER_CHILD_VARIANTS}
- className="rounded px-10 py-2 font-medium transition-colors text-gray-900 bg-gray-100 hover:text-gray-100 hover:bg-gray-500"
- onClick={() =>
- router.push({
- pathname: "/welcome",
- query: {
- type: "next",
- },
- })
- }
+ // className="rounded px-10 py-2 font-medium transition-colors text-gray-900 bg-gray-100 hover:text-gray-100 hover:bg-gray-500"
>
- Get Started
- </motion.button>
+ <Button className="px-10 font-medium text-base"
+ onClick={() =>
+ router.push({
+ pathname: "/welcome",
+ query: {
+ type: "next",
+ },
+ })
+ }
+ >
+ Get Started
+ </Button>
+ </motion.div>
</motion.div>
</motion.div>
);
diff --git a/components/welcome/next.tsx b/components/welcome/next.tsx
index fda475e9..ce1c3f9a 100644
--- a/components/welcome/next.tsx
+++ b/components/welcome/next.tsx
@@ -27,16 +27,16 @@ export default function Next() {
variants={STAGGER_CHILD_VARIANTS}
className="flex flex-col items-center space-y-10 text-center"
>
- <p className="text-2xl font-bold tracking-tighter text-white">
+ <p className="text-2xl font-bold tracking-tighter text-foreground">
Papermark
</p>
- <h1 className="font-display max-w-md text-3xl font-semibold text-gray-100 transition-colors sm:text-4xl">
+ <h1 className="font-display max-w-md text-3xl font-semibold transition-colors sm:text-4xl">
Which document do you want to share today?
</h1>
</motion.div>
<motion.div
variants={STAGGER_CHILD_VARIANTS}
- className="grid w-full grid-cols-1 divide-y divide-gray-900 text-white rounded-md border border-gray-800 md:grid-cols-2 md:divide-x"
+ className="grid w-full grid-cols-1 divide-y divide-border text-foreground rounded-md border border-border md:grid-cols-2 md:divide-x"
>
<button
onClick={() =>
@@ -47,7 +47,7 @@ export default function Next() {
},
})
}
- className="flex flex-col items-center justify-center overflow-hidden p-5 space-y-5 transition-colors hover:bg-gray-800 md:p-10 min-h-[200px]"
+ className="flex flex-col items-center justify-center overflow-hidden p-5 space-y-5 transition-colors hover:bg-gray-200 hover:dark:bg-gray-800 md:p-10 min-h-[200px]"
>
<PresentationChartBarIcon className="h-auto pointer-events-none w-12 sm:w-12" />
<p>Pitchdeck</p>
@@ -61,7 +61,7 @@ export default function Next() {
},
})
}
- className="flex flex-col items-center justify-center overflow-hidden p-5 space-y-5 transition-colors hover:bg-gray-800 md:p-10 min-h-[200px]"
+ className="flex flex-col items-center justify-center overflow-hidden p-5 space-y-5 transition-colors hover:bg-gray-200 hover:dark:bg-gray-800 md:p-10 min-h-[200px]"
>
<DocumentIcon className="h-auto pointer-events-none w-12 sm:w-12" />
<p>Another document</p>
diff --git a/components/welcome/upload.tsx b/components/welcome/upload.tsx
index 339a16be..295da9b8 100644
--- a/components/welcome/upload.tsx
+++ b/components/welcome/upload.tsx
@@ -9,6 +9,7 @@ import Skeleton from "../Skeleton";
import { STAGGER_CHILD_VARIANTS } from "@/lib/contants";
import { pdfjs } from "react-pdf";
import { copyToClipboard, getExtension } from "@/lib/utils";
+import { Button } from "../ui/button";
import { usePlausible } from "next-plausible";
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;
@@ -29,7 +30,7 @@ export default function Upload() {
// Check if the file is chosen
if (!currentFile) {
- alert("Please select a file to upload.");
+ toast.error("Please select a file to upload.");
return; // prevent form from submitting
}
@@ -105,9 +106,15 @@ export default function Upload() {
return pdf.numPages;
}
- const handleCopyToClipboard = (id: string) => {
- copyToClipboard(`${process.env.NEXT_PUBLIC_BASE_URL}/view/${id}`, "Document uploaded and link copied to clipboard.");
- setCopiedLink(true);
+ const handleContinue = (id: string) => {
+ copyToClipboard(
+ `${process.env.NEXT_PUBLIC_BASE_URL}/view/${id}`,
+ "Link copied to clipboard. Redirecting to document page..."
+ );
+ setTimeout(() => {
+ router.push(`/documents/${currentDocId}`);
+ setUploading(false);
+ }, 2000);
};
return (
@@ -134,7 +141,7 @@ export default function Upload() {
variants={STAGGER_CHILD_VARIANTS}
className="flex flex-col items-center space-y-10 text-center"
>
- <h1 className="font-display text-3xl font-semibold text-gray-100 transition-colors sm:text-4xl">
+ <h1 className="font-display text-3xl font-semibold text-foreground transition-colors sm:text-4xl">
{`Upload your ${router.query.type}`}
</h1>
</motion.div>
@@ -157,13 +164,13 @@ export default function Upload() {
</div>
<div className="flex justify-center">
- <button
+ <Button
type="submit"
- className="rounded-md bg-gray-100 px-3 py-2 w-full text-sm font-semibold text-gray-900 shadow-sm transition-colors hover:text-gray-100 hover:bg-gray-500 disabled:text-gray-400 disabled:bg-gray-800 disabled:cursor-not-allowed"
+ className="w-full"
disabled={uploading || !currentFile}
>
{uploading ? "Uploading..." : "Upload Document"}
- </button>
+ </Button>
</div>
</form>
</main>
@@ -193,7 +200,7 @@ export default function Upload() {
variants={STAGGER_CHILD_VARIANTS}
className="flex flex-col items-center space-y-10 text-center"
>
- <h1 className="font-display text-3xl font-semibold text-gray-100 transition-colors sm:text-4xl">
+ <h1 className="font-display text-3xl font-semibold text-foreground transition-colors sm:text-4xl">
Share your unique link
</h1>
</motion.div>
@@ -202,7 +209,7 @@ export default function Upload() {
{!currentLinkId && (
<main className="min-h-[300px]">
<div className="flex flex-col justify-center">
- <div className="flex py-8 rounded-md shadow-sm">
+ <div className="flex py-8">
<div className="flex w-full focus-within:z-10">
<Skeleton className="h-6 w-full" />
</div>
@@ -214,35 +221,34 @@ export default function Upload() {
<main className="min-h-[300px]">
<div className="flex flex-col justify-center">
<div className="relative">
- <div className="flex py-8 rounded-md shadow-sm">
+ <div className="flex py-8">
<div className="flex w-full max-w-xs sm:max-w-lg focus-within:z-10">
- <p className="block w-full md:min-w-[500px] rounded-none rounded-l-md px-4 text-left border-0 py-1.5 text-gray-200 bg-gray-900 leading-6 overflow-y-scroll">
+ <p className="block w-full md:min-w-[500px] rounded-md px-4 text-left border-0 py-1.5 text-secondary-foreground bg-secondary leading-6 overflow-y-scroll">
{`${process.env.NEXT_PUBLIC_BASE_URL}/view/${currentLinkId}`}
</p>
</div>
- <button
+ {/* <button
type="button"
- className="relative -ml-px inline-flex items-center rounded-r-md px-3 py-2 text-sm font-semibold bg-gray-700 ring-1 ring-inset ring-gray-800 hover:ring-gray-400 animate-pulse"
+ className="relative -ml-px inline-flex items-center rounded-r-md px-3 py-2 text-sm font-semibold bg-accent ring-1 ring-inset ring-accent hover:ring-gray-400 animate-pulse"
title="Copy link"
onClick={() => handleCopyToClipboard(currentLinkId)}
>
<DocumentDuplicateIcon
- className="h-5 w-5 text-white"
+ className="h-5 w-5 text-accent-foreground"
aria-hidden="true"
/>
- </button>
+ </button> */}
</div>
</div>
<div className="flex items-center justify-center mb-4">
- <button
- onClick={() => router.push(`/documents/${currentDocId}`)}
+ <Button
+ onClick={() => handleContinue(currentLinkId)}
type="submit"
- className="flex items-center rounded-md px-5 py-2 w-fit text-sm font-semibold shadow-sm transition-colors text-gray-900 bg-gray-100 hover:text-gray-100 hover:bg-gray-500 disabled:hover:text-gray-900 disabled:bg-gray-700 disabled:cursor-not-allowed"
- disabled={!copiedLink}
+ // disabled={!copiedLink}
>
- {"To analytics"}
- <ArrowRightIcon className="h-4 w-4 ml-2" />
- </button>
+ {"Share Document"}
+ {/* <ArrowRightIcon className="h-4 w-4 ml-2" /> */}
+ </Button>
</div>
</div>
</main>
diff --git a/pages/_app.tsx b/pages/_app.tsx
index 9dd00ca5..f18eb2c4 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -21,13 +21,13 @@ export default function App({
<title>Papermark | The Open Source DocSend Alternative</title>
</Head>
<SessionProvider session={session}>
- <ThemeProvider attribute="class" defaultTheme="dark" enableSystem>
+ <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<PlausibleProvider
domain="papermark.io"
enabled={process.env.VERCEL_ENV == "production"}
>
<main className={inter.className}>
- <Toaster closeButton richColors theme={"dark"} />
+ <Toaster closeButton richColors theme={"system"} />
<Component {...pageProps} />
</main>
</PlausibleProvider>
diff --git a/pages/_document.tsx b/pages/_document.tsx
index ba6c0d38..af8eb05b 100644
--- a/pages/_document.tsx
+++ b/pages/_document.tsx
@@ -2,7 +2,7 @@ import { Html, Head, Main, NextScript } from "next/document";
export default function Document() {
return (
- <Html lang="en" className="h-full bg-black" suppressHydrationWarning>
+ <Html lang="en" className="h-full bg-background" suppressHydrationWarning>
<Head>
<meta name="theme-color" content="#000000" />
<meta
diff --git a/pages/documents/[id].tsx b/pages/documents/[id].tsx
index 99aa4f7f..9a7d6e8c 100644
--- a/pages/documents/[id].tsx
+++ b/pages/documents/[id].tsx
@@ -9,6 +9,7 @@ import Image from "next/image"
import LinksTable from "@/components/links/links-table";
import VisitorsTable from "@/components/visitors/visitors-table";
import { useState } from "react";
+import { Button } from "@/components/ui/button";
export default function DocumentPage() {
const { document, error } = useDocument();
@@ -37,18 +38,12 @@ export default function DocumentPage() {
className=""
/>
</div>
- <h2 className="leading-7 text-2xl text-white font-semibold tracking-tight">
+ <h2 className="leading-7 text-2xl text-foreground font-semibold tracking-tight">
{document.name}
</h2>
</div>
</div>
- <button
- type="button"
- className="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-gray-950 bg-gray-300 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"
- onClick={() => setIsLinkSheetOpen(true)}
- >
- Create Link
- </button>
+ <Button onClick={() => setIsLinkSheetOpen(true)}>Create Link</Button>
</div>
{/* Stats */}
{document.numPages !== null && (
@@ -62,7 +57,10 @@ export default function DocumentPage() {
<VisitorsTable numPages={document.numPages!} />
{/* Links */}
<LinksTable />
- <LinkSheet isOpen={isLinkSheetOpen} setIsOpen={setIsLinkSheetOpen} />
+ <LinkSheet
+ isOpen={isLinkSheetOpen}
+ setIsOpen={setIsLinkSheetOpen}
+ />
</>
) : (
<div>Loading...</div>
diff --git a/pages/documents/index.tsx b/pages/documents/index.tsx
index 893bd9cd..1906a729 100644
--- a/pages/documents/index.tsx
+++ b/pages/documents/index.tsx
@@ -7,6 +7,7 @@ import Link from "next/link";
import { AddDocumentModal } from "@/components/documents/add-document-modal";
import { Separator } from "@/components/ui/separator";
import AppLayout from "@/components/layouts/app"
+import { Button } from "@/components/ui/button";
export default function Documents() {
@@ -17,24 +18,19 @@ export default function Documents() {
<div className="p-4 sm:p-4 sm:m-4">
<div className="flex items-center justify-between mb-4 md:mb-8 lg:mb-12">
<div className="space-y-1">
- <h2 className="text-2xl text-white font-semibold tracking-tight">
+ <h2 className="text-2xl text-foreground font-semibold tracking-tight">
Documents
</h2>
- <p className="text-sm text-gray-400">Manage your documents</p>
+ <p className="text-sm text-muted-foreground">Manage your documents</p>
</div>
<ul className="flex items-center justify-between gap-4">
<AddDocumentModal>
- <button
- type="button"
- className="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-gray-950 bg-gray-300 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"
- >
- Add New Document
- </button>
+ <Button>Add New Document</Button>
</AddDocumentModal>
</ul>
</div>
- <Separator className="my-6 bg-gray-700" />
+ <Separator className="my-6 bg-gray-200 dark:bg-gray-800" />
{documents && documents.length === 0 && (
<div className="flex items-center justify-center h-96">
@@ -67,7 +63,7 @@ export function EmptyDocuments() {
return (
<div className="text-center">
<svg
- className="mx-auto h-12 w-12 text-gray-400"
+ className="mx-auto h-12 w-12 text-muted-foreground"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
@@ -81,15 +77,15 @@ export function EmptyDocuments() {
d="M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"
/>
</svg>
- <h3 className="mt-2 text-sm font-medium text-white">No documents</h3>
- <p className="mt-1 text-sm text-gray-400">
+ <h3 className="mt-2 text-sm font-medium text-foreground">No documents</h3>
+ <p className="mt-1 text-sm text-muted-foreground">
Get started by uploading a new document.
</p>
<div className="mt-6">
<AddDocumentModal>
<button
type="button"
- className="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
+ className="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-foreground bg-indigo-600 hover:bg-indigo-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
>
<PlusIcon className="-ml-1 mr-2 h-5 w-5" aria-hidden="true" />
New Document
diff --git a/pages/login.tsx b/pages/login.tsx
index 7f106895..adb1d6fd 100644
--- a/pages/login.tsx
+++ b/pages/login.tsx
@@ -1,3 +1,4 @@
+import { Button } from "@/components/ui/button";
import { signIn } from "next-auth/react";
import Link from "next/link";
import { useRouter } from "next/router";
@@ -20,25 +21,25 @@ export default function Login() {
}}
/>
</div>
- <div className="z-10 mt-[calc(30vh)] h-fit w-full mx-5 sm:mx-0 max-w-md overflow-hidden border border-gray-900 rounded-lg sm:shadow-xl">
- <div className="flex flex-col items-center justify-center space-y-3 bg-gray-800 px-4 py-6 pt-8 text-center sm:px-16">
+ <div className="z-10 mt-[calc(30vh)] h-fit w-full mx-5 sm:mx-0 max-w-md overflow-hidden border border-border bg-gray-50 dark:bg-gray-900 rounded-lg sm:shadow-xl">
+ <div className="flex flex-col items-center justify-center space-y-3 px-4 py-6 pt-8 text-center sm:px-16">
<Link href="/">
- <span className="text-xl font-bold tracking-tighter text-white">
+ <span className="text-xl font-bold tracking-tighter text-foreground">
Papermark
</span>
</Link>
- <h3 className="text-2xl text-white font-semibold">
+ <h3 className="text-2xl text-foreground font-medium">
Start sharing documents
</h3>
</div>
- <div className="flex flex-col bg-gray-800 px-4 py-8 sm:px-16">
- <button
+ <div className="flex flex-col px-4 py-8 sm:px-16">
+ <Button
onClick={() => {
signIn("google", {
...(next && next.length > 0 ? { callbackUrl: next } : {}),
});
}}
- className="rounded px-10 py-2 font-medium flex justify-center items-center transition-colors border border-white text-gray-900 bg-white hover:text-gray-100 hover:bg-gray-500"
+ className="flex justify-center items-center"
>
<svg
xmlns="http://www.w3.org/2000/svg"
@@ -49,7 +50,7 @@ export default function Login() {
<path d="M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z" />
</svg>
<span>Continue with Google</span>
- </button>
+ </Button>
</div>
</div>
</div>