diff --git a/src/webapp/features/cards/containers/myCardsContainer/MyCardsContainer.tsx b/src/webapp/features/cards/containers/myCardsContainer/MyCardsContainer.tsx index de11e7dd..5438b9f7 100644 --- a/src/webapp/features/cards/containers/myCardsContainer/MyCardsContainer.tsx +++ b/src/webapp/features/cards/containers/myCardsContainer/MyCardsContainer.tsx @@ -1,14 +1,6 @@ 'use client'; -import { - Container, - Grid, - Stack, - Title, - Button, - Text, - Center, -} from '@mantine/core'; +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 { BiPlus } from 'react-icons/bi'; @@ -42,8 +34,6 @@ export default function MyCardsContainer() { return ( - Cards - {allCards.length > 0 ? ( diff --git a/src/webapp/features/cards/containers/myCardsContainer/Skeleton.MyCardsContainer.tsx b/src/webapp/features/cards/containers/myCardsContainer/Skeleton.MyCardsContainer.tsx index 8833b93c..dff579de 100644 --- a/src/webapp/features/cards/containers/myCardsContainer/Skeleton.MyCardsContainer.tsx +++ b/src/webapp/features/cards/containers/myCardsContainer/Skeleton.MyCardsContainer.tsx @@ -1,12 +1,10 @@ -import { Container, Grid, GridCol, Stack, Title } from '@mantine/core'; +import { Container, Grid, GridCol, Stack } from '@mantine/core'; import UrlCardSkeleton from '../../components/urlCard/Skeleton.UrlCard'; export default function MyCardsContainerSkeleton() { return ( - Cards - {Array.from({ length: 8 }).map((_, i) => ( diff --git a/src/webapp/features/collections/containers/collectionsContainer/CollectionsContainer.tsx b/src/webapp/features/collections/containers/collectionsContainer/CollectionsContainer.tsx index d7ee22c3..46e65f87 100644 --- a/src/webapp/features/collections/containers/collectionsContainer/CollectionsContainer.tsx +++ b/src/webapp/features/collections/containers/collectionsContainer/CollectionsContainer.tsx @@ -4,7 +4,6 @@ import { Button, Container, Stack, - Title, Text, SimpleGrid, Center, @@ -27,8 +26,6 @@ export default function CollectionsContainer() { return ( - Collections - {collections.length > 0 ? ( diff --git a/src/webapp/features/collections/containers/collectionsContainer/Skeleton.CollectionsContainer.tsx b/src/webapp/features/collections/containers/collectionsContainer/Skeleton.CollectionsContainer.tsx index 46d27025..80c19255 100644 --- a/src/webapp/features/collections/containers/collectionsContainer/Skeleton.CollectionsContainer.tsx +++ b/src/webapp/features/collections/containers/collectionsContainer/Skeleton.CollectionsContainer.tsx @@ -1,12 +1,10 @@ -import { Container, SimpleGrid, Stack, Title } from '@mantine/core'; +import { Container, SimpleGrid, Stack } from '@mantine/core'; import CollectionCardSkeleton from '../../components/collectionCard/Skeleton.CollectionCard'; export default function CollectionsContainerSkeleton() { return ( - Collections - {Array.from({ length: 4 }).map((_, i) => ( diff --git a/src/webapp/features/profile/components/profileHeader/ProfileHeader.tsx b/src/webapp/features/profile/components/profileHeader/ProfileHeader.tsx index bacf3ae6..a9e4e5a1 100644 --- a/src/webapp/features/profile/components/profileHeader/ProfileHeader.tsx +++ b/src/webapp/features/profile/components/profileHeader/ProfileHeader.tsx @@ -8,8 +8,10 @@ import { Text, Title, Button, + ActionIcon, } from '@mantine/core'; import { FaBluesky } from 'react-icons/fa6'; +import ProfileTabs from '../profileTabs/ProfileTabs'; interface Props { handle: string; @@ -47,16 +49,19 @@ export default async function ProfileHeader(props: Props) { {data.description && {data.description}} - + + + ); diff --git a/src/webapp/features/profile/components/profileTabs/ProfileTabs.tsx b/src/webapp/features/profile/components/profileTabs/ProfileTabs.tsx new file mode 100644 index 00000000..69b75846 --- /dev/null +++ b/src/webapp/features/profile/components/profileTabs/ProfileTabs.tsx @@ -0,0 +1,33 @@ +'use client'; + +import { Tabs } from '@mantine/core'; +import TabItem from './TabItem'; +import { usePathname } from 'next/navigation'; + +interface Props { + handle: string; +} + +export default function ProfileTabs(props: Props) { + const pathname = usePathname(); + const currentTab = pathname.split('/').slice(3, 4).join('/') || 'profile'; + + return ( + + + + Profile + + + Cards + + + Collections + + + + ); +} diff --git a/src/webapp/features/profile/components/profileTabs/TabItem.module.css b/src/webapp/features/profile/components/profileTabs/TabItem.module.css new file mode 100644 index 00000000..3d16909e --- /dev/null +++ b/src/webapp/features/profile/components/profileTabs/TabItem.module.css @@ -0,0 +1,11 @@ +.tab { + color: var(--mantine-color-dark-2); /* Inactive tab color */ + + @mixin hover { + color: var(--mantine-color-dark); + } +} + +.tab[data-active] { + color: var(--mantine-color-dark); /* Active tab color */ +} diff --git a/src/webapp/features/profile/components/profileTabs/TabItem.tsx b/src/webapp/features/profile/components/profileTabs/TabItem.tsx new file mode 100644 index 00000000..06046d4e --- /dev/null +++ b/src/webapp/features/profile/components/profileTabs/TabItem.tsx @@ -0,0 +1,25 @@ +import { Tabs } from '@mantine/core'; +import { useRouter } from 'next/navigation'; +import classes from './TabItem.module.css'; + +interface Props { + value: string; + href: string; + children: string; +} + +export default function TabItem(props: Props) { + const router = useRouter(); + + return ( + router.push(props.href)} + className={classes.tab} + color="dark" + fw={600} + > + {props.children} + + ); +} diff --git a/src/webapp/styles/theme.tsx b/src/webapp/styles/theme.tsx index 1b554bfd..75487246 100644 --- a/src/webapp/styles/theme.tsx +++ b/src/webapp/styles/theme.tsx @@ -1,5 +1,6 @@ 'use client'; +import TabItem from '@/features/profile/components/profileTabs/TabItem'; import { Avatar, Button, @@ -9,6 +10,7 @@ import { Modal, NavLink, Spoiler, + TabsTab, } from '@mantine/core'; export const theme = createTheme({ @@ -111,5 +113,11 @@ export const theme = createTheme({ }, }, }), + TabsTab: TabsTab.extend({ + defaultProps: { + fw: 500, + fz: 'md', + }, + }), }, });