Skip to content

Commit d88c2ba

Browse files
authored
fix(ui): fix android lineHeight after 0.77 upgrade (#2507)
1 parent ee8d8be commit d88c2ba

File tree

5 files changed

+12
-24
lines changed

5 files changed

+12
-24
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
},

src/screens/Onboarding/Passphrase.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ const Passphrase = ({
3636
[dimensions.width, isSmallScreen],
3737
);
3838

39+
const onCreateWallet = (): void => {
40+
navigation.navigate('CreateWallet', { action: 'create', bip39Passphrase });
41+
};
42+
3943
return (
4044
<ThemedView style={styles.root}>
4145
<KeyboardAvoidingView style={styles.content}>
@@ -70,8 +74,7 @@ const Passphrase = ({
7074
onChangeText={setPassphrase}
7175
returnKeyType="done"
7276
autoCapitalize="none"
73-
// @ts-ignore autoCompleteType -> autoComplete in newer version
74-
autoCompleteType="off"
77+
autoComplete="off"
7578
autoCorrect={false}
7679
placeholder={t('passphrase')}
7780
testID="PassphraseInput"
@@ -84,9 +87,7 @@ const Passphrase = ({
8487
text={t('create_new_wallet')}
8588
size="large"
8689
testID="CreateNewWallet"
87-
onPress={(): void => {
88-
navigation.navigate('Slideshow', { bip39Passphrase });
89-
}}
90+
onPress={onCreateWallet}
9091
/>
9192
</View>
9293
</ScrollView>

src/screens/Onboarding/RestoreFromSeed.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ const RestoreFromSeed = ({
223223
value={bip39Passphrase}
224224
returnKeyType="done"
225225
autoCapitalize="none"
226-
autoCompleteType="off"
226+
autoComplete="off"
227227
autoCorrect={false}
228228
placeholder={t('restore_passphrase_placeholder')}
229229
testID="PassphraseInput"

src/screens/Onboarding/Slideshow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ const Slideshow = ({
183183
}
184184
};
185185

186-
const onCreateWallet = useCallback(async (): Promise<void> => {
186+
const onCreateWallet = useCallback((): void => {
187187
dispatch(updateUser({ requiresRemoteRestore: false }));
188188
navigation.navigate('CreateWallet', {
189189
action: 'create',

0 commit comments

Comments
 (0)