From 877a579533dbfffa7130369463d3d071d5ec752c Mon Sep 17 00:00:00 2001 From: Doug Andrade Date: Sun, 11 Jun 2023 01:50:19 -0400 Subject: [PATCH] adding dark mode to feat/refresh --- apps/web/package.json | 3 +- .../src/app/(dashboard)/dashboard/page.tsx | 4 +- .../app/(dashboard)/documents/[id]/page.tsx | 2 +- apps/web/src/app/layout.tsx | 5 +- .../document-dropzone/document-dropzone.tsx | 35 ++++++----- .../(dashboard)/layout/desktop-nav.tsx | 18 ++++-- .../components/(dashboard)/layout/header.tsx | 5 +- .../(dashboard)/layout/profile-dropdown.tsx | 38 +++++++++++- .../(dashboard)/metric-card/metric-card.tsx | 4 +- .../(dashboard)/pdf-viewer/pdf-viewer.tsx | 2 +- .../src/components/forms/edit-document.tsx | 33 +++++++---- .../forms/edit-document/add-fields.tsx | 58 ++++++++++++++----- .../forms/edit-document/add-signers.tsx | 12 ++-- apps/web/src/components/forms/password.tsx | 9 ++- apps/web/src/components/forms/profile.tsx | 6 +- .../signature-pad/signature-pad.tsx | 2 +- apps/web/src/providers/next-theme.tsx | 10 ++++ package-lock.json | 18 ++++++ packages/tailwind-config/index.cjs | 2 +- packages/ui/primitives/card.tsx | 22 +++++-- packages/ui/styles/theme.css | 2 +- 21 files changed, 217 insertions(+), 73 deletions(-) create mode 100644 apps/web/src/providers/next-theme.tsx diff --git a/apps/web/package.json b/apps/web/package.json index 0af05f533..c7db16aa6 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -24,13 +24,14 @@ "next": "13.4.1", "next-auth": "^4.22.1", "next-plausible": "^3.7.2", + "next-themes": "^0.2.1", "perfect-freehand": "^1.2.0", "react": "18.2.0", - "react-pdf": "^7.1.1", "react-dom": "18.2.0", "react-dropzone": "^14.2.3", "react-hook-form": "^7.43.9", "react-icons": "^4.8.0", + "react-pdf": "^7.1.1", "typescript": "5.0.4", "zod": "^3.21.4" }, diff --git a/apps/web/src/app/(dashboard)/dashboard/page.tsx b/apps/web/src/app/(dashboard)/dashboard/page.tsx index 849917ff2..b6bad38a9 100644 --- a/apps/web/src/app/(dashboard)/dashboard/page.tsx +++ b/apps/web/src/app/(dashboard)/dashboard/page.tsx @@ -48,7 +48,7 @@ export default async function DashboardPage() {

Recent Documents

-
+
@@ -65,7 +65,7 @@ export default async function DashboardPage() { {document.title} diff --git a/apps/web/src/app/(dashboard)/documents/[id]/page.tsx b/apps/web/src/app/(dashboard)/documents/[id]/page.tsx index 40ee92e97..e84d463e4 100644 --- a/apps/web/src/app/(dashboard)/documents/[id]/page.tsx +++ b/apps/web/src/app/(dashboard)/documents/[id]/page.tsx @@ -45,7 +45,7 @@ export default async function DocumentPage({ params }: DocumentPageProps) { className="mt-4 max-w-xs truncate text-2xl font-semibold md:text-3xl" title={document.title} > - Document.pdf + {document.title} diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index b4af6d7e5..9ce82a4c0 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -3,6 +3,7 @@ import { Inter } from 'next/font/google'; import { TrpcProvider } from '@documenso/trpc/react'; import { Toaster } from '@documenso/ui/primitives/toaster'; +import { ThemeProvider } from '~/providers/next-theme'; import { PlausibleProvider } from '~/providers/plausible'; import './globals.css'; @@ -45,7 +46,9 @@ export default function RootLayout({ children }: { children: React.ReactNode }) - {children} + + {children} + diff --git a/apps/web/src/components/(dashboard)/document-dropzone/document-dropzone.tsx b/apps/web/src/components/(dashboard)/document-dropzone/document-dropzone.tsx index 2ce754e6c..c3c53d32e 100644 --- a/apps/web/src/components/(dashboard)/document-dropzone/document-dropzone.tsx +++ b/apps/web/src/components/(dashboard)/document-dropzone/document-dropzone.tsx @@ -2,6 +2,7 @@ import { Variants, motion } from 'framer-motion'; import { Plus } from 'lucide-react'; +import { useTheme } from 'next-themes'; import { useDropzone } from 'react-dropzone'; import { cn } from '@documenso/ui/lib/utils'; @@ -91,6 +92,8 @@ export const DocumentDropzone = ({ className, onDrop, ...props }: DocumentDropzo }, }); + const { theme } = useTheme(); + return ( @@ -111,39 +118,41 @@ export const DocumentDropzone = ({ className, onDrop, ...props }: DocumentDropzo {/* */}
-
-
-
+
+
+
-
-
-
+
+
+
-

Add a document

+

+ Add a document +

-

Drag & drop your document here.

+

Drag & drop your document here.

diff --git a/apps/web/src/components/(dashboard)/layout/desktop-nav.tsx b/apps/web/src/components/(dashboard)/layout/desktop-nav.tsx index 97851a534..d0927c323 100644 --- a/apps/web/src/components/(dashboard)/layout/desktop-nav.tsx +++ b/apps/web/src/components/(dashboard)/layout/desktop-nav.tsx @@ -16,17 +16,23 @@ export const DesktopNav = ({ className, ...props }: DesktopNavProps) => {