1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Fix font weight

This commit is contained in:
Zhiyuan Zheng
2022-05-10 23:19:26 +02:00
parent 282ba1267d
commit c105b36b3d
10 changed files with 31 additions and 54 deletions

View File

@ -1,5 +1,4 @@
import CustomText from '@components/Text'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
@ -17,9 +16,9 @@ const HeaderCenter = React.memo(
<CustomText
style={{
fontSize: 18,
fontWeight: StyleConstants.Font.Weight.Bold,
color: inverted ? colors.primaryOverlay : colors.primaryDefault
}}
fontWeight='Bold'
children={content}
/>
)

View File

@ -32,10 +32,10 @@ const InstanceInfo = React.memo(
<CustomText
fontStyle='S'
style={{
fontWeight: StyleConstants.Font.Weight.Bold,
marginBottom: StyleConstants.Spacing.XS,
color: colors.primaryDefault
}}
fontWeight='Bold'
children={header}
/>
{content ? (

View File

@ -46,8 +46,7 @@ const ParseEmojis = React.memo(
text: {
color: colors.primaryDefault,
fontSize: adaptedFontsize,
lineHeight: adaptedLineheight,
...(fontBold && { fontWeight: StyleConstants.Font.Weight.Bold })
lineHeight: adaptedLineheight
},
image: {
width: adaptedFontsize,
@ -58,7 +57,10 @@ const ParseEmojis = React.memo(
}, [theme, adaptiveFontsize])
return (
<CustomText style={styles.text}>
<CustomText
style={styles.text}
fontWeight={fontBold ? 'Bold' : undefined}
>
{emojis ? (
content
.split(regexEmoji)

View File

@ -23,7 +23,7 @@ const CustomText: React.FC<Props & TextProps> = ({
style,
fontStyle,
fontSize,
fontWeight = 'Normal',
fontWeight,
lineHeight,
...rest
}) => {
@ -46,9 +46,11 @@ const CustomText: React.FC<Props & TextProps> = ({
})
},
{
fontWeight: boldTextEnabled
? BoldMapping[fontWeight]
: StyleConstants.Font.Weight[fontWeight]
fontWeight: fontWeight
? boldTextEnabled
? BoldMapping[fontWeight]
: StyleConstants.Font.Weight[fontWeight]
: undefined
}
]}
{...rest}

View File

@ -53,9 +53,9 @@ const TimelineCard = React.memo(({ card }: Props) => {
numberOfLines={2}
style={{
marginBottom: StyleConstants.Spacing.XS,
fontWeight: StyleConstants.Font.Weight.Bold,
color: colors.primaryDefault
}}
fontWeight='Bold'
testID='title'
>
{card.title}