From 29e0370808c87ba9016a368ebe477edceea7f51d Mon Sep 17 00:00:00 2001 From: daniel31x13 Date: Sun, 31 Dec 2023 10:05:30 -0500 Subject: [PATCH] replaced link outer component with tag for better accessibility --- components/LinkViews/LinkCard.tsx | 125 +++++++++--------- .../LinkComponents/LinkCollection.tsx | 2 +- components/LinkViews/LinkList.tsx | 7 +- components/SettingsSidebar.tsx | 2 +- .../controllers/dashboard/getDashboardData.ts | 2 +- package.json | 2 +- 6 files changed, 74 insertions(+), 66 deletions(-) diff --git a/components/LinkViews/LinkCard.tsx b/components/LinkViews/LinkCard.tsx index 232a026..7854446 100644 --- a/components/LinkViews/LinkCard.tsx +++ b/components/LinkViews/LinkCard.tsx @@ -81,68 +81,75 @@ export default function LinkGrid({ link, count, className }: Props) { ref={ref} className="border border-solid border-neutral-content bg-base-200 shadow-md hover:shadow-none duration-100 rounded-2xl relative" > -
- {previewAvailable(link) ? ( - { - const target = e.target as HTMLElement; - target.style.display = "none"; - }} - /> - ) : link.preview === "unavailable" ? ( -
- ) : ( -
- )} -
+
+ {previewAvailable(link) ? ( + { + const target = e.target as HTMLElement; + target.style.display = "none"; + }} + /> + ) : link.preview === "unavailable" ? ( +
+ ) : ( +
+ )} +
- -
-
- -
- -
-

- {unescapeString(link.name || link.description) || link.url} -

- - -
- -

{shortendURL}

+ className="absolute top-0 left-0 right-0 bottom-0 rounded-t-2xl flex items-center justify-center shadow rounded-md" + > +
- -
- -
-
-
- {collection ? ( - - ) : undefined}
- -
+ +
+ +
+

+ {unescapeString(link.name || link.description) || link.url} +

+ + +
+ +

{shortendURL}

+
+ +
+ +
+ +
+
+ {collection ? ( + + ) : undefined} +
+ +
+ {showInfo ? (
diff --git a/components/LinkViews/LinkComponents/LinkCollection.tsx b/components/LinkViews/LinkComponents/LinkCollection.tsx index 7ca8ad1..35b85b9 100644 --- a/components/LinkViews/LinkComponents/LinkCollection.tsx +++ b/components/LinkViews/LinkComponents/LinkCollection.tsx @@ -17,7 +17,7 @@ export default function LinkCollection({ return (
{ - e.stopPropagation(); + e.preventDefault(); router.push(`/collections/${link.collection.id}`); }} className="flex items-center gap-1 max-w-full w-fit hover:opacity-70 duration-100" diff --git a/components/LinkViews/LinkList.tsx b/components/LinkViews/LinkList.tsx index fc5d7d7..e4a91b0 100644 --- a/components/LinkViews/LinkList.tsx +++ b/components/LinkViews/LinkList.tsx @@ -55,8 +55,9 @@ export default function LinkCardCompact({ link, count, className }: Props) { !showInfo ? "hover:bg-base-300" : "" } duration-200 rounded-lg`} > -
link.url && window.open(link.url || "", "_blank")} +
@@ -91,7 +92,7 @@ export default function LinkCardCompact({ link, count, className }: Props) {
-
+ ",