From 1530471e395eeae5a1de45aa7a2eaa054343b6af Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Thu, 20 May 2021 23:47:13 -0400 Subject: Clean up code --- src/components/notifications/Notification.tsx | 151 +++++++++++++------------- 1 file changed, 74 insertions(+), 77 deletions(-) (limited to 'src') diff --git a/src/components/notifications/Notification.tsx b/src/components/notifications/Notification.tsx index b0692c9e..3f9cc56a 100644 --- a/src/components/notifications/Notification.tsx +++ b/src/components/notifications/Notification.tsx @@ -238,91 +238,88 @@ const Notification: React.FC = (props) => { style={styles.avatarContainer}> - <> - {/* Text content: Actor name and verbage*/} - {notification_type === 'SYSTEM_MSG' || - notification_type === 'MOM_TAG' ? ( - // Only verbage - - - {notification_type === 'SYSTEM_MSG' ? ( - {verbage} - ) : ( - - {notification_title} - {verbage} - - {getTimeInShorthand(timestamp)} - - - )} - - - ) : ( - - - {notification_title} - - + {notification_type === 'SYSTEM_MSG' || notification_type === 'MOM_TAG' ? ( + // Single-line body text with timestamp + + + {notification_type === 'SYSTEM_MSG' ? ( + {verbage} + ) : ( + {notification_title} {verbage} {getTimeInShorthand(timestamp)} - {/* {verbage} */} - - - )} - {/* Friend request accept/decline button */} - {notification_type === 'FRD_REQ' && ( - - - - )} - {notification_type === 'FRD_ACPT' && ( - - + )} + + ) : ( + // Two-line title and body text with timestamp + + + {notification_title} + + + + {verbage} + + {getTimeInShorthand(timestamp)} + + + + + )} + {/* Friend request accept/decline button */} + {notification_type === 'FRD_REQ' && ( + + + + )} + {/* Message button when user accepts friend request */} + {notification_type === 'FRD_ACPT' && ( + + + + )} + {/* Moment Image Preview */} + {(notification_type === 'CMT' || + notification_type === 'MOM_3+' || + notification_type === 'MOM_TAG' || + notification_type === 'MOM_FRIEND') && + notification_object && ( + + + )} - {/* Moment Image Preview */} - {(notification_type === 'CMT' || - notification_type === 'MOM_3+' || - notification_type === 'MOM_TAG' || - notification_type === 'MOM_FRIEND') && - notification_object && ( - - - - )} - ); -- cgit v1.2.3-70-g09d2