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
+13 -9
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={
<>
<Text type="md" style={[s.bold, pal.text]}> <Text type="md" style={[s.bold, pal.text]}>
{followers}{' '} {followers}{' '}
</Text> </Text>
<Text type="md" style={[pal.textLight]}> <Text type="md" style={[pal.textLight]}>
{pluralizedFollowers} {pluralizedFollowers}
</Text> </Text>
</Link> </>
<Link }
/>
<TextLink
testID="profileHeaderFollowsButton" testID="profileHeaderFollowsButton"
style={[s.flexRow, s.mr10]} style={[s.flexRow, s.mr10]}
href={makeProfileLink(profile, 'follows')} href={makeProfileLink(profile, 'follows')}
@@ -628,9 +631,9 @@ 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`)}
text={
<Trans> <Trans>
<Text type="md" style={[s.bold, pal.text]}> <Text type="md" style={[s.bold, pal.text]}>
{following}{' '} {following}{' '}
@@ -639,7 +642,8 @@ let ProfileHeaderLoaded = ({
following following
</Text> </Text>
</Trans> </Trans>
</Link> }
/>
<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]}>