about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorOllie H <renahlee@outlook.com>2023-05-30 13:39:50 -0700
committerGitHub <noreply@github.com>2023-05-30 13:39:50 -0700
commit234e04c396eb38f8402cdc0601dd8e4eb849c7c2 (patch)
treea2971907ae18f43cdb89ae32553fb8dec7932442 /src
parent09c515d273bcdcc50e35e8fb347338170863593c (diff)
downloadvoidsky-234e04c396eb38f8402cdc0601dd8e4eb849c7c2.tar.zst
Update follower/following a11y hints and labels (#755)
* Update follower/following a11y hints and labels

* Update ProfileHeader.tsx

---------

Co-authored-by: Ansh <anshnanda10@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/view/com/profile/ProfileHeader.tsx17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx
index d5ae3a885..56036363c 100644
--- a/src/view/com/profile/ProfileHeader.tsx
+++ b/src/view/com/profile/ProfileHeader.tsx
@@ -289,6 +289,9 @@ const ProfileHeaderLoaded = observer(
     ])
 
     const blockHide = !isMe && (view.viewer.blocking || view.viewer.blockedBy)
+    const following = formatCount(view.followsCount)
+    const followers = formatCount(view.followersCount)
+    const pluralizedFollowers = pluralize(view.followersCount, 'follower')
 
     return (
       <View style={pal.view}>
@@ -394,13 +397,13 @@ const ProfileHeaderLoaded = observer(
                   style={[s.flexRow, s.mr10]}
                   onPress={onPressFollowers}
                   accessibilityRole="button"
-                  accessibilityLabel={`Show ${view.handle}'s followers`}
-                  accessibilityHint={`Shows folks following ${view.handle}`}>
+                  accessibilityLabel={`${followers} ${pluralizedFollowers}`}
+                  accessibilityHint={'Opens followers list'}>
                   <Text type="md" style={[s.bold, s.mr2, pal.text]}>
-                    {formatCount(view.followersCount)}
+                    {followers}
                   </Text>
                   <Text type="md" style={[pal.textLight]}>
-                    {pluralize(view.followersCount, 'follower')}
+                    {pluralizedFollowers}
                   </Text>
                 </TouchableOpacity>
                 <TouchableOpacity
@@ -408,10 +411,10 @@ const ProfileHeaderLoaded = observer(
                   style={[s.flexRow, s.mr10]}
                   onPress={onPressFollows}
                   accessibilityRole="button"
-                  accessibilityLabel={`Show ${view.handle}'s follows`}
-                  accessibilityHint={`Shows folks followed by ${view.handle}`}>
+                  accessibilityLabel={`${following} following`}
+                  accessibilityHint={'Opens following list'}>
                   <Text type="md" style={[s.bold, s.mr2, pal.text]}>
-                    {formatCount(view.followsCount)}
+                    {following}
                   </Text>
                   <Text type="md" style={[pal.textLight]}>
                     following