From ca000e78653b41605eaae538bc93f08edeb4dd67 Mon Sep 17 00:00:00 2001 From: vineyardbovines Date: Fri, 28 Aug 2026 13:40:37 -0400 Subject: [PATCH] Match feed known likers design --- src/components/Post/KnownLikers.tsx | 47 +++++++++++++++++++++++------ src/view/com/posts/PostFeedItem.tsx | 1 + 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/components/Post/KnownLikers.tsx b/src/components/Post/KnownLikers.tsx index 7a10e91d19..6af6e26f90 100644 --- a/src/components/Post/KnownLikers.tsx +++ b/src/components/Post/KnownLikers.tsx @@ -1,7 +1,7 @@ import {View} from 'react-native' import {AtUri} from '@atproto/syntax' import {moderateProfile} from '@bsky/sdk/moderation' -import {Trans, useLingui} from '@lingui/react/macro' +import {Plural, Trans, useLingui} from '@lingui/react/macro' import {makeProfileLink} from '#/lib/routes/links' import {sanitizeDisplayName} from '#/lib/strings/display-names' @@ -14,8 +14,6 @@ import {Text} from '#/components/Typography' import {type Features, useAnalytics} from '#/analytics' import {type app} from '#/lexicons' -const AVI_SIZE = 20 - /** * Social proof for a post. When the viewer follows some of the post's recent * likers, renders a face pile plus "Liked by A and B". Renders nothing when @@ -24,9 +22,11 @@ const AVI_SIZE = 20 export function KnownLikers({ post, feature, + variant = 'thread', }: { post: app.bsky.feed.defs.PostView feature: Features + variant?: 'feed' | 'thread' }) { const t = useTheme() const {t: l} = useLingui() @@ -65,10 +65,17 @@ export function KnownLikers({ ), })) const rowLabel = - names.length >= 2 - ? l`Liked by ${names[0].displayName} and ${names[1].displayName}` - : l`Liked by ${names[0].displayName}` - const textStyle = [a.text_sm, t.atoms.text_contrast_medium] + variant === 'feed' + ? likeCount > 1 + ? l`${names[0].displayName} and ${likeCount - 1} others liked this` + : l`${names[0].displayName} liked this` + : names.length >= 2 + ? l`Liked by ${names[0].displayName} and ${names[1].displayName}` + : l`Liked by ${names[0].displayName}` + const textStyle = [ + variant === 'feed' ? a.text_xs : a.text_sm, + t.atoms.text_contrast_medium, + ] const nameStyle = [a.text_sm, a.font_semi_bold, t.atoms.text] const nameLink = (name: (typeof names)[number]) => ( @@ -89,11 +96,31 @@ export function KnownLikers({ ax.metric('post:likedBy:click', {})}> - + - {names.length >= 2 ? ( + {variant === 'feed' ? ( + likeCount > 1 ? ( + + {names[0].displayName} and{' '} + {' '} + liked this + + ) : ( + + {names[0].displayName} liked this + + ) + ) : names.length >= 2 ? ( Liked by {nameLink(names[0])} and {nameLink(names[1])} diff --git a/src/view/com/posts/PostFeedItem.tsx b/src/view/com/posts/PostFeedItem.tsx index d0c0f32617..b2a1a4fbc4 100644 --- a/src/view/com/posts/PostFeedItem.tsx +++ b/src/view/com/posts/PostFeedItem.tsx @@ -448,6 +448,7 @@ let FeedItemInner = ({