From 12ae6bda935ca589adcc0b977d686827d1bef9a7 Mon Sep 17 00:00:00 2001 From: celine Date: Tue, 13 Jan 2026 14:39:46 -0500 Subject: [PATCH] fixed some layout with popover, now opens on tap rather than hover --- .../p/[didOrHandle]/ProfileHeader.tsx | 92 +++++++++++-------- .../p/[didOrHandle]/ProfileTabs.tsx | 2 +- components/ProfilePopover.tsx | 60 ++++++------ 3 files changed, 91 insertions(+), 63 deletions(-) diff --git a/app/(home-pages)/p/[didOrHandle]/ProfileHeader.tsx b/app/(home-pages)/p/[didOrHandle]/ProfileHeader.tsx index 459ef99c..45f08b90 100644 --- a/app/(home-pages)/p/[didOrHandle]/ProfileHeader.tsx +++ b/app/(home-pages)/p/[didOrHandle]/ProfileHeader.tsx @@ -1,8 +1,6 @@ "use client"; import { Avatar } from "components/Avatar"; -import { AppBskyActorProfile, PubLeafletPublication } from "lexicons/api"; -import { blobRefToSrc } from "src/utils/blobRefToSrc"; -import type { ProfileData } from "./layout"; +import { PubLeafletPublication } from "lexicons/api"; import { usePubTheme } from "components/ThemeManager/PublicationThemeProvider"; import { colorToString } from "components/ThemeManager/useColorAttribute"; import { PubIcon } from "components/ActionBar/Publications"; @@ -25,13 +23,13 @@ export const ProfileHeader = (props: { ); const displayNameElement = ( -

+

{profileRecord.displayName ? profileRecord.displayName : `@${props.profile.handle}`} @@ -40,20 +38,21 @@ export const ProfileHeader = (props: { const handleElement = profileRecord.displayName && (
@{props.profile.handle}
); + console.log(props.profile); return (
- -
-
+ {!props.popover && } +
+
{props.popover ? ( {avatarElement} @@ -61,30 +60,22 @@ export const ProfileHeader = (props: { ) : ( avatarElement )} - {props.popover ? ( - - {displayNameElement} - - ) : ( - displayNameElement - )} - {props.popover && handleElement ? ( - - {handleElement} - - ) : ( - handleElement - )} + {displayNameElement} + + {handleElement} + + +
+            {profileRecord.description
+              ? parseDescription(profileRecord.description)
+              : null}
+          
-
-          {profileRecord.description
-            ? parseDescription(profileRecord.description)
-            : null}
-        
-
+ +
@@ -104,7 +95,7 @@ export const ProfileHeader = (props: { const ProfileLinks = (props: { handle: string }) => { return ( -
+
+ {displayText} , ); @@ -241,3 +237,27 @@ function parseDescription(description: string): ReactNode[] { return parts; } + +const KnownFollowers = (props: { + viewer: ProfileViewDetailed["viewer"]; + did: string; +}) => { + if (!props.viewer?.knownFollowers) return null; + let count = props.viewer.knownFollowers.count; + + return ( + <> + + + ); +}; diff --git a/app/(home-pages)/p/[didOrHandle]/ProfileTabs.tsx b/app/(home-pages)/p/[didOrHandle]/ProfileTabs.tsx index 4609a0a1..c5b9e3a2 100644 --- a/app/(home-pages)/p/[didOrHandle]/ProfileTabs.tsx +++ b/app/(home-pages)/p/[didOrHandle]/ProfileTabs.tsx @@ -41,7 +41,7 @@ export const ProfileTabs = (props: { didOrHandle: string }) => { const bgColor = cardBorderHidden ? "var(--bg-leaflet)" : "var(--bg-page)"; return ( -
+
{ if (hoverTimeout.current) { window.clearTimeout(hoverTimeout.current); @@ -53,7 +52,7 @@ export const ProfilePopover = (props: { }} > {props.trigger} - +
} onOpenChange={setIsOpen} > @@ -66,33 +65,42 @@ export const ProfilePopover = (props: { publications={data.publications} popover /> - + +
) : (
Profile not found
)} - + ); }; -let KnownFollowers = (props: { - viewer: ProfileViewDetailed["viewer"]; - did: string; -}) => { - if (!props.viewer?.knownFollowers) return null; - let count = props.viewer.knownFollowers.count; +const ProfileLinks = (props: { handle: string }) => { return ( - <> -
- Followed by{" "} - - {props.viewer?.knownFollowers?.followers[0]?.displayName}{" "} - {count > 1 ? `and ${count - 1} other${count > 2 ? "s" : ""}` : ""} - - +
+
+
+
+ + + Bluesky + +
+ + Full profile + +
+
+ ); +}; + +const ProfileLink = (props: { children: React.ReactNode; href: string }) => { + return ( + + {props.children} + ); }; -- 2.51.2