From 9b064bbb1ee5687a929f04eec5efc5d6216e5e29 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 15 May 2023 21:59:51 +0330 Subject: [PATCH] visual changes improvements --- components/CollectionCard.tsx | 2 +- components/Dashboard/CollectionItem.tsx | 6 ++--- components/Dashboard/LinkItem.tsx | 6 ++--- components/Sidebar/index.tsx | 6 +++-- layouts/MainLayout.tsx | 6 ++--- lib/api/controllers/tags/getTags.ts | 5 ++++ pages/dashboard.tsx | 36 +++++++++++++++++++++---- 7 files changed, 49 insertions(+), 18 deletions(-) diff --git a/components/CollectionCard.tsx b/components/CollectionCard.tsx index 7b20782..4c7370b 100644 --- a/components/CollectionCard.tsx +++ b/components/CollectionCard.tsx @@ -21,7 +21,7 @@ export default function ({ collection }: { collection: ExtendedCollection }) {
-
+

{collection.name}

-
+ +
-
+

{collection.name}

{collection.description}

diff --git a/components/Dashboard/LinkItem.tsx b/components/Dashboard/LinkItem.tsx index fd4c34c..ec606b5 100644 --- a/components/Dashboard/LinkItem.tsx +++ b/components/Dashboard/LinkItem.tsx @@ -21,8 +21,6 @@ export default function ({ link: ExtendedLink; count: number; }) { - const [editModal, setEditModal] = useState(false); - const url = new URL(link.url); const formattedDate = new Date(link.createdAt).toLocaleString("en-US", { year: "numeric", @@ -31,7 +29,7 @@ export default function ({ }); return ( -
+
{ const target = e.target as HTMLElement; diff --git a/components/Sidebar/index.tsx b/components/Sidebar/index.tsx index 4ced79f..fe225fc 100644 --- a/components/Sidebar/index.tsx +++ b/components/Sidebar/index.tsx @@ -18,7 +18,7 @@ import Link from "next/link"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; -export default function () { +export default function ({ className }: { className?: string }) { const { collections } = useCollectionStore(); const { tags } = useTagStore(); @@ -31,7 +31,9 @@ export default function () { }, [router]); return ( -
+

Linkwarden

diff --git a/layouts/MainLayout.tsx b/layouts/MainLayout.tsx index 4bb28f8..2cfe01a 100644 --- a/layouts/MainLayout.tsx +++ b/layouts/MainLayout.tsx @@ -24,11 +24,11 @@ export default function ({ children }: Props) { if (status === "authenticated" && !redirect && routeExists) return (
-
- +
+
-
+
{children}
diff --git a/lib/api/controllers/tags/getTags.ts b/lib/api/controllers/tags/getTags.ts index 7e73dea..07bf3bb 100644 --- a/lib/api/controllers/tags/getTags.ts +++ b/lib/api/controllers/tags/getTags.ts @@ -39,6 +39,11 @@ export default async function (userId: number) { ], }, }, + orderBy: { + links: { + _count: "desc", + }, + }, }); return { response: tags, status: 200 }; diff --git a/pages/dashboard.tsx b/pages/dashboard.tsx index 393ca83..c66b89e 100644 --- a/pages/dashboard.tsx +++ b/pages/dashboard.tsx @@ -67,12 +67,12 @@ export default function () {
-
-
+
+

Recently added Links

-
+
View All -
+

Top Collections

-
+
View All ))}
+ +
+
+

Top Tags

+ +
+ View All + +
+ +
+
+ {tags.slice(0, 19).map((e, i) => ( + + # {e.name} + + ))} +
+