Emoji handling nested (#5609)

This commit is contained in:
Eric Bailey
2024-10-04 15:31:40 -05:00
committed by GitHub
parent 00486e9499
commit d17da8474b
3 changed files with 38 additions and 26 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ export function ViewHeader({
</TouchableOpacity>
) : null}
<View style={styles.titleContainer} pointerEvents="none">
<Text type="title" style={[pal.text, styles.title]}>
<Text emoji type="title" style={[pal.text, styles.title]}>
{title}
</Text>
</View>
+18 -13
View File
@@ -77,13 +77,16 @@ export function Text({
flattened.fontSize = flattened.fontSize * fonts.scaleMultiplier
}
const shared = {
uiTextView: true,
selectable,
style: flattened,
...props,
}
return (
<UITextView
style={flattened}
selectable={selectable}
uiTextView
{...props}>
{isIOS && emoji ? renderChildrenWithEmoji(children) : children}
<UITextView {...shared}>
{isIOS && emoji ? renderChildrenWithEmoji(children, shared) : children}
</UITextView>
)
}
@@ -104,14 +107,16 @@ export function Text({
flattened.fontSize = flattened.fontSize * fonts.scaleMultiplier
}
const shared = {
selectable,
style: flattened,
dataSet: Object.assign({tooltip: title}, dataSet || {}),
...props,
}
return (
<RNText
style={flattened}
// @ts-ignore web only -esb
dataSet={Object.assign({tooltip: title}, dataSet || {})}
selectable={selectable}
{...props}>
{isIOS && emoji ? renderChildrenWithEmoji(children) : children}
<RNText {...shared}>
{isIOS && emoji ? renderChildrenWithEmoji(children, shared) : children}
</RNText>
)
}