diff --git a/src/webapp/app/(authenticated)/profile/[handle]/(withHeader)/cards/error.tsx b/src/webapp/app/(authenticated)/profile/[handle]/(withHeader)/cards/error.tsx index e3f17e99..1f8b2e54 100644 --- a/src/webapp/app/(authenticated)/profile/[handle]/(withHeader)/cards/error.tsx +++ b/src/webapp/app/(authenticated)/profile/[handle]/(withHeader)/cards/error.tsx @@ -1,7 +1,7 @@ 'use client'; -import MyCardsContainerError from '@/features/cards/containers/myCardsContainer/Error.MyCardsContainer'; +import CardsContainerError from '@/features/cards/containers/cardsContainer/Error.CardsContainer'; export default function Error() { - return ; + return ; } diff --git a/src/webapp/app/(authenticated)/profile/[handle]/(withHeader)/cards/loading.tsx b/src/webapp/app/(authenticated)/profile/[handle]/(withHeader)/cards/loading.tsx index c239fa0b..ba1a33cc 100644 --- a/src/webapp/app/(authenticated)/profile/[handle]/(withHeader)/cards/loading.tsx +++ b/src/webapp/app/(authenticated)/profile/[handle]/(withHeader)/cards/loading.tsx @@ -1,5 +1,5 @@ -import MyCardsContainerSkeleton from '@/features/cards/containers/myCardsContainer/Skeleton.MyCardsContainer'; +import CardsContainerSkeleton from '@/features/cards/containers/cardsContainer/Skeleton.CardsContainer'; export default function Loading() { - return ; + return ; } diff --git a/src/webapp/app/(authenticated)/profile/[handle]/(withHeader)/cards/page.tsx b/src/webapp/app/(authenticated)/profile/[handle]/(withHeader)/cards/page.tsx index 95a37df3..f61d6281 100644 --- a/src/webapp/app/(authenticated)/profile/[handle]/(withHeader)/cards/page.tsx +++ b/src/webapp/app/(authenticated)/profile/[handle]/(withHeader)/cards/page.tsx @@ -1,5 +1,11 @@ -import MyCardsContainer from '@/features/cards/containers/myCardsContainer/MyCardsContainer'; +import CardsContainer from '@/features/cards/containers/cardsContainer/CardsContainer'; -export default function Page() { - return ; +interface Props { + params: Promise<{ handle: string }>; +} + +export default async function Page(props: Props) { + const { handle } = await props.params; + + return ; } diff --git a/src/webapp/features/cards/containers/myCardsContainer/MyCardsContainer.tsx b/src/webapp/features/cards/containers/cardsContainer/CardsContainer.tsx similarity index 81% rename from src/webapp/features/cards/containers/myCardsContainer/MyCardsContainer.tsx rename to src/webapp/features/cards/containers/cardsContainer/CardsContainer.tsx index f1c7efd8..f891867a 100644 --- a/src/webapp/features/cards/containers/myCardsContainer/MyCardsContainer.tsx +++ b/src/webapp/features/cards/containers/cardsContainer/CardsContainer.tsx @@ -1,15 +1,19 @@ 'use client'; import { Container, Grid, Stack, Button, Text, Center } from '@mantine/core'; -import useMyCards from '../../lib/queries/useMyCards'; +import useCards from '../../lib/queries/useCards'; import UrlCard from '@/features/cards/components/urlCard/UrlCard'; -import MyCardsContainerError from './Error.MyCardsContainer'; -import MyCardsContainerSkeleton from './Skeleton.MyCardsContainer'; +import CardsContainerError from './Error.CardsContainer'; +import CardsContainerSkeleton from './Skeleton.CardsContainer'; import { Fragment, useState } from 'react'; import ProfileEmptyTab from '@/features/profile/components/profileEmptyTab/ProfileEmptyTab'; import { FaRegNoteSticky } from 'react-icons/fa6'; -export default function MyCardsContainer() { +interface Props { + handle: string; +} + +export default function CardsContainer(props: Props) { const { data, error, @@ -17,16 +21,16 @@ export default function MyCardsContainer() { hasNextPage, isFetchingNextPage, isPending, - } = useMyCards(); + } = useCards({ didOrHandle: props.handle }); const allCards = data?.pages.flatMap((page) => page.cards ?? []) ?? []; if (isPending) { - return ; + return ; } if (error) { - return ; + return ; } if (allCards.length === 0) { diff --git a/src/webapp/features/cards/containers/myCardsContainer/Error.MyCardsContainer.tsx b/src/webapp/features/cards/containers/cardsContainer/Error.CardsContainer.tsx similarity index 67% rename from src/webapp/features/cards/containers/myCardsContainer/Error.MyCardsContainer.tsx rename to src/webapp/features/cards/containers/cardsContainer/Error.CardsContainer.tsx index 7392b291..84be9582 100644 --- a/src/webapp/features/cards/containers/myCardsContainer/Error.MyCardsContainer.tsx +++ b/src/webapp/features/cards/containers/cardsContainer/Error.CardsContainer.tsx @@ -1,5 +1,5 @@ import { Alert } from '@mantine/core'; -export default function MyCardsContainerError() { +export default function CardsContainerError() { return ; } diff --git a/src/webapp/features/cards/containers/myCardsContainer/Skeleton.MyCardsContainer.tsx b/src/webapp/features/cards/containers/cardsContainer/Skeleton.CardsContainer.tsx similarity index 89% rename from src/webapp/features/cards/containers/myCardsContainer/Skeleton.MyCardsContainer.tsx rename to src/webapp/features/cards/containers/cardsContainer/Skeleton.CardsContainer.tsx index dff579de..8ba1d842 100644 --- a/src/webapp/features/cards/containers/myCardsContainer/Skeleton.MyCardsContainer.tsx +++ b/src/webapp/features/cards/containers/cardsContainer/Skeleton.CardsContainer.tsx @@ -1,7 +1,7 @@ import { Container, Grid, GridCol, Stack } from '@mantine/core'; import UrlCardSkeleton from '../../components/urlCard/Skeleton.UrlCard'; -export default function MyCardsContainerSkeleton() { +export default function CardsContainerSkeleton() { return ( diff --git a/src/webapp/features/profile/containers/profileContainer/ProfileContainer.tsx b/src/webapp/features/profile/containers/profileContainer/ProfileContainer.tsx index a89e4195..5d75fcb9 100644 --- a/src/webapp/features/profile/containers/profileContainer/ProfileContainer.tsx +++ b/src/webapp/features/profile/containers/profileContainer/ProfileContainer.tsx @@ -66,6 +66,7 @@ export default function ProfileContainer(props: Props) { cardContent={card.cardContent} note={card.note} collections={card.collections} + authorHandle={props.handle} /> ))}