Skip to content

Commit 3921bc5

Browse files
committed
fix: adjust benchmark preview height in PerformanceScreen
- Increased the height of the benchmark preview from 220 to 320 for improved layout visibility. - Enhanced NitroText component by merging additional style properties for better styling flexibility.
1 parent 3cc42dc commit 3921bc5

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

example/src/screens/PerformanceScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ import React, {
630630
</TouchableOpacity>
631631

632632
<View
633-
style={[styles.benchmarkPreview, { height: 220, flexDirection: 'row' }]}
633+
style={[styles.benchmarkPreview, { height: 320, flexDirection: 'row' }]}
634634
key={`list-${listRenderKey}`}
635635
>
636636
<View style={{ flex: 1, marginRight: 8 }}>

src/nitro-text.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ export const NitroText = (props: NitroTextPropsWithEvents) => {
8484
return flattenChildrenToFragments(children, style)
8585
}, [parsedFragments, children, style, isSimpleText])
8686

87+
const styleProps = useMemo(() => getStyleProps(topStyles), [topStyles])
88+
8789
const onRNTextLayout = useCallback(
8890
(e: TextLayoutEvent) => {
8991
onTextLayout?.(e.nativeEvent)
@@ -101,19 +103,21 @@ export const NitroText = (props: NitroTextPropsWithEvents) => {
101103
onPress: callback(onPress) || undefined,
102104
onPressIn: callback(onPressIn) || undefined,
103105
onPressOut: callback(onPressOut) || undefined,
104-
style: style,
106+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
107+
style: { ...(style as any), ...styleProps },
105108
onTextLayout: callback(onTextLayout) || undefined,
106109
}
110+
// eslint-disable-next-line react-hooks/exhaustive-deps
107111
}, [
108112
rest,
113+
styleProps,
109114
selectable,
110115
maxFontSizeMultiplier,
111116
parsedFragments,
112117
selectionColor,
113118
onPress,
114119
onPressIn,
115120
onPressOut,
116-
style,
117121
onTextLayout,
118122
])
119123

0 commit comments

Comments
 (0)