feat(notifications/native): fix case for no title notifications

This commit is contained in:
Calin-Teodor
2025-09-19 12:00:54 +03:00
committed by Calinteodor
parent f9d8feacd2
commit eb8b6159ec
2 changed files with 29 additions and 9 deletions

View File

@@ -149,7 +149,7 @@ const Notification = ({
const titleText = title || (titleKey && t(titleKey, titleArguments));
const descriptionArray = _getDescription();
if (descriptionArray?.length) {
if (descriptionArray?.length && titleText) {
return (
<>
<Text
@@ -168,15 +168,29 @@ const Notification = ({
}
</>
);
} else if (descriptionArray?.length && !titleText) {
return (
<>
{
descriptionArray.map((line, index) => (
<Text
key = { index }
style = { styles.contentTextDescription }>
{ line.length >= CHAR_LIMIT ? line : replaceNonUnicodeEmojis(line) }
</Text>
))
}
</>
);
} else {
return (
<Text
numberOfLines = { 1 }
style = { styles.contentTextTitle as TextStyle }>
{ titleText }
</Text>
);
}
return (
<Text
numberOfLines = { 1 }
style = { styles.contentTextTitle as TextStyle }>
{ titleText }
</Text>
);
};
return (

View File

@@ -49,6 +49,12 @@ export default {
paddingTop: BaseTheme.spacing[1]
},
contentTextDescription: {
color: BaseTheme.palette.text04,
paddingLeft: BaseTheme.spacing[4],
paddingTop: BaseTheme.spacing[2]
},
contentTextTitleDescription: {
color: BaseTheme.palette.text04,
fontWeight: 'bold',