({
alpha = 1,
family,
style,
theme: themeOverrides,
...rest
}: Props)
| 15 | }; |
| 16 | |
| 17 | const StyledText = ({ |
| 18 | alpha = 1, |
| 19 | family, |
| 20 | style, |
| 21 | theme: themeOverrides, |
| 22 | ...rest |
| 23 | }: Props) => { |
| 24 | const theme = useInternalTheme(themeOverrides); |
| 25 | |
| 26 | const textColor = color( |
| 27 | theme.isV3 ? theme.colors.onSurface : theme.colors?.text |
| 28 | ) |
| 29 | .alpha(alpha) |
| 30 | .rgb() |
| 31 | .string(); |
| 32 | const writingDirection = I18nManager.getConstants().isRTL ? 'rtl' : 'ltr'; |
| 33 | |
| 34 | return ( |
| 35 | <Text |
| 36 | {...rest} |
| 37 | style={[ |
| 38 | styles.text, |
| 39 | { |
| 40 | color: textColor, |
| 41 | ...(!theme.isV3 && theme.fonts?.[family]), |
| 42 | writingDirection, |
| 43 | }, |
| 44 | style, |
| 45 | ]} |
| 46 | /> |
| 47 | ); |
| 48 | }; |
| 49 | |
| 50 | const styles = StyleSheet.create({ |
| 51 | text: { |
nothing calls this directly
no test coverage detected
searching dependent graphs…