From b473716237eca5a98ae2708b72e104af91011567 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 25 May 2023 05:17:18 +0330 Subject: [PATCH] even more visual improvements --- components/CollectionCard.tsx | 48 +++--- components/Modal/AddCollection.tsx | 244 +++++++++++++-------------- components/Modal/EditCollection.tsx | 246 ++++++++++++++-------------- components/Navbar.tsx | 2 +- pages/collections/index.tsx | 4 +- 5 files changed, 281 insertions(+), 263 deletions(-) diff --git a/components/CollectionCard.tsx b/components/CollectionCard.tsx index 4c7370b..2052f13 100644 --- a/components/CollectionCard.tsx +++ b/components/CollectionCard.tsx @@ -19,7 +19,7 @@ export default function ({ collection }: { collection: ExtendedCollection }) { return ( -
+

{collection.name}

@@ -30,25 +30,33 @@ export default function ({ collection }: { collection: ExtendedCollection }) {

{collection.description}

-
-

Members:

- {collection.members.map((e, i) => { - return ( -

- {e.user.name} -

- ); - })} -
-
-

{formattedDate}

-

- {links.filter((e) => e.collectionId === collection.id).length} Links -

+
+
+ {collection.members + .map((e, i) => { + return ( + + ); + }) + .reverse() + .slice(0, 3)} + {collection.members.length - 3 > 0 ? ( +
+ +{collection.members.length - 3} +
+ ) : null} +
+
+

+ {links.filter((e) => e.collectionId === collection.id).length}{" "} + Links +

+

{formattedDate}

+
diff --git a/components/Modal/AddCollection.tsx b/components/Modal/AddCollection.tsx index d33f653..a6e8b3c 100644 --- a/components/Modal/AddCollection.tsx +++ b/components/Modal/AddCollection.tsx @@ -120,129 +120,133 @@ export default function AddCollection({ toggleCollectionModal }: Props) {

) : null} - {newCollection.members.map((e, i) => { - return ( -
- { - const updatedMembers = newCollection.members.filter( - (member) => { - return member.email !== e.email; - } - ); - setNewCollection({ - ...newCollection, - members: updatedMembers, - }); - }} - /> -
- + {newCollection.members.map((e, i) => { + return ( +
+ { + const updatedMembers = newCollection.members.filter( + (member) => { + return member.email !== e.email; + } + ); + setNewCollection({ + ...newCollection, + members: updatedMembers, + }); + }} /> -
-

{e.name}

-

{e.email}

+
+ +
+

{e.name}

+

{e.email}

+
+
+
+
+

Permissions

+

+ (Click to toggle.) +

+
+ +
+ + + + + +
-
-
-

Permissions

-

(Click to toggle.)

-
- -
- - - - - -
-
-
- ); - })} + ); + })} +
) : null} - {activeCollection.members.map((e, i) => { - return ( -
- { - const updatedMembers = activeCollection.members.filter( - (member) => { - return member.user.email !== e.user.email; - } - ); - setActiveCollection({ - ...activeCollection, - members: updatedMembers, - }); - }} - /> -
- + {activeCollection.members.map((e, i) => { + return ( +
+ { + const updatedMembers = activeCollection.members.filter( + (member) => { + return member.user.email !== e.user.email; + } + ); + setActiveCollection({ + ...activeCollection, + members: updatedMembers, + }); + }} /> -
-

{e.user.name}

-

{e.user.email}

+
+ +
+

+ {e.user.name} +

+

{e.user.email}

+
+
+
+
+

Permissions

+

+ (Click to toggle.) +

+
+ +
+ + + + + +
-
-
-

Permissions

-

(Click to toggle.)

-
- -
- - - - - -
-
-
- ); - })} + ); + })} +
) : ( diff --git a/pages/collections/index.tsx b/pages/collections/index.tsx index b6bd6fc..4a7feb3 100644 --- a/pages/collections/index.tsx +++ b/pages/collections/index.tsx @@ -188,13 +188,13 @@ export default function () {
-
+
{sortedCollections.map((e, i) => { return ; })}

New Collection