Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

Sub-collections shown on collection page

Katie Bohnenkamper179cd18ac5ee
diff --git a/components/CollectionCard.tsx b/components/CollectionCard.tsx
index 4ff96774..4d4f5aa3 100644
--- a/components/CollectionCard.tsx
+++ b/components/CollectionCard.tsx
@@ -166,7 +166,7 @@ export default function CollectionCard({
}}
className="card card-compact shadow-md hover:shadow-none duration-200 border border-neutral-content"
>
- <div className="card-body flex flex-col justify-between min-h-[12rem]">
+ <div className="card-body flex flex-col justify-between min-h-[12rem] min-w-[12rem]">
<div className="flex justify-between">
<p className="card-title break-words line-clamp-2 w-full">
{collection.name}
diff --git a/components/LinkViews/LinkComponents/LinkCollection.tsx b/components/LinkViews/LinkComponents/LinkCollection.tsx
index 885a0159..24698843 100644
--- a/components/LinkViews/LinkComponents/LinkCollection.tsx
+++ b/components/LinkViews/LinkComponents/LinkCollection.tsx
@@ -9,10 +9,8 @@ import { useRouter } from "next/router";
import React from "react";
export default function LinkCollection({
- link,
collection,
}: {
- link: LinkIncludingShortenedCollectionAndTags;
collection: CollectionIncludingMembersAndLinkCount;
}) {
const router = useRouter();
@@ -22,24 +20,24 @@ export default function LinkCollection({
return !isPublicRoute && collection?.name ? (
<>
<Link
- href={`/collections/${link.collection.id}`}
+ href={`/collections/${collection.id}`}
onClick={(e) => {
e.stopPropagation();
}}
className="flex items-center gap-1 max-w-full w-fit hover:opacity-70 duration-100 select-none"
title={collection?.name}
>
- {link.collection.icon ? (
+ {collection.icon ? (
<Icon
- icon={link.collection.icon}
+ icon={collection.icon}
size={20}
- weight={(link.collection.iconWeight || "regular") as IconWeight}
- color={link.collection.color}
+ weight={(collection.iconWeight || "regular") as IconWeight}
+ color={collection.color}
/>
) : (
<i
className="bi-folder-fill text-lg"
- style={{ color: link.collection.color }}
+ style={{ color: collection.color }}
></i>
)}
<p className="truncate capitalize">{collection?.name}</p>
diff --git a/pages/collections/[id].tsx b/pages/collections/[id].tsx
index 07804df3..11c1204a 100644
--- a/pages/collections/[id].tsx
+++ b/pages/collections/[id].tsx
@@ -25,7 +25,7 @@ import { useUser } from "@/hooks/store/user";
import { useLinks } from "@/hooks/store/links";
import Links from "@/components/LinkViews/Links";
import Icon from "@/components/Icon";
-import { IconWeight } from "@phosphor-icons/react";
+import CollectionCard from "@/components/CollectionCard";
export default function Index() {
const { t } = useTranslation();
@@ -283,30 +283,18 @@ export default function Index() {
<p>{activeCollection?.description}</p>
)}
- {/* {collections.some((e) => e.parentId === activeCollection.id) ? (
- <fieldset className="border rounded-md p-2 border-neutral-content">
+ {collections.some((e) => e.parentId === activeCollection?.id) ? (
+ <fieldset className="rounded-md p-2 border-neutral-content">
<legend className="text-sm ml-2">Sub-Collections</legend>
- <div className="flex gap-3">
+ <div className="grid-cols-8 grid gap-5">
{collections
.filter((e) => e.parentId === activeCollection?.id)
.map((e, i) => {
- return (
- <Link
- key={i}
- className="flex gap-1 items-center btn btn-ghost btn-sm"
- href={`/collections/${e.id}`}
- >
- <i
- className="bi-folder-fill text-2xl drop-shadow"
- style={{ color: e.color }}
- ></i>
- <p className="text-xs">{e.name}</p>
- </Link>
- );
+ return <CollectionCard key={i} collection={e} />;
})}
</div>
</fieldset>
- ) : undefined} */}
+ ) : undefined}
<div className="divider my-0"></div>