A React component library for rendering common AT Protocol records for applications such as Bluesky and Leaflet.

fix pronouns if fetching from appview, fix borders

Changed files
+24 -4
lib
+8 -1
lib/components/BlueskyPost.tsx
···
* Depth of this post in a thread (0 = root, 1 = first reply, etc.).
*/
threadDepth?: number;
+
/**
+
* Whether to show border even when in thread context.
+
*/
+
showThreadBorder?: boolean;
};
export const BLUESKY_POST_COLLECTION = "app.bsky.feed.post";
···
width: "100%",
background: "var(--atproto-color-bg)",
position: "relative",
+
borderRadius: "12px",
+
overflow: "hidden"
};
const parentPostStyle: React.CSSProperties = {
···
iconPlacement={iconPlacement}
showIcon={showIcon}
atUri={atUri}
-
isInThread={true} // Always true for posts rendered in this component
+
isInThread
threadDepth={showParent ? 1 : 0}
+
showThreadBorder={!showParent && !!props.record?.reply?.parent}
/>
);
};
+11
lib/hooks/useBlueskyAppview.ts
···
avatar?: string;
banner?: string;
createdAt?: string;
+
pronouns?: string;
+
website?: string;
[key: string]: unknown;
}
···
description: profile.description,
createdAt: profile.createdAt,
};
+
+
// Add pronouns and website if they exist
+
if (profile.pronouns) {
+
record.pronouns = profile.pronouns;
+
}
+
+
if (profile.website) {
+
record.website = profile.website;
+
}
if (profile.avatar && avatarCid) {
const avatarBlob: BlobWithCdn = {
+5 -3
lib/renderers/BlueskyPostRenderer.tsx
···
isInThread?: boolean;
threadDepth?: number;
isQuotePost?: boolean;
+
showThreadBorder?: boolean;
}
export const BlueskyPostRenderer: React.FC<BlueskyPostRendererProps> = ({
···
atUri,
isInThread = false,
threadDepth = 0,
-
isQuotePost = false
+
isQuotePost = false,
+
showThreadBorder = false
}) => {
void threadDepth;
···
const cardStyle: React.CSSProperties = {
...baseStyles.card,
-
border: (isInThread && !isQuotePost) ? "none" : `1px solid var(--atproto-color-border)`,
+
border: (isInThread && !isQuotePost && !showThreadBorder) ? "none" : `1px solid var(--atproto-color-border)`,
background: `var(--atproto-color-bg)`,
color: `var(--atproto-color-text)`,
-
borderRadius: (isInThread && !isQuotePost) ? "0" : "12px",
+
borderRadius: (isInThread && !isQuotePost && !showThreadBorder) ? "0" : "12px",
...(iconPlacement === "cardBottomRight" && showIcon && !isInThread
? { paddingBottom: cardPadding + 16 }
: {}),