mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Refine accessibility
This commit is contained in:
@ -2,6 +2,7 @@ import { ParseEmojis } from '@root/components/Parse'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { useTheme } from '@utils/styles/ThemeManager'
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { StyleSheet, Text, View } from 'react-native'
|
||||
|
||||
export interface Props {
|
||||
@ -11,12 +12,19 @@ export interface Props {
|
||||
|
||||
const HeaderSharedAccount = React.memo(
|
||||
({ account, withoutName = false }: Props) => {
|
||||
const { t } = useTranslation('componentTimeline')
|
||||
const { theme } = useTheme()
|
||||
|
||||
return (
|
||||
<View style={styles.base}>
|
||||
{withoutName ? null : (
|
||||
<Text style={styles.name} numberOfLines={1}>
|
||||
<Text
|
||||
accessibilityHint={t(
|
||||
'shared.header.shared.account.name.accessibilityHint'
|
||||
)}
|
||||
style={styles.name}
|
||||
numberOfLines={1}
|
||||
>
|
||||
<ParseEmojis
|
||||
content={account.display_name || account.username}
|
||||
emojis={account.emojis}
|
||||
@ -25,6 +33,9 @@ const HeaderSharedAccount = React.memo(
|
||||
</Text>
|
||||
)}
|
||||
<Text
|
||||
accessibilityHint={t(
|
||||
'shared.header.shared.account.account.accessibilityHint'
|
||||
)}
|
||||
style={[styles.acct, { color: theme.secondary }]}
|
||||
numberOfLines={1}
|
||||
>
|
||||
|
@ -17,6 +17,7 @@ const HeaderSharedApplication = React.memo(
|
||||
|
||||
return application && application.name !== 'Web' ? (
|
||||
<Text
|
||||
accessibilityRole='link'
|
||||
onPress={async () => {
|
||||
analytics('timeline_shared_header_application_press', {
|
||||
application
|
||||
|
@ -2,6 +2,7 @@ import Icon from '@components/Icon'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { useTheme } from '@utils/styles/ThemeManager'
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { StyleSheet } from 'react-native'
|
||||
|
||||
export interface Props {
|
||||
@ -10,10 +11,12 @@ export interface Props {
|
||||
|
||||
const HeaderSharedMuted = React.memo(
|
||||
({ muted }: Props) => {
|
||||
const { t } = useTranslation('componentTimeline')
|
||||
const { theme } = useTheme()
|
||||
|
||||
return muted ? (
|
||||
<Icon
|
||||
accessibilityLabel={t('shared.header.shared.muted.accessibilityLabel')}
|
||||
name='VolumeX'
|
||||
size={StyleConstants.Font.Size.S}
|
||||
color={theme.secondary}
|
||||
|
@ -2,6 +2,7 @@ import Icon from '@components/Icon'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { useTheme } from '@utils/styles/ThemeManager'
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { StyleSheet } from 'react-native'
|
||||
|
||||
export interface Props {
|
||||
@ -10,12 +11,16 @@ export interface Props {
|
||||
|
||||
const HeaderSharedVisibility = React.memo(
|
||||
({ visibility }: Props) => {
|
||||
const { t } = useTranslation('componentTimeline')
|
||||
const { theme } = useTheme()
|
||||
|
||||
switch (visibility) {
|
||||
case 'private':
|
||||
return (
|
||||
<Icon
|
||||
accessibilityLabel={t(
|
||||
'shared.header.shared.visibility.private.accessibilityLabel'
|
||||
)}
|
||||
name='Lock'
|
||||
size={StyleConstants.Font.Size.S}
|
||||
color={theme.secondary}
|
||||
@ -25,6 +30,9 @@ const HeaderSharedVisibility = React.memo(
|
||||
case 'direct':
|
||||
return (
|
||||
<Icon
|
||||
accessibilityLabel={t(
|
||||
'shared.header.shared.visibility.direct.accessibilityLabel'
|
||||
)}
|
||||
name='Mail'
|
||||
size={StyleConstants.Font.Size.S}
|
||||
color={theme.secondary}
|
||||
|
Reference in New Issue
Block a user