mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-20 11:51:52 +03:00
notifications enhanced
This commit is contained in:
parent
8345995a44
commit
fa341e406a
@ -41,6 +41,10 @@ export default EStyleSheet.create({
|
||||
title: {
|
||||
color: '$primaryDarkGray',
|
||||
},
|
||||
moreinfo: {
|
||||
color: '$primaryBlack',
|
||||
flex: 1,
|
||||
},
|
||||
description: {
|
||||
color: '$primaryBlack',
|
||||
fontSize: 12,
|
||||
|
@ -15,7 +15,7 @@ const NotificationLineView = ({ notification, handleOnPressNotification }) => {
|
||||
const intl = useIntl();
|
||||
let _title;
|
||||
let titleExtra = '';
|
||||
|
||||
let _moreinfo = '';
|
||||
useEffect(() => {
|
||||
setIsRead(notification.read);
|
||||
}, [notification]);
|
||||
@ -33,7 +33,6 @@ const NotificationLineView = ({ notification, handleOnPressNotification }) => {
|
||||
titleExtra = notification.amount;
|
||||
} else if (notification.weight) {
|
||||
const _percent = `${parseFloat((notification.weight / 100).toFixed(2))}% `;
|
||||
|
||||
titleExtra = _percent;
|
||||
}
|
||||
|
||||
@ -41,6 +40,18 @@ const NotificationLineView = ({ notification, handleOnPressNotification }) => {
|
||||
id: `notification.${notification.type}`,
|
||||
})}`;
|
||||
|
||||
if (
|
||||
notification.type === 'vote' ||
|
||||
notification.type === 'reblog' ||
|
||||
(notification.type === 'mention' && notification.post)
|
||||
) {
|
||||
_moreinfo = notification.title || notification.permlink;
|
||||
}
|
||||
|
||||
if (notification.type === 'reply' || (notification.type === 'mention' && !notification.post)) {
|
||||
_moreinfo = notification.parent_title || notification.permlink;
|
||||
}
|
||||
|
||||
return (
|
||||
<TouchableHighlight onPress={_handleOnNotificationPress}>
|
||||
<View
|
||||
@ -54,7 +65,10 @@ const NotificationLineView = ({ notification, handleOnPressNotification }) => {
|
||||
<View style={styles.body}>
|
||||
<View style={styles.titleWrapper}>
|
||||
<Text style={styles.name}>{notification.source} </Text>
|
||||
<Text style={styles.title}>{_title}</Text>
|
||||
<Text style={styles.title}>{_title} </Text>
|
||||
<Text style={styles.moreinfo} numberOfLines={1} ellipsizeMode={4}>
|
||||
{_moreinfo}
|
||||
</Text>
|
||||
</View>
|
||||
{notification.description && (
|
||||
<Text numberOfLines={1} style={styles.description}>
|
||||
|
@ -103,14 +103,14 @@
|
||||
}
|
||||
},
|
||||
"notification": {
|
||||
"vote": "likes your post",
|
||||
"unvote": "unvoted your post",
|
||||
"reply": "replied to your post",
|
||||
"mention": "mentioned you",
|
||||
"vote": "voted",
|
||||
"unvote": "unvoted",
|
||||
"reply": "replied to",
|
||||
"mention": "mentioned in",
|
||||
"follow": "followed you",
|
||||
"unfollow": "unfollowed you",
|
||||
"ignore": "ignored you",
|
||||
"reblog": "reblogged your post",
|
||||
"reblog": "reblogged",
|
||||
"transfer": "transferred",
|
||||
"notification": "Notifications",
|
||||
"leaderboard": "Leaderboard",
|
||||
|
Loading…
Reference in New Issue
Block a user