Merge branch 'bluesky-social:main' into patch-3

This commit is contained in:
Minseo Lee 2024-03-12 16:24:32 +09:00 committed by GitHub
commit 2456ca828f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 3427 additions and 2396 deletions

View file

@ -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