From f131ce5ecbea1baa6c8be2b3f62533c081c0f957 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 30 Aug 2024 11:29:20 -0500 Subject: [PATCH] Add dataSet to new Text comp, wrap metrics parents --- src/components/Link.tsx | 3 ++- src/screens/Profile/Header/Metrics.tsx | 24 ++++++++---------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/components/Link.tsx b/src/components/Link.tsx index 054a543c19..335ea0bced 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -237,7 +237,7 @@ export function Link({ } export type InlineLinkProps = React.PropsWithChildren< - BaseLinkProps & TextStyleProp & Pick + BaseLinkProps & TextStyleProp & Pick > & Pick & { disableUnderline?: boolean @@ -317,6 +317,7 @@ export function InlineLinkText({ dataSet: { // default to no underline, apply this ourselves noUnderline: '1', + ...(rest.dataSet || {}), }, })}> {children} diff --git a/src/screens/Profile/Header/Metrics.tsx b/src/screens/Profile/Header/Metrics.tsx index 68b5e12e93..6620dd19c0 100644 --- a/src/screens/Profile/Header/Metrics.tsx +++ b/src/screens/Profile/Header/Metrics.tsx @@ -45,12 +45,9 @@ export function ProfileHeaderMetrics({ testID="profileHeaderFollowersButton" style={[a.flex_row, t.atoms.text]} to={makeProfileLink(profile, 'followers')} - label={`${followers} ${pluralizedFollowers}`}> - - {followers}{' '} - + label={`${followers} ${pluralizedFollowers}`} + dataSet={tooltipFormattedCountIfNeeded(profile.followersCount || 0)}> + {followers} {pluralizedFollowers} @@ -59,20 +56,15 @@ export function ProfileHeaderMetrics({ testID="profileHeaderFollowsButton" style={[a.flex_row, t.atoms.text]} to={makeProfileLink(profile, 'follows')} - label={_(msg`${following} following`)}> - - {following}{' '} - + label={_(msg`${following} following`)} + dataSet={tooltipFormattedCountIfNeeded(profile.followsCount || 0)}> + {following} {pluralizedFollowings} - - + + {formatCount(i18n, profile.postsCount || 0)}{' '}