From 157cc68c8779e62e2812ea1fe331f514b25dda25 Mon Sep 17 00:00:00 2001 From: pdelfan Date: Wed, 22 Apr 2026 16:13:30 -0700 Subject: [PATCH] feat: create collection/card button on home --- .../components/recentCards/RecentCards.tsx | 37 ++++++++++----- .../recentCards/Skeleton.RecentCards.tsx | 5 +- .../recentCollections/RecentCollections.tsx | 46 +++++++++++++------ .../Skeleton.RecentCollections.tsx | 5 +- 4 files changed, 66 insertions(+), 27 deletions(-) diff --git a/src/webapp/features/home/components/recentCards/RecentCards.tsx b/src/webapp/features/home/components/recentCards/RecentCards.tsx index a2aa5769..5f15a813 100644 --- a/src/webapp/features/home/components/recentCards/RecentCards.tsx +++ b/src/webapp/features/home/components/recentCards/RecentCards.tsx @@ -6,6 +6,7 @@ import useMyCards from '@/features/cards/lib/queries/useMyCards'; import useMyProfile from '@/features/profile/lib/queries/useMyProfile'; import { useNavbarContext } from '@/providers/navbar'; import { + ActionIcon, Anchor, Button, Divider, @@ -36,13 +37,25 @@ export default function RecentCards() { Cards - - View all - + + setShowAddDrawer(true)} + aria-label="Add card" + > + + + + View all + + {cards.length > 0 ? ( @@ -104,13 +117,13 @@ export default function RecentCards() { - - setShowAddDrawer(false)} - /> )} + + setShowAddDrawer(false)} + /> ); } diff --git a/src/webapp/features/home/components/recentCards/Skeleton.RecentCards.tsx b/src/webapp/features/home/components/recentCards/Skeleton.RecentCards.tsx index f1ac8940..c2184915 100644 --- a/src/webapp/features/home/components/recentCards/Skeleton.RecentCards.tsx +++ b/src/webapp/features/home/components/recentCards/Skeleton.RecentCards.tsx @@ -10,7 +10,10 @@ export default function RecentCardsSkeleton() { Cards - + + + + diff --git a/src/webapp/features/home/components/recentCollections/RecentCollections.tsx b/src/webapp/features/home/components/recentCollections/RecentCollections.tsx index f447efed..df7293d1 100644 --- a/src/webapp/features/home/components/recentCollections/RecentCollections.tsx +++ b/src/webapp/features/home/components/recentCollections/RecentCollections.tsx @@ -4,7 +4,15 @@ import CollectionCard from '@/features/collections/components/collectionCard/Col import CreateCollectionDrawer from '@/features/collections/components/createCollectionDrawer/CreateCollectionDrawer'; import useMyCollections from '@/features/collections/lib/queries/useMyCollections'; import useMyProfile from '@/features/profile/lib/queries/useMyProfile'; -import { Stack, Button, Text, SimpleGrid, Group, Title } from '@mantine/core'; +import { + Stack, + Button, + Text, + SimpleGrid, + Group, + Title, + ActionIcon, +} from '@mantine/core'; import { Fragment, useState } from 'react'; import { BiCollection } from 'react-icons/bi'; import { FiPlus } from 'react-icons/fi'; @@ -26,13 +34,25 @@ export default function RecentCollections() { Collections - - View all - + + setShowCollectionDrawer(true)} + aria-label="Create collection" + > + + + + View all + + {collections.length > 0 ? ( @@ -64,13 +84,13 @@ export default function RecentCollections() { Create your first collection - - setShowCollectionDrawer(false)} - /> )} + + setShowCollectionDrawer(false)} + /> ); } diff --git a/src/webapp/features/home/components/recentCollections/Skeleton.RecentCollections.tsx b/src/webapp/features/home/components/recentCollections/Skeleton.RecentCollections.tsx index abba609c..e84c0e2e 100644 --- a/src/webapp/features/home/components/recentCollections/Skeleton.RecentCollections.tsx +++ b/src/webapp/features/home/components/recentCollections/Skeleton.RecentCollections.tsx @@ -10,7 +10,10 @@ export default function RecentCollectionsSkeleton() { Collections - + + + + -- knotmirror 0.0.1