Skip to content

Commit 7157a70

Browse files
committed
fix(ui): fix android lineHeight after 0.77 upgrade
1 parent cbaa788 commit 7157a70

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

src/components/buttons/Button.tsx

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { memo, ReactElement, useMemo } from 'react';
22
import {
33
ActivityIndicator,
4-
Platform,
54
Pressable,
65
PressableProps,
76
StyleProp,
@@ -33,7 +32,7 @@ const Button = ({
3332
size = 'small',
3433
disabled = false,
3534
loading = false,
36-
textStyle = {},
35+
textStyle,
3736
style,
3837
icon,
3938
...props
@@ -81,13 +80,8 @@ const Button = ({
8180
...(text && !icon && { maxWidth: '100%', textAlign: 'center' }), // on android text sometimes get shrinked. So if there is no icon, make sure it takes the full width
8281
...(variant === 'primary' ? {} : { color: white80 }),
8382
...(disabled && !icon && { color: white32 }),
84-
...Platform.select({
85-
android: {
86-
lineHeight: size === 'small' ? 15 : 18,
87-
},
88-
}),
8983
};
90-
}, [textStyle, text, icon, variant, disabled, size, white32, white80]);
84+
}, [textStyle, text, icon, variant, disabled, white32, white80]);
9185

9286
const textPressedStyles = useMemo(() => {
9387
return {
@@ -106,14 +100,7 @@ const Button = ({
106100
{({ pressed }) => {
107101
return (
108102
<>
109-
{icon && (
110-
<View color="transparent">
111-
{icon}
112-
{/* {React.cloneElement(icon, {
113-
...{ ...(disabled && { color: 'white32' }) },
114-
})} */}
115-
</View>
116-
)}
103+
{icon && <View color="transparent">{icon}</View>}
117104

118105
<Text
119106
style={[textStyles, pressed && textPressedStyles]}

src/components/widgets/WeatherWidget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const styles = StyleSheet.create({
132132
},
133133
android: {
134134
fontSize: 85,
135-
lineHeight: 85,
135+
lineHeight: 70,
136136
},
137137
}),
138138
},

0 commit comments

Comments
 (0)