diff --git a/src/webapp/features/cards/containers/myCardsContainer/MyCardsContainer.tsx b/src/webapp/features/cards/containers/myCardsContainer/MyCardsContainer.tsx index c00f59f1..f1c7efd8 100644 --- a/src/webapp/features/cards/containers/myCardsContainer/MyCardsContainer.tsx +++ b/src/webapp/features/cards/containers/myCardsContainer/MyCardsContainer.tsx @@ -3,10 +3,11 @@ import { Container, Grid, Stack, Button, Text, Center } from '@mantine/core'; import useMyCards from '../../lib/queries/useMyCards'; import UrlCard from '@/features/cards/components/urlCard/UrlCard'; -import AddCardDrawer from '../../components/addCardDrawer/AddCardDrawer'; import MyCardsContainerError from './Error.MyCardsContainer'; import MyCardsContainerSkeleton from './Skeleton.MyCardsContainer'; import { Fragment, useState } from 'react'; +import ProfileEmptyTab from '@/features/profile/components/profileEmptyTab/ProfileEmptyTab'; +import { FaRegNoteSticky } from 'react-icons/fa6'; export default function MyCardsContainer() { const { @@ -18,8 +19,6 @@ export default function MyCardsContainer() { isPending, } = useMyCards(); - const [showAddDrawer, setShowAddDrawer] = useState(false); - const allCards = data?.pages.flatMap((page) => page.cards ?? []) ?? []; if (isPending) { @@ -30,54 +29,47 @@ export default function MyCardsContainer() { return ; } + if (allCards.length === 0) { + return ( + + + + ); + } + return ( - {allCards.length > 0 ? ( - - - {allCards.map((card) => ( - - - - ))} - + + + {allCards.map((card) => ( + + + + ))} + - {hasNextPage && ( -
- -
- )} -
- ) : ( - - - No cards - - setShowAddDrawer(false)} - /> - - )} + {hasNextPage && ( +
+ +
+ )} +
); diff --git a/src/webapp/features/collections/containers/collectionsContainer/CollectionsContainer.tsx b/src/webapp/features/collections/containers/collectionsContainer/CollectionsContainer.tsx index 28f14bc3..37fcd8f2 100644 --- a/src/webapp/features/collections/containers/collectionsContainer/CollectionsContainer.tsx +++ b/src/webapp/features/collections/containers/collectionsContainer/CollectionsContainer.tsx @@ -12,6 +12,8 @@ import useCollections from '../../lib/queries/useCollections'; import CollectionCard from '../../components/collectionCard/CollectionCard'; import CreateCollectionDrawer from '../../components/createCollectionDrawer/CreateCollectionDrawer'; import { useState } from 'react'; +import ProfileEmptyTab from '@/features/profile/components/profileEmptyTab/ProfileEmptyTab'; +import { BiCollection } from 'react-icons/bi'; export default function CollectionsContainer() { const { data, fetchNextPage, hasNextPage, isFetchingNextPage } = @@ -22,39 +24,40 @@ export default function CollectionsContainer() { const collections = data?.pages.flatMap((page) => page.collections ?? []) ?? []; + if (collections.length === 0) { + return ( + + + + ); + } + return ( - {collections.length > 0 ? ( - - - {collections.map((collection) => ( - - ))} - + + + {collections.map((collection) => ( + + ))} + - {hasNextPage && ( -
- -
- )} -
- ) : ( - - - No collections - - - )} + {hasNextPage && ( +
+ +
+ )} +
+ )
+ + + + + + {props.message} + + + {props.button} + + ); +} diff --git a/src/webapp/features/profile/containers/profileContainer/ProfileContainer.tsx b/src/webapp/features/profile/containers/profileContainer/ProfileContainer.tsx index d11577c3..00c8050a 100644 --- a/src/webapp/features/profile/containers/profileContainer/ProfileContainer.tsx +++ b/src/webapp/features/profile/containers/profileContainer/ProfileContainer.tsx @@ -15,6 +15,9 @@ import { Grid, } from '@mantine/core'; import Link from 'next/link'; +import ProfileEmptyTab from '../../components/profileEmptyTab/ProfileEmptyTab'; +import { BiCollection } from 'react-icons/bi'; +import { FaRegNoteSticky } from 'react-icons/fa6'; interface Props { handle: string; @@ -68,11 +71,7 @@ export default function ProfileContainer(props: Props) { ))} ) : ( - - - No cards - - + )} @@ -99,11 +98,7 @@ export default function ProfileContainer(props: Props) { ))} ) : ( - - - No collections - - + )}