From 1bb5c4b760f05cfdf71d5720fe488e30a20e20d7 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Fri, 12 Dec 2025 11:25:52 +0400 Subject: [PATCH] add publications --- app/p/[didOrHandle]/ProfilePageLayout.tsx | 51 +++++++++++++++++++++-- app/p/[didOrHandle]/page.tsx | 6 ++- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/app/p/[didOrHandle]/ProfilePageLayout.tsx b/app/p/[didOrHandle]/ProfilePageLayout.tsx index 41603216..aa7bf38d 100644 --- a/app/p/[didOrHandle]/ProfilePageLayout.tsx +++ b/app/p/[didOrHandle]/ProfilePageLayout.tsx @@ -6,10 +6,14 @@ import { ProfileTabs, TabContent } from "./ProfileTabs/Tabs"; import { Json } from "supabase/database.types"; import { ProfileViewDetailed } from "@atproto/api/dist/client/types/app/bsky/actor/defs"; import { Avatar } from "components/Avatar"; -import { AppBskyActorProfile } from "lexicons/api"; +import { AppBskyActorProfile, PubLeafletPublication } from "lexicons/api"; import { blobRefToSrc } from "src/utils/blobRefToSrc"; +import { PubIcon } from "components/ActionBar/Publications"; +import { usePubTheme } from "components/ThemeManager/PublicationThemeProvider"; +import { colorToString } from "components/ThemeManager/useColorAttribute"; export const ProfilePageLayout = (props: { + publications: { record: Json; uri: string }[]; profile: { did: string; handle: string | null; @@ -29,7 +33,12 @@ export const ProfilePageLayout = (props: { defaultTab="home" tabs={{ home: { - content: , + content: ( + + ), controls: null, }, }} @@ -41,6 +50,7 @@ export const ProfilePageLayout = (props: { export type profileTabsType = "posts" | "comments" | "subscriptions"; const ProfilePageContent = (props: { + publications: { record: Json; uri: string }[]; profile: { did: string; handle: string | null; @@ -83,8 +93,13 @@ const ProfilePageContent = (props: { )}
{profileRecord.description}
-
pub 1
-
pub 2
+ {props.publications.map((p) => ( + + ))}
@@ -95,3 +110,31 @@ const ProfilePageContent = (props: { const PubListingCompact = () => { return
; }; + +const PublicationCard = (props: { + record: PubLeafletPublication.Record; + uri: string; +}) => { + const { record, uri } = props; + const { bgLeaflet, bgPage } = usePubTheme(record.theme); + + return ( + +
+ +

{record.name}

+
+
+ ); +}; diff --git a/app/p/[didOrHandle]/page.tsx b/app/p/[didOrHandle]/page.tsx index c7117b2e..4dddf229 100644 --- a/app/p/[didOrHandle]/page.tsx +++ b/app/p/[didOrHandle]/page.tsx @@ -31,6 +31,10 @@ export default async function ProfilePage(props: { .select(`*`) .eq("did", did) .single(); + let { data: pubs } = await supabaseServerClient + .from("publications") + .select("*") + .eq("identity_did", did); - return ; + return ; } -- 2.54.0