about summary refs log tree commit diff
path: root/src/view/com/util/text/Text.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/com/util/text/Text.tsx')
-rw-r--r--src/view/com/util/text/Text.tsx10
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>
   )