⚡️⚡️⚡️ 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
minor improvement
daniel31x13cbf93dcf061a
diff --git a/components/LinkViews/LinkComponents/LinkCard.tsx b/components/LinkViews/LinkComponents/LinkCard.tsxindex d92a6877..43331b1a 100644--- a/components/LinkViews/LinkComponents/LinkCard.tsx+++ b/components/LinkViews/LinkComponents/LinkCard.tsx@@ -113,8 +113,7 @@ export default function LinkCard({ link, columns, editMode }: Props) {const permissions = usePermissions(collection?.id as number);const router = useRouter();-- let isPublic = router.pathname.startsWith("/public") ? true : undefined;+ const isPublicRoute = router.pathname.startsWith("/public") ? true : false;useEffect(() => {let interval: NodeJS.Timeout | null = null;@@ -125,7 +124,10 @@ export default function LinkCard({ link, columns, editMode }: Props) {link.preview !== "unavailable") {interval = setInterval(async () => {- getLink.mutateAsync({ id: link.id as number, isPublicRoute: isPublic });+ getLink.mutateAsync({+ id: link.id as number,+ isPublicRoute: isPublicRoute,+ });}, 5000);}@@ -146,8 +148,6 @@ export default function LinkCard({ link, columns, editMode }: Props) {editMode &&(permissions === true || permissions?.canCreate || permissions?.canDelete);- const isPublicRoute = router.pathname.startsWith("/public") ? true : false;-return (<divref={ref}@@ -220,7 +220,7 @@ export default function LinkCard({ link, columns, editMode }: Props) {<hr className="divider mt-2 mb-1 last:hidden border-t border-neutral-content h-[1px]" /><div className="flex justify-between items-center text-xs text-neutral px-3 pb-1 gap-2">- {show.collection && (+ {show.collection && !isPublicRoute && (<div className="cursor-pointer truncate"><LinkCollection link={link} collection={collection} /></div>diff --git a/components/LinkViews/LinkComponents/LinkCollection.tsx b/components/LinkViews/LinkComponents/LinkCollection.tsxindex fdc29397..885a0159 100644--- a/components/LinkViews/LinkComponents/LinkCollection.tsx+++ b/components/LinkViews/LinkComponents/LinkCollection.tsx@@ -5,6 +5,7 @@ import {} from "@/types/global";import { IconWeight } from "@phosphor-icons/react";import Link from "next/link";+import { useRouter } from "next/router";import React from "react";export default function LinkCollection({@@ -14,7 +15,11 @@ export default function LinkCollection({link: LinkIncludingShortenedCollectionAndTags;collection: CollectionIncludingMembersAndLinkCount;}) {- return collection?.name ? (+ const router = useRouter();++ const isPublicRoute = router.pathname.startsWith("/public") ? true : false;++ return !isPublicRoute && collection?.name ? (<><Linkhref={`/collections/${link.collection.id}`}@@ -40,7 +45,5 @@ export default function LinkCollection({<p className="truncate capitalize">{collection?.name}</p></Link></>- ) : (- <></>- );+ ) : null;}diff --git a/components/LinkViews/LinkComponents/LinkMasonry.tsx b/components/LinkViews/LinkComponents/LinkMasonry.tsxindex eba17792..2b501ea8 100644--- a/components/LinkViews/LinkComponents/LinkMasonry.tsx+++ b/components/LinkViews/LinkComponents/LinkMasonry.tsx@@ -232,7 +232,7 @@ export default function LinkMasonry({ link, editMode, columns }: Props) {<hr className="divider mt-2 mb-1 last:hidden border-t border-neutral-content h-[1px]" /><div className="flex flex-wrap justify-between items-center text-xs text-neutral px-3 pb-1 w-full gap-x-2">- {show.collection && (+ {!isPublic && show.collection && (<div className="cursor-pointer truncate"><LinkCollection link={link} collection={collection} /></div>