From fab9a06d955d4de9492428c7c9d5788554d7145f Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 31 Aug 2023 00:00:57 -0400 Subject: [PATCH] minor improvements --- components/NoLinksFound.tsx | 24 +++++++++++++----------- components/Search.tsx | 2 +- hooks/useLinks.tsx | 2 +- pages/dashboard.tsx | 8 ++++---- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/components/NoLinksFound.tsx b/components/NoLinksFound.tsx index 5a2de2d..97b8dce 100644 --- a/components/NoLinksFound.tsx +++ b/components/NoLinksFound.tsx @@ -3,17 +3,19 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import React from "react"; import useModalStore from "@/store/modals"; -export default function NoLinksFound() { +type Props = { + text?: string; +}; + +export default function NoLinksFound({ text }: Props) { const { setModal } = useModalStore(); return ( -
-

- You haven't created any Links Here +

+

+ {text || "You haven't created any Links Here"}

-
-
-

Start by creating a

{" "} +
{ setModal({ @@ -22,14 +24,14 @@ export default function NoLinksFound() { method: "CREATE", }); }} - className="inline-flex gap-1 relative w-[7.2rem] items-center font-semibold select-none cursor-pointer p-2 px-3 rounded-full text-white bg-sky-700 dark:bg-sky-400 hover:bg-sky-600 duration-100 group" + className="inline-flex gap-1 relative w-[11.4rem] items-center font-semibold select-none cursor-pointer p-2 px-3 rounded-full dark:hover:bg-sky-600 text-white bg-sky-700 hover:bg-sky-600 duration-100 group" > - - New Link + + Create New Link
diff --git a/components/Search.tsx b/components/Search.tsx index bc140c3..4034a7c 100644 --- a/components/Search.tsx +++ b/components/Search.tsx @@ -44,7 +44,7 @@ export default function Search() { router.push("/search/" + encodeURIComponent(searchQuery)) } autoFocus={searchBox} - className="border border-sky-100 bg-gray-50 dark:border-neutral-700 focus:border-sky-300 dark:focus:border-sky-600 rounded-md pl-10 py-2 pr-2 w-44 sm:w-60 dark:hover:border-neutral-600 md:focus:w-80 hover:border-sky-300 duration-100 outline-none dark:bg-neutral-950" + className="border border-sky-100 bg-gray-50 dark:border-neutral-700 focus:border-sky-300 dark:focus:border-sky-600 rounded-md pl-10 py-2 pr-2 w-44 sm:w-60 dark:hover:border-neutral-600 md:focus:w-80 hover:border-sky-300 duration-100 outline-none dark:bg-neutral-800" />
); diff --git a/hooks/useLinks.tsx b/hooks/useLinks.tsx index 5de86e3..1d4ebf6 100644 --- a/hooks/useLinks.tsx +++ b/hooks/useLinks.tsx @@ -12,7 +12,7 @@ export default function useLinks( pinnedOnly, collectionId, tagId, - }: Omit = { sort: 0 } + }: LinkRequestQuery = { sort: 0 } ) { const { links, setLinks, resetLinks } = useLinkStore(); const router = useRouter(); diff --git a/pages/dashboard.tsx b/pages/dashboard.tsx index d6209c1..63c4e4a 100644 --- a/pages/dashboard.tsx +++ b/pages/dashboard.tsx @@ -61,7 +61,7 @@ export default function Dashboard() {
-
+

{numberOfLinks}

@@ -70,7 +70,7 @@ export default function Dashboard() {

-
+

{collections.length}

@@ -79,7 +79,7 @@ export default function Dashboard() {

-
+

{tags.length}

@@ -127,7 +127,7 @@ export default function Dashboard() { ))}
) : ( -
+

No Pinned Links