⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.
TypeScript bookmarkbookmark-managercollaborationnextjsreact-nativeread-it-laterself-hostedtypescript
replaced link outer component with <Link> tag for better accessibility
daniel31x1329e0370808c8
diff --git a/components/LinkViews/LinkCard.tsx b/components/LinkViews/LinkCard.tsxindex 232a0262..78544460 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">- <div className="relative rounded-t-2xl h-40 overflow-hidden">- {previewAvailable(link) ? (- <Image- src={`/api/v1/archives/${link.id}?format=${ArchivedFormat.jpeg}&preview=true`}- width={1280}- height={720}- alt=""- className="rounded-t-2xl select-none object-cover z-10 h-40 w-full shadow opacity-80 scale-105"- style={{ filter: "blur(2px)" }}- draggable="false"- onError={(e) => {- const target = e.target as HTMLElement;- target.style.display = "none";- }}- />- ) : link.preview === "unavailable" ? (- <div className="bg-gray-50 duration-100 h-40 bg-opacity-80"></div>- ) : (- <div className="duration-100 h-40 bg-opacity-80 skeleton rounded-none"></div>- )}- <div- style={- {- // background:- // "radial-gradient(circle, rgba(255, 255, 255, 0.5), transparent)",+ <Link+ href={link.url || ""}+ target="_blank"+ className="rounded-2xl cursor-pointer"+ >+ <div className="relative rounded-t-2xl h-40 overflow-hidden">+ {previewAvailable(link) ? (+ <Image+ src={`/api/v1/archives/${link.id}?format=${ArchivedFormat.jpeg}&preview=true`}+ width={1280}+ height={720}+ alt=""+ className="rounded-t-2xl select-none object-cover z-10 h-40 w-full shadow opacity-80 scale-105"+ style={{ filter: "blur(2px)" }}+ draggable="false"+ onError={(e) => {+ const target = e.target as HTMLElement;+ target.style.display = "none";+ }}+ />+ ) : link.preview === "unavailable" ? (+ <div className="bg-gray-50 duration-100 h-40 bg-opacity-80"></div>+ ) : (+ <div className="duration-100 h-40 bg-opacity-80 skeleton rounded-none"></div>+ )}+ <div+ style={+ {+ // background:+ // "radial-gradient(circle, rgba(255, 255, 255, 0.5), transparent)",+ }}- }- className="absolute top-0 left-0 right-0 bottom-0 rounded-t-2xl flex items-center justify-center shadow rounded-md"- >- <LinkIcon link={link} />+ className="absolute top-0 left-0 right-0 bottom-0 rounded-t-2xl flex items-center justify-center shadow rounded-md"+ >+ <LinkIcon link={link} />+ </div>+ </div>++ <hr className="divider my-0 last:hidden border-t border-neutral-content h-[1px]" />++ <div className="p-3 mt-1">+ <p className="truncate w-full pr-8 text-primary">+ {unescapeString(link.name || link.description) || link.url}+ </p>++ <Link+ href={link.url || ""}+ target="_blank"+ title={link.url || ""}+ className="w-fit"+ >+ <div className="flex gap-1 item-center select-none text-neutral mt-1">+ <i className="bi-link-45deg text-lg mt-[0.15rem] leading-none"></i>+ <p className="text-sm truncate">{shortendURL}</p>+ </div>+ </Link></div>- </div>-- <hr className="divider my-0 last:hidden border-t border-neutral-content h-[1px]" />-- <div className="p-3 mt-1">- <p className="truncate w-full pr-8 text-primary">- {unescapeString(link.name || link.description) || link.url}- </p>-- <Link- href={link.url || ""}- target="_blank"- title={link.url || ""}- className="w-fit"- >- <div className="flex gap-1 item-center select-none text-neutral mt-1 hover:opacity-60 duration-100">- <i className="bi-link-45deg text-lg mt-[0.15rem] leading-none"></i>- <p className="text-sm truncate">{shortendURL}</p>++ <hr className="divider mt-2 mb-1 last:hidden border-t border-neutral-content h-[1px]" />++ <div className="flex justify-between text-xs text-neutral px-3 pb-1">+ <div className="cursor-pointer w-fit">+ {collection ? (+ <LinkCollection link={link} collection={collection} />+ ) : undefined}</div>- </Link>- </div>-- <hr className="divider mt-2 mb-1 last:hidden border-t border-neutral-content h-[1px]" />- <div className="flex justify-between text-xs text-neutral px-3 pb-1">- <div className="cursor-pointer w-fit">- {collection ? (- <LinkCollection link={link} collection={collection} />- ) : undefined}+ <LinkDate link={link} /></div>- <LinkDate link={link} />- </div>+ </Link>{showInfo ? (<div className="p-3 absolute z-30 top-0 left-0 right-0 bottom-0 bg-base-200 rounded-2xl fade-in overflow-y-auto">diff --git a/components/LinkViews/LinkComponents/LinkCollection.tsx b/components/LinkViews/LinkComponents/LinkCollection.tsxindex 7ca8ad1d..35b85b95 100644--- a/components/LinkViews/LinkComponents/LinkCollection.tsx+++ b/components/LinkViews/LinkComponents/LinkCollection.tsx@@ -17,7 +17,7 @@ export default function LinkCollection({return (<divonClick={(e) => {- 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.tsxindex fc5d7d76..e4a91b01 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`}>- <div- onClick={() => link.url && window.open(link.url || "", "_blank")}+ <Link+ href={link.url || ""}+ target="_blank"className="flex items-center cursor-pointer py-3 px-3"><div className="shrink-0">@@ -91,7 +92,7 @@ export default function LinkCardCompact({ link, count, className }: Props) {<LinkDate link={link} /></div></div>- </div>+ </Link><LinkActionslink={link}diff --git a/components/SettingsSidebar.tsx b/components/SettingsSidebar.tsxindex 79b1eabc..140057bd 100644--- a/components/SettingsSidebar.tsx+++ b/components/SettingsSidebar.tsx@@ -4,7 +4,7 @@ import { useRouter } from "next/router";import React, { useEffect, useState } from "react";export default function SettingsSidebar({ className }: { className?: string }) {- const LINKWARDEN_VERSION = "v2.4.5";+ const LINKWARDEN_VERSION = "v2.4.6";const { collections } = useCollectionStore();diff --git a/lib/api/controllers/dashboard/getDashboardData.ts b/lib/api/controllers/dashboard/getDashboardData.tsindex c75f9c00..b4dfbb09 100644--- a/lib/api/controllers/dashboard/getDashboardData.ts+++ b/lib/api/controllers/dashboard/getDashboardData.ts@@ -14,7 +14,7 @@ export default async function getDashboardData(else if (query.sort === Sort.DescriptionZA) order = { description: "desc" };const pinnedLinks = await prisma.link.findMany({- take: 6,+ take: 8,where: {AND: [{diff --git a/package.json b/package.jsonindex 5a6b24e8..f157c163 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "linkwarden",- "version": "2.4.5",+ "version": "2.4.6","main": "index.js","repository": "https://github.com/linkwarden/linkwarden.git","author": "Daniel31X13 <[email protected]>",