diff options
author | Minseo Lee <itoupluk427@gmail.com> | 2024-03-12 16:24:32 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-12 16:24:32 +0900 |
commit | 2456ca828fc4ba05a085fa03c6f7c37b3edcd45e (patch) | |
tree | 66f4aba71042e83e3dfce03c6da4f487cc8e33da /src/components/Typography.tsx | |
parent | 236223d02aa61d8f9011c7484c4e8827d336ecb6 (diff) | |
parent | c1c7a55fd5849c66032692533681a5c9317cb6d3 (diff) | |
download | voidsky-2456ca828fc4ba05a085fa03c6f7c37b3edcd45e.tar.zst |
Merge branch 'bluesky-social:main' into patch-3
Diffstat (limited to 'src/components/Typography.tsx')
-rw-r--r-- | src/components/Typography.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/Typography.tsx b/src/components/Typography.tsx index c9ab7a8a1..5268e7f46 100644 --- a/src/components/Typography.tsx +++ b/src/components/Typography.tsx @@ -3,7 +3,7 @@ import {Text as RNText, TextStyle, TextProps as RNTextProps} from 'react-native' import {UITextView} from 'react-native-ui-text-view' import {useTheme, atoms, web, flatten} from '#/alf' -import {isIOS} from '#/platform/detection' +import {isIOS, isNative} from '#/platform/detection' export type TextProps = RNTextProps & { /** @@ -40,11 +40,11 @@ function normalizeTextStyles(styles: TextStyle[]) { const fontSize = s.fontSize || atoms.text_md.fontSize if (s?.lineHeight) { - if (s.lineHeight <= 2) { + if (s.lineHeight !== 0 && s.lineHeight <= 2) { s.lineHeight = Math.round(fontSize * s.lineHeight) } - } else { - s.lineHeight = fontSize + } else if (!isNative) { + s.lineHeight = s.fontSize } return s |