From 64c417c1be2b7f5e09e2b7d69f4fe8b51c432db8 Mon Sep 17 00:00:00 2001 From: Gisbi Date: Wed, 2 Aug 2023 19:53:55 +0200 Subject: [PATCH] working on dark mode --- components/CollectionCard.tsx | 14 +++---- components/Dropdown.tsx | 4 +- components/LinkCard.tsx | 14 +++---- .../Modal/Collection/CollectionInfo.tsx | 12 +++--- components/Modal/Collection/index.tsx | 4 +- components/Modal/Link/AddOrEditLink.tsx | 18 ++++---- components/Modal/Link/index.tsx | 4 +- components/Modal/index.tsx | 6 +-- components/Navbar.tsx | 11 ++--- components/NoLinksFound.tsx | 8 ++-- components/ProfilePhoto.tsx | 2 +- components/RadioButton.tsx | 6 +-- components/RequiredBadge.tsx | 2 +- components/Search.tsx | 4 +- components/Sidebar.tsx | 42 +++++++++---------- components/SortDropdown.tsx | 4 +- components/SubmitButton.tsx | 2 +- components/ToggleDarkMode.tsx | 29 +++++++++++++ package.json | 1 + pages/_app.tsx | 5 ++- pages/collections/[id].tsx | 10 ++--- pages/collections/index.tsx | 16 +++---- pages/dashboard.tsx | 22 +++++----- pages/links.tsx | 8 ++-- styles/globals.css | 8 ++++ tailwind.config.js | 9 +++- yarn.lock | 5 +++ 27 files changed, 162 insertions(+), 108 deletions(-) create mode 100644 components/ToggleDarkMode.tsx diff --git a/components/CollectionCard.tsx b/components/CollectionCard.tsx index 9805f9c..8043e0e 100644 --- a/components/CollectionCard.tsx +++ b/components/CollectionCard.tsx @@ -32,24 +32,24 @@ export default function CollectionCard({ collection, className }: Props) { return (
setExpandDropdown(!expandDropdown)} id={"expand-dropdown" + collection.id} - className="inline-flex absolute top-5 right-5 rounded-md cursor-pointer hover:bg-slate-200 duration-100 p-1" + className="inline-flex absolute top-5 right-5 rounded-md cursor-pointer hover:bg-slate-200 hover:dark:bg-sky-800 duration-100 p-1" >
-

+

{collection.name}

@@ -73,11 +73,11 @@ export default function CollectionCard({ collection, className }: Props) { ) : null}
-
- +
+ {collection._count && collection._count.links}
-
+

{formattedDate}

diff --git a/components/Dropdown.tsx b/components/Dropdown.tsx index fa4c372..c20f180 100644 --- a/components/Dropdown.tsx +++ b/components/Dropdown.tsx @@ -25,13 +25,13 @@ export default function Dropdown({ onClickOutside, className, items }: Props) { return ( {items.map((e, i) => { const inner = e && (
-

{e.name}

+

{e.name}

); diff --git a/components/LinkCard.tsx b/components/LinkCard.tsx index 1f5dcd4..132392f 100644 --- a/components/LinkCard.tsx +++ b/components/LinkCard.tsx @@ -106,7 +106,7 @@ export default function LinkCard({ link, count, className }: Props) { return (
{(permissions === true || permissions?.canUpdate || @@ -114,7 +114,7 @@ export default function LinkCard({ link, count, className }: Props) {
setExpandDropdown(!expandDropdown)} id={"expand-dropdown" + link.id} - className="text-gray-500 inline-flex rounded-md cursor-pointer hover:bg-slate-200 absolute right-5 top-5 z-10 duration-100 p-1" + className="text-gray-500 dark:text-sky-400 inline-flex rounded-md cursor-pointer hover:bg-slate-200 absolute right-5 top-5 z-10 duration-100 p-1" >
-

{count + 1}.

-

+

{count + 1}.

+

{link.name || link.description}

@@ -168,16 +168,16 @@ export default function LinkCard({ link, count, className }: Props) { className="w-4 h-4 mt-1 drop-shadow" style={{ color: collection?.color }} /> -

+

{collection?.name}

-
+

{shortendURL}

-
+

{formattedDate}

diff --git a/components/Modal/Collection/CollectionInfo.tsx b/components/Modal/Collection/CollectionInfo.tsx index 94c711a..397037f 100644 --- a/components/Modal/Collection/CollectionInfo.tsx +++ b/components/Modal/Collection/CollectionInfo.tsx @@ -60,7 +60,7 @@ export default function CollectionInfo({
-

+

Name

@@ -72,11 +72,11 @@ export default function CollectionInfo({ } type="text" placeholder="e.g. Example Collection" - className="w-full rounded-md p-3 border-sky-100 border-solid border outline-none focus:border-sky-700 duration-100" + className="w-full rounded-md p-3 border-sky-100 dark:border-sky-800 dark:bg-blue-950 border-solid border outline-none focus:border-sky-700 duration-100" />
-

Icon Color

+

Icon Color

setCollection({ ...collection, color: "#0ea5e9" }) } @@ -101,9 +101,9 @@ export default function CollectionInfo({
-

Description

+

Description