minor improvement

This commit is contained in:
daniel31x13
2024-11-07 07:32:06 -05:00
parent 2993347dc7
commit cbf93dcf06
3 changed files with 14 additions and 11 deletions
@@ -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 ? (
<>
<Link
href={`/collections/${link.collection.id}`}
@@ -40,7 +45,5 @@ export default function LinkCollection({
<p className="truncate capitalize">{collection?.name}</p>
</Link>
</>
) : (
<></>
);
) : null;
}