From 7e75f40379c7bbb36101908a986fefc42935008d Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 4 Aug 2025 16:31:23 -0500 Subject: [PATCH] Handle screen reader specifically --- .../PolicyUpdate20250801.tsx | 152 ++++++++++++------ 1 file changed, 106 insertions(+), 46 deletions(-) diff --git a/src/components/dialogs/BlockingAnnouncements/PolicyUpdate20250801.tsx b/src/components/dialogs/BlockingAnnouncements/PolicyUpdate20250801.tsx index 833fd45d8a..b28f39c70c 100644 --- a/src/components/dialogs/BlockingAnnouncements/PolicyUpdate20250801.tsx +++ b/src/components/dialogs/BlockingAnnouncements/PolicyUpdate20250801.tsx @@ -3,6 +3,7 @@ import {View} from 'react-native' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {isAndroid} from '#/platform/detection' import {Nux} from '#/state/queries/nuxs' import {atoms as a, useTheme} from '#/alf' import {Button, ButtonText} from '#/components/Button' @@ -10,12 +11,13 @@ import { AnnouncementBadge, useAnnouncementState, } from '#/components/dialogs/BlockingAnnouncements/common' -import {InlineLinkText} from '#/components/Link' -import {Span, Text} from '#/components/Typography' +import {InlineLinkText, Link} from '#/components/Link' +import {Text} from '#/components/Typography' import { AnnouncementDialog, useAnnouncementDialogContext, } from '#/components/dialogs/BlockingAnnouncements/AnnouncementDialog' +import {useA11y} from '#/state/a11y' export function useLocalState() { return useAnnouncementState({ @@ -28,6 +30,7 @@ export function Announcement() { const {_} = useLingui() const {complete} = useLocalState() const {close} = useAnnouncementDialogContext() + const {screenReaderEnabled} = useA11y() const handleClose = useCallback(() => { close() @@ -39,77 +42,134 @@ export function Announcement() { overridePresentation: true, to: `https://bsky.social/about/support`, label: _(msg`Terms of Service`), - style: linkStyle, }, privacy: { overridePresentation: true, to: `https://bsky.social/about/support`, label: _(msg`Privacy Policy`), - style: linkStyle, }, copyright: { overridePresentation: true, to: `https://bsky.social/about/support`, label: _(msg`Copyright Policy`), - style: linkStyle, }, guidelines: { overridePresentation: true, to: `https://bsky.social/about/support`, label: _(msg`Community Guidelines`), - style: linkStyle, }, blog: { overridePresentation: true, to: `https://bsky.social/about/support`, label: _(msg`Our blog post`), - style: linkStyle, }, } + const linkButtonStyles = { + overridePresentation: true, + color: 'secondary', + size: 'small', + } as const + + const label = isAndroid + ? _( + msg`We’re updating our Terms of Service, Privacy Policy, and Copyright Policy, effective September 1st, 2025. We're also updating our Community Guidelines, and we want your input! These new guidelines will take effect on October 1st, 2025. Learn more about these changes and how to share your thoughts with us by reading our blog post.`, + ) + : _(msg`We're updating our policies`) return ( - + - - - Hey there 👋 - - - - We’re updating our{' '} - Terms of Service - ,{' '} - Privacy Policy - , and{' '} - - Copyright Policy - - , effective September 1st, 2025. - - - - - We're also updating our{' '} - - Community Guidelines - - , and we want your input! These new - guidelines will take effect on{' '} - October 1st, 2025. - - - - - Learn more about these changes and how to share your thoughts with - us by{' '} - - reading our blog post. - - - - + {screenReaderEnabled ? ( + + + Hey there 👋 + + + + We’re updating our Terms of Service, Privacy Policy, and + Copyright Policy, effective September 1st, 2025. + + + + + We're also updating our Community Guidelines, and we want your + input! These new guidelines will take effect on October 1st, + 2025. + + + + + Learn more about these changes and how to share your thoughts + with us by reading our blog post. + + + + + + Terms of Service + + + + + Privacy Policy + + + + + Copyright Policy + + + + + Read our blog post + + + + ) : ( + + + Hey there 👋 + + + + We’re updating our{' '} + + Terms of Service + + ,{' '} + + Privacy Policy + + , and{' '} + + Copyright Policy + + , effective September 1st, 2025. + + + + + We're also updating our{' '} + + Community Guidelines + + , and we want your input! These new guidelines will take effect + on October 1st, 2025. + + + + + Learn more about these changes and how to share your thoughts + with us by{' '} + + reading our blog post. + + + + + )}