This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

feat: connections tab on collections page

+83 -10
+7
src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/connections/error.tsx
··· 1 + 'use client'; 2 + 3 + import ConnectionsContainerError from '@/features/connections/containers/connectionsContainer/Error.ConnectionsContainer'; 4 + 5 + export default function Error() { 6 + return <ConnectionsContainerError />; 7 + }
+42
src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/connections/layout.tsx
··· 1 + import { getCollectionPageByAtUri } from '@/features/collections/lib/dal'; 2 + 3 + import type { Metadata } from 'next'; 4 + 5 + interface Props { 6 + params: Promise<{ rkey: string; handle: string }>; 7 + children: React.ReactNode; 8 + } 9 + 10 + export async function generateMetadata({ params }: Props): Promise<Metadata> { 11 + const { rkey, handle } = await params; 12 + 13 + const collection = await getCollectionPageByAtUri({ 14 + recordKey: rkey, 15 + handle: handle, 16 + }); 17 + 18 + return { 19 + title: `${collection.name}'s connections`, 20 + description: 21 + collection.description ?? 22 + `See connections for ${collection.name}`, 23 + authors: [ 24 + { 25 + name: collection.author.name, 26 + url: `${process.env.APP_URL}/profile/${handle}`, 27 + }, 28 + ], 29 + alternates: { 30 + types: { 31 + '': `${collection.uri}`, 32 + }, 33 + }, 34 + other: { 35 + 'atprotocol:creator': `at://${collection.author.id}`, 36 + }, 37 + }; 38 + } 39 + 40 + export default function Layout(props: Props) { 41 + return props.children; 42 + }
+5
src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/connections/loading.tsx
··· 1 + import ConnectionsContainerSkeleton from '@/features/connections/containers/connectionsContainer/Skeleton.ConnectionsContainer'; 2 + 3 + export default function Loading() { 4 + return <ConnectionsContainerSkeleton />; 5 + }
+18
src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/connections/page.tsx
··· 1 + import ConnectionsContainer from '@/features/connections/containers/connectionsContainer/ConnectionsContainer'; 2 + import { Container } from '@mantine/core'; 3 + 4 + interface Props { 5 + params: Promise<{ handle: string; rkey: string }>; 6 + } 7 + 8 + export default async function Page({ params }: Props) { 9 + const { handle, rkey } = await params; 10 + const appUrl = process.env.NEXT_PUBLIC_APP_URL ?? 'http://127.0.0.1:4000'; 11 + const url = `${appUrl}/profile/${handle}/collections/${rkey}`; 12 + 13 + return ( 14 + <Container p="xs" size="xl"> 15 + <ConnectionsContainer url={url} /> 16 + </Container> 17 + ); 18 + }
+3
src/webapp/features/collections/components/collectionTabs/CollectionTabs.tsx
··· 31 31 <TabItem value="mentions" href={`${basePath}/mentions`}> 32 32 Mentions 33 33 </TabItem> 34 + <TabItem value="connections" href={`${basePath}/connections`}> 35 + Connections 36 + </TabItem> 34 37 <TabItem value="followers" href={`${basePath}/followers`}> 35 38 Followers 36 39 </TabItem>
+4 -6
src/webapp/features/connections/containers/connectionsContainer/Error.ConnectionsContainer.tsx
··· 1 - import { Stack, Text } from '@mantine/core'; 1 + import { Alert, Container } from '@mantine/core'; 2 2 3 3 export default function ConnectionsContainerError() { 4 4 return ( 5 - <Stack align="center" justify="center" py={'xl'}> 6 - <Text c={'red'} fw={600}> 7 - Failed to load connections 8 - </Text> 9 - </Stack> 5 + <Container p="xs" size="xl"> 6 + <Alert color="red" title="Could not load connections" /> 7 + </Container> 10 8 ); 11 9 }
+3 -3
src/webapp/features/connections/containers/connectionsContainer/Skeleton.ConnectionsContainer.tsx
··· 1 - import { Grid, Group, Skeleton, Stack } from '@mantine/core'; 1 + import { Grid, GridCol, Group, Skeleton, Stack } from '@mantine/core'; 2 2 3 3 export default function ConnectionsContainerSkeleton() { 4 4 return ( ··· 9 9 </Group> 10 10 <Grid gap="xl" mx={'auto'} maw={600} w={'100%'}> 11 11 {[...Array(3)].map((_, i) => ( 12 - <Grid.Col key={i} span={12}> 12 + <GridCol key={i} span={12}> 13 13 <Stack gap={'xs'}> 14 14 <Skeleton height={80} radius={'lg'} /> 15 15 <Skeleton height={200} radius={'lg'} /> 16 16 </Stack> 17 - </Grid.Col> 17 + </GridCol> 18 18 ))} 19 19 </Grid> 20 20 </Stack>
+1 -1
src/webapp/next-env.d.ts
··· 1 1 /// <reference types="next" /> 2 2 /// <reference types="next/image-types/global" /> 3 - import "./.next/dev/types/routes.d.ts"; 3 + import "./.next/types/routes.d.ts"; 4 4 5 5 // NOTE: This file should not be edited 6 6 // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.