From 2fd21c8219157910f9682f44500ea6c2bc1e3af7 Mon Sep 17 00:00:00 2001 From: daniel31x13 Date: Thu, 30 Nov 2023 06:55:37 -0500 Subject: [PATCH] redesigned link collection page --- pages/collections/[id].tsx | 242 ++++++++++++++++++++----------------- 1 file changed, 128 insertions(+), 114 deletions(-) diff --git a/pages/collections/[id].tsx b/pages/collections/[id].tsx index 2c6b2ab..7330b32 100644 --- a/pages/collections/[id].tsx +++ b/pages/collections/[id].tsx @@ -73,34 +73,34 @@ export default function Index() { return ( -
-
-
- {activeCollection && ( -
-
- -

- {activeCollection?.name} -

-
+
+
+ {activeCollection && ( +
+
+ +

+ {activeCollection?.name} +

- )} +
+ )} +
- {activeCollection ? ( + {activeCollection ? ( +
+
@@ -141,101 +141,115 @@ export default function Index() {
) : null}
- ) : undefined} +

+ By {collectionOwner.name} + {activeCollection.members.length > 0 + ? ` and ${activeCollection.members.length} others` + : undefined} + . +

+
+ ) : undefined} -
-

{activeCollection?.description}

-
- -
-
-
- -
-
    - {permissions === true ? ( -
  • -
    { - (document?.activeElement as HTMLElement)?.blur(); - activeCollection && - setModal({ - modal: "COLLECTION", - state: true, - method: "UPDATE", - isOwner: permissions === true, - active: activeCollection, - }); - }} - > - Edit Collection Info -
    -
  • - ) : undefined} -
  • -
    { - (document?.activeElement as HTMLElement)?.blur(); - activeCollection && - setModal({ - modal: "COLLECTION", - state: true, - method: "UPDATE", - isOwner: permissions === true, - active: activeCollection, - defaultIndex: permissions === true ? 1 : 0, - }); - }} - > - {permissions === true - ? "Share and Collaborate" - : "View Team"} -
    -
  • -
  • -
    { - (document?.activeElement as HTMLElement)?.blur(); - activeCollection && - setModal({ - modal: "COLLECTION", - state: true, - method: "UPDATE", - isOwner: permissions === true, - active: activeCollection, - defaultIndex: permissions === true ? 2 : 1, - }); - }} - > - {permissions === true - ? "Delete Collection" - : "Leave Collection"} -
    -
  • -
+ {activeCollection?.description ? ( +

{activeCollection?.description}

+ ) : undefined} + +
+ +
+

Listing {activeCollection?._count?.links} Bookmarks

+
+ +
+
+
+
+
    + {permissions === true ? ( +
  • +
    { + (document?.activeElement as HTMLElement)?.blur(); + activeCollection && + setModal({ + modal: "COLLECTION", + state: true, + method: "UPDATE", + isOwner: permissions === true, + active: activeCollection, + }); + }} + > + Edit Collection Info +
    +
  • + ) : undefined} +
  • +
    { + (document?.activeElement as HTMLElement)?.blur(); + activeCollection && + setModal({ + modal: "COLLECTION", + state: true, + method: "UPDATE", + isOwner: permissions === true, + active: activeCollection, + defaultIndex: permissions === true ? 1 : 0, + }); + }} + > + {permissions === true + ? "Share and Collaborate" + : "View Team"} +
    +
  • +
  • +
    { + (document?.activeElement as HTMLElement)?.blur(); + activeCollection && + setModal({ + modal: "COLLECTION", + state: true, + method: "UPDATE", + isOwner: permissions === true, + active: activeCollection, + defaultIndex: permissions === true ? 2 : 1, + }); + }} + > + {permissions === true + ? "Delete Collection" + : "Leave Collection"} +
    +
  • +
+ {links.some((e) => e.collectionId === Number(router.query.id)) ? (
{links