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

Improve status mini card

This commit is contained in:
xmflsct
2022-12-11 14:08:27 +01:00
parent acca2683af
commit 306bc45e33
11 changed files with 65 additions and 118 deletions

View File

@ -21,13 +21,7 @@ export interface Props {
}
const ParseEmojis = React.memo(
({
content,
emojis,
size = 'M',
adaptiveSize = false,
fontBold = false
}: Props) => {
({ content, emojis, size = 'M', adaptiveSize = false, fontBold = false }: Props) => {
const { reduceMotionEnabled } = useAccessibility()
const adaptiveFontsize = useSelector(getSettingsFontsize)
@ -51,22 +45,13 @@ const ParseEmojis = React.memo(
image: {
width: adaptedFontsize,
height: adaptedFontsize,
...(Platform.OS === 'ios'
? {
transform: [{ translateY: -2 }]
}
: {
transform: [{ translateY: 1 }]
})
...(Platform.OS === 'android' && { transform: [{ translateY: 2 }] })
}
})
}, [theme, adaptiveFontsize])
return (
<CustomText
style={styles.text}
fontWeight={fontBold ? 'Bold' : undefined}
>
<CustomText style={styles.text} fontWeight={fontBold ? 'Bold' : undefined}>
{emojis ? (
content
.split(regexEmoji)
@ -78,11 +63,7 @@ const ParseEmojis = React.memo(
return emojiShortcode === `:${emoji.shortcode}:`
})
if (emojiIndex === -1) {
return (
<CustomText key={emojiShortcode + i}>
{emojiShortcode}
</CustomText>
)
return <CustomText key={emojiShortcode + i}>{emojiShortcode}</CustomText>
} else {
const uri = reduceMotionEnabled
? emojis[emojiIndex].static_url