Add pressed state to profile counts

This commit is contained in:
Dan Abramov
2024-02-08 22:08:32 +00:00
parent 06f81d6948
commit 65c1d44cac
+27 -23
View File
@@ -28,7 +28,7 @@ import {UserBanner} from '../util/UserBanner'
import {ProfileHeaderAlerts} from '../util/moderation/ProfileHeaderAlerts' import {ProfileHeaderAlerts} from '../util/moderation/ProfileHeaderAlerts'
import {formatCount} from '../util/numeric/format' import {formatCount} from '../util/numeric/format'
import {NativeDropdown, DropdownItem} from '../util/forms/NativeDropdown' import {NativeDropdown, DropdownItem} from '../util/forms/NativeDropdown'
import {Link} from '../util/Link' import {TextLink} from '../util/Link'
import {ProfileHeaderSuggestedFollows} from './ProfileHeaderSuggestedFollows' import {ProfileHeaderSuggestedFollows} from './ProfileHeaderSuggestedFollows'
import {useModalControls} from '#/state/modals' import {useModalControls} from '#/state/modals'
import {useLightboxControls, ProfileImageLightbox} from '#/state/lightbox' import {useLightboxControls, ProfileImageLightbox} from '#/state/lightbox'
@@ -600,7 +600,7 @@ let ProfileHeaderLoaded = ({
{!blockHide && ( {!blockHide && (
<> <>
<View style={styles.metricsLine} pointerEvents="box-none"> <View style={styles.metricsLine} pointerEvents="box-none">
<Link <TextLink
testID="profileHeaderFollowersButton" testID="profileHeaderFollowersButton"
style={[s.flexRow, s.mr10]} style={[s.flexRow, s.mr10]}
href={makeProfileLink(profile, 'followers')} href={makeProfileLink(profile, 'followers')}
@@ -609,17 +609,20 @@ let ProfileHeaderLoaded = ({
handle: profile.handle, handle: profile.handle,
}) })
} }
asAnchor
accessibilityLabel={`${followers} ${pluralizedFollowers}`} accessibilityLabel={`${followers} ${pluralizedFollowers}`}
accessibilityHint={_(msg`Opens followers list`)}> accessibilityHint={_(msg`Opens followers list`)}
<Text type="md" style={[s.bold, pal.text]}> text={
{followers}{' '} <>
</Text> <Text type="md" style={[s.bold, pal.text]}>
<Text type="md" style={[pal.textLight]}> {followers}{' '}
{pluralizedFollowers} </Text>
</Text> <Text type="md" style={[pal.textLight]}>
</Link> {pluralizedFollowers}
<Link </Text>
</>
}
/>
<TextLink
testID="profileHeaderFollowsButton" testID="profileHeaderFollowsButton"
style={[s.flexRow, s.mr10]} style={[s.flexRow, s.mr10]}
href={makeProfileLink(profile, 'follows')} href={makeProfileLink(profile, 'follows')}
@@ -628,18 +631,19 @@ let ProfileHeaderLoaded = ({
handle: profile.handle, handle: profile.handle,
}) })
} }
asAnchor
accessibilityLabel={_(msg`${following} following`)} accessibilityLabel={_(msg`${following} following`)}
accessibilityHint={_(msg`Opens following list`)}> accessibilityHint={_(msg`Opens following list`)}
<Trans> text={
<Text type="md" style={[s.bold, pal.text]}> <Trans>
{following}{' '} <Text type="md" style={[s.bold, pal.text]}>
</Text> {following}{' '}
<Text type="md" style={[pal.textLight]}> </Text>
following <Text type="md" style={[pal.textLight]}>
</Text> following
</Trans> </Text>
</Link> </Trans>
}
/>
<Text type="md" style={[s.bold, pal.text]}> <Text type="md" style={[s.bold, pal.text]}>
{formatCount(profile.postsCount || 0)}{' '} {formatCount(profile.postsCount || 0)}{' '}
<Text type="md" style={[pal.textLight]}> <Text type="md" style={[pal.textLight]}>