diff options
author | ankit-thanekar007 <ankit.thanekar007@gmail.com> | 2021-05-05 11:53:22 -0700 |
---|---|---|
committer | ankit-thanekar007 <ankit.thanekar007@gmail.com> | 2021-05-05 11:56:09 -0700 |
commit | 9ae27c5717bace27a2db2c8dab1241c8a6e3da25 (patch) | |
tree | 4729387d8767baef7606403644e5e5ec79cc10e1 /src/components/notifications/Notification.tsx | |
parent | 8c1fb85de4e54bc8cb95587962088e8b15a60f94 (diff) |
Added timestamps on notification
Diffstat (limited to 'src/components/notifications/Notification.tsx')
-rw-r--r-- | src/components/notifications/Notification.tsx | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/src/components/notifications/Notification.tsx b/src/components/notifications/Notification.tsx index a74480b4..0290f9c7 100644 --- a/src/components/notifications/Notification.tsx +++ b/src/components/notifications/Notification.tsx @@ -26,6 +26,8 @@ import { } from '../../types'; import { fetchUserX, + getTimeInShorthand, + normalize, SCREEN_HEIGHT, SCREEN_WIDTH, userXInStore, @@ -47,6 +49,7 @@ const Notification: React.FC<NotificationProps> = (props) => { notification_type, notification_object, unread, + timestamp, }, screenType, loggedInUser, @@ -231,7 +234,12 @@ const Notification: React.FC<NotificationProps> = (props) => { {notification_type === 'SYSTEM_MSG' ? ( // Only verbage <View style={styles.contentContainer}> - <Text style={styles.actorName}>{verbage}</Text> + <View style={styles.textContainerStyles}> + <Text style={styles.actorName}>{verbage}</Text> + <Text style={styles.timeStampStyles}> + {getTimeInShorthand(timestamp)} + </Text> + </View> </View> ) : ( <> @@ -242,8 +250,13 @@ const Notification: React.FC<NotificationProps> = (props) => { {first_name} {last_name} </Text> </TouchableWithoutFeedback> - <TouchableWithoutFeedback onPress={onNotificationTap}> - <Text>{verbage}</Text> + <TouchableWithoutFeedback + style={styles.textContainerStyles} + onPress={onNotificationTap}> + <Text style={styles.verbageStyles}>{verbage}</Text> + <Text style={styles.timeStampStyles}> + {getTimeInShorthand(timestamp)} + </Text> </TouchableWithoutFeedback> </View> {/* Friend request accept/decline button */} @@ -309,8 +322,9 @@ const styles = StyleSheet.create({ justifyContent: 'space-around', }, actorName: { - fontSize: 15, + fontSize: normalize(12), fontWeight: '700', + lineHeight: normalize(14.32), }, moment: { height: 42, @@ -320,6 +334,20 @@ const styles = StyleSheet.create({ buttonsContainer: { height: '80%', }, + textContainerStyles: {flexDirection: 'row', flexWrap: 'wrap'}, + verbageStyles: { + fontWeight: '500', + fontSize: normalize(11), + lineHeight: normalize(13.13), + }, + timeStampStyles: { + fontWeight: '700', + fontSize: normalize(12), + lineHeight: normalize(14.32), + marginHorizontal: 2, + color: '#828282', + textAlignVertical: 'center', + }, imageFlex: { flex: 1, }, |