about summary refs log tree commit diff
path: root/src/view/com/util/UserAvatar.tsx
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-05-31 13:02:18 -0700
committerGitHub <noreply@github.com>2024-05-31 21:02:18 +0100
commit708a80e7a7ca1199247a8c3ff4552d3957ea1c7b (patch)
tree2543d97769031c2e86ca08e12af7c2a92f4ea74d /src/view/com/util/UserAvatar.tsx
parentb51640fbc099a1e9df1430b5a05bf913495008b7 (diff)
downloadvoidsky-708a80e7a7ca1199247a8c3ff4552d3957ea1c7b.tar.zst
fix accessibility label in notifications (#4305)
* fix accessibility label in notifications

* add accessibility options to expand post

* inherit from outside, but always include `activate`

* include option to disable label/hint on previewable avatar

* fix hidden elements still being read on voiceover

* make it work for followers too

* extract variable

* fix hint

* update wording elsewhere
Diffstat (limited to 'src/view/com/util/UserAvatar.tsx')
-rw-r--r--src/view/com/util/UserAvatar.tsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/view/com/util/UserAvatar.tsx b/src/view/com/util/UserAvatar.tsx
index f23f4f7a5..587b466a3 100644
--- a/src/view/com/util/UserAvatar.tsx
+++ b/src/view/com/util/UserAvatar.tsx
@@ -53,6 +53,7 @@ interface PreviewableUserAvatarProps extends BaseUserAvatarProps {
   profile: AppBskyActorDefs.ProfileViewBasic
   disableHoverCard?: boolean
   onBeforePress?: () => void
+  accessible?: boolean
 }
 
 const BLUR_AMOUNT = isWeb ? 5 : 100
@@ -386,6 +387,7 @@ let PreviewableUserAvatar = ({
   profile,
   disableHoverCard,
   onBeforePress,
+  accessible = true,
   ...rest
 }: PreviewableUserAvatarProps): React.ReactNode => {
   const {_} = useLingui()
@@ -399,7 +401,12 @@ let PreviewableUserAvatar = ({
   return (
     <ProfileHoverCard did={profile.did} disable={disableHoverCard}>
       <Link
-        label={_(msg`See profile`)}
+        label={
+          accessible
+            ? _(msg`${profile.displayName || profile.handle}'s avatar`)
+            : undefined
+        }
+        accessibilityHint={accessible ? _(msg`Opens this profile`) : undefined}
         to={makeProfileLink({
           did: profile.did,
           handle: profile.handle,