diff options
author | Eric Bailey <git@esb.lol> | 2023-08-22 13:04:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-22 11:04:17 -0700 |
commit | 548ec6c82d114f96c431a4e0f162e8360bfd22f4 (patch) | |
tree | 6089f1d3c87692ea1cb146d12a7c7506ae85362f /src/view/com/util/text/Text.tsx | |
parent | 16b265a86164e682486a3d8fa51bfa18d51bb945 (diff) | |
download | voidsky-548ec6c82d114f96c431a4e0f162e8360bfd22f4.tar.zst |
add title attr to text text links (#1228)
* add title attr to text text links * Revert "add title attr to text text links" This reverts commit c028cd184efd3b2788d8f46134eecf521e5d7b07. * use css tooltips * add to expanded post state * handle theming * add to bskyweb
Diffstat (limited to 'src/view/com/util/text/Text.tsx')
-rw-r--r-- | src/view/com/util/text/Text.tsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/view/com/util/text/Text.tsx b/src/view/com/util/text/Text.tsx index 2825390cb..ea97d59fe 100644 --- a/src/view/com/util/text/Text.tsx +++ b/src/view/com/util/text/Text.tsx @@ -6,6 +6,8 @@ import {useTheme, TypographyVariant} from 'lib/ThemeContext' export type CustomTextProps = TextProps & { type?: TypographyVariant lineHeight?: number + title?: string + dataSet?: Record<string, string | number> } export function Text({ @@ -13,13 +15,19 @@ export function Text({ children, lineHeight, style, + title, + dataSet, ...props }: React.PropsWithChildren<CustomTextProps>) { const theme = useTheme() const typography = theme.typography[type] const lineHeightStyle = lineHeight ? lh(theme, type, lineHeight) : undefined return ( - <RNText style={[s.black, typography, lineHeightStyle, style]} {...props}> + <RNText + style={[s.black, typography, lineHeightStyle, style]} + // @ts-ignore web only -esb + dataSet={Object.assign({tooltip: title}, dataSet || {})} + {...props}> {children} </RNText> ) |