about summary refs log tree commit diff
path: root/src/view/com/util/text/Text.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-02-24 11:40:43 -0600
committerPaul Frazee <pfrazee@gmail.com>2023-02-24 11:40:43 -0600
commitd97e2335181fc4d280cb6e4fb67cec8509e1569b (patch)
tree5804a5b878a9243a582879652f18d7dfb3951d15 /src/view/com/util/text/Text.tsx
parent80bd3398d768b9529d97d48579555358b35616db (diff)
downloadvoidsky-d97e2335181fc4d280cb6e4fb67cec8509e1569b.tar.zst
Fixes to lineheight on web to counteract emoji issues
Diffstat (limited to 'src/view/com/util/text/Text.tsx')
-rw-r--r--src/view/com/util/text/Text.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/view/com/util/text/Text.tsx b/src/view/com/util/text/Text.tsx
index 14c57cf47..2825390cb 100644
--- a/src/view/com/util/text/Text.tsx
+++ b/src/view/com/util/text/Text.tsx
@@ -1,22 +1,25 @@
 import React from 'react'
 import {Text as RNText, TextProps} from 'react-native'
-import {s} from 'lib/styles'
+import {s, lh} from 'lib/styles'
 import {useTheme, TypographyVariant} from 'lib/ThemeContext'
 
 export type CustomTextProps = TextProps & {
   type?: TypographyVariant
+  lineHeight?: number
 }
 
 export function Text({
   type = 'md',
   children,
+  lineHeight,
   style,
   ...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, style]} {...props}>
+    <RNText style={[s.black, typography, lineHeightStyle, style]} {...props}>
       {children}
     </RNText>
   )