1
0
mirror of https://github.com/tooot-app/app synced 2025-04-25 07:28:41 +02:00

Fix in case font size is missing

This commit is contained in:
xmflsct 2022-12-29 23:03:23 +01:00
parent c6aff79055
commit 43a98be2d9

View File

@ -88,11 +88,11 @@ const TabMeSettingsFontsize: React.FC<TabMeStackScreenProps<'Tab-Me-Settings-Fon
marginBottom: StyleConstants.Spacing.M, marginBottom: StyleConstants.Spacing.M,
fontSize: adaptiveScale(StyleConstants.Font.Size.M, size), fontSize: adaptiveScale(StyleConstants.Font.Size.M, size),
lineHeight: adaptiveScale(StyleConstants.Font.LineHeight.M, size), lineHeight: adaptiveScale(StyleConstants.Font.LineHeight.M, size),
color: fontSize === size ? colors.primaryDefault : colors.secondary, color: (fontSize || 0) === size ? colors.primaryDefault : colors.secondary,
borderWidth: StyleSheet.hairlineWidth, borderWidth: StyleSheet.hairlineWidth,
borderColor: colors.border borderColor: colors.border
}} }}
fontWeight={fontSize === size ? 'Bold' : undefined} fontWeight={(fontSize || 0) === size ? 'Bold' : undefined}
> >
{t(`me.fontSize.sizes.${mapFontsizeToName(size)}`)} {t(`me.fontSize.sizes.${mapFontsizeToName(size)}`)}
</CustomText> </CustomText>
@ -107,10 +107,10 @@ const TabMeSettingsFontsize: React.FC<TabMeStackScreenProps<'Tab-Me-Settings-Fon
> >
<Button <Button
onPress={() => { onPress={() => {
if (fontSize && fontSize > -1) { if ((fontSize || 0) > -1) {
haptics('Light') haptics('Light')
// @ts-ignore // @ts-ignore
setFontSize(fontSize - 1) setFontSize((fontSize || 0) - 1)
} }
}} }}
type='icon' type='icon'
@ -121,10 +121,10 @@ const TabMeSettingsFontsize: React.FC<TabMeStackScreenProps<'Tab-Me-Settings-Fon
/> />
<Button <Button
onPress={() => { onPress={() => {
if (fontSize && fontSize < 3) { if ((fontSize || 0) < 3) {
haptics('Light') haptics('Light')
// @ts-ignore // @ts-ignore
setFontSize(fontSize + 1) setFontSize((fontSize || 0) + 1)
} }
}} }}
type='icon' type='icon'