1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Using new text component

Need to use global accessibility checks rather than per text component which is not efficient
This commit is contained in:
Zhiyuan Zheng
2022-05-07 00:52:32 +02:00
parent 8caf315894
commit 7c48c61c99
60 changed files with 1302 additions and 1494 deletions

View File

@ -4,8 +4,9 @@ import { TabLocalStackParamList } from '@utils/navigation/navigators'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useCallback } from 'react'
import { Pressable, StyleSheet, Text } from 'react-native'
import { Pressable } from 'react-native'
import analytics from './analytics'
import CustomText from './Text'
export interface Props {
hashtag: Mastodon.Tag
@ -30,23 +31,14 @@ const ComponentHashtag: React.FC<Props> = ({
return (
<Pressable
accessibilityRole='button'
style={styles.itemDefault}
style={{ padding: StyleConstants.Spacing.S * 1.5 }}
onPress={customOnPress || onPress}
>
<Text style={[styles.itemHashtag, { color: colors.primaryDefault }]}>
<CustomText fontStyle='M' style={{ color: colors.primaryDefault }}>
#{hashtag.name}
</Text>
</CustomText>
</Pressable>
)
}
const styles = StyleSheet.create({
itemDefault: {
padding: StyleConstants.Spacing.S * 1.5
},
itemHashtag: {
...StyleConstants.FontStyle.M
}
})
export default ComponentHashtag