From da8e28fdc09bfae229aa10d85e15616959da5a9c Mon Sep 17 00:00:00 2001 From: franco sanchez Date: Tue, 17 Dec 2024 14:34:40 -0300 Subject: [PATCH] chore: a responsive menu has been created in collections --- src/components/nav/menu/MenuProfile.tsx | 11 +- .../skeletons/SkeletonDCollection.tsx | 8 +- src/components/ui/MySimpleGrid.tsx | 2 +- src/pages/{ => profile}/Favorites.tsx | 0 .../profile/collections/AllCollections.tsx | 108 +++++++++--------- .../profile/collections/CollectionDetail.tsx | 33 +++++- src/routes.tsx | 2 +- 7 files changed, 103 insertions(+), 61 deletions(-) rename src/pages/{ => profile}/Favorites.tsx (100%) diff --git a/src/components/nav/menu/MenuProfile.tsx b/src/components/nav/menu/MenuProfile.tsx index 4bc07cf..6e276c2 100644 --- a/src/components/nav/menu/MenuProfile.tsx +++ b/src/components/nav/menu/MenuProfile.tsx @@ -11,6 +11,7 @@ import { MenuItem, MenuGroup, MenuDivider, + Tag, } from '@chakra-ui/react'; import { useAccountActions } from '@hooks/useAccountActions'; @@ -61,14 +62,20 @@ export function MenuProfile({ displayName, photoURL, username }: MenuType) { to='/my-collections' _hover={{ textDecoration: 'none' }} > - Mis colecciones + Mis colecciones{' '} + + Nuevo 😮 + - Mis favoritos + Mis favoritos{' '} + + Nuevo 😮 + - + + diff --git a/src/components/ui/MySimpleGrid.tsx b/src/components/ui/MySimpleGrid.tsx index aa31cb6..4922aaf 100644 --- a/src/components/ui/MySimpleGrid.tsx +++ b/src/components/ui/MySimpleGrid.tsx @@ -3,7 +3,7 @@ import { SimpleGrid, useColorModeValue } from '@chakra-ui/react'; interface SimpleGridType { width?: string; - gap?: number; + gap?: number | object; children: React.ReactNode; } diff --git a/src/pages/Favorites.tsx b/src/pages/profile/Favorites.tsx similarity index 100% rename from src/pages/Favorites.tsx rename to src/pages/profile/Favorites.tsx diff --git a/src/pages/profile/collections/AllCollections.tsx b/src/pages/profile/collections/AllCollections.tsx index 65f22a4..cbbdd68 100644 --- a/src/pages/profile/collections/AllCollections.tsx +++ b/src/pages/profile/collections/AllCollections.tsx @@ -67,68 +67,74 @@ export function AllCollections() { ); } else { collectionsUI = ( - - {data?.collections.map(({ id, name, createdAt }) => ( - <> - - - - - - - - {name} - - - {parseDate(createdAt)} + + {data?.collections + .sort( + (a, b) => + new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime(), + ) + .map(({ id, name, createdAt }) => ( + <> + + + + + + + + {name} + + + {parseDate(createdAt)} + - - - - Abrir - - - + + Abrir + + + + - - - ))} + + ))} ); } return ( <> + - + - - +