From 0dda77db1e19f75fedf7bca1d5b5fd6c5f5d912f Mon Sep 17 00:00:00 2001 From: daniel31x13 Date: Mon, 19 Feb 2024 16:16:53 -0500 Subject: [PATCH] minor improvement --- components/CollectionListing.tsx | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/components/CollectionListing.tsx b/components/CollectionListing.tsx index cb66b14..a8d580b 100644 --- a/components/CollectionListing.tsx +++ b/components/CollectionListing.tsx @@ -84,14 +84,24 @@ const CollectionItem = ({ }, [isActiveOrParentOfActive]); return hasChildren ? ( -
- +
+
-
- - {hasChildren && ( -
+
+ {isOpen && hasChildren && ( +
{collections .filter((e) => e.parentId === collection.id) .map((subCollection) => ( @@ -129,7 +138,7 @@ const CollectionItem = ({ ))}
)} -
+ ) : (