aboutsummaryrefslogtreecommitdiff
path: root/src/components/notifications/Notification.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-21 15:43:03 -0400
committerIvan Chen <ivan@tagg.id>2021-04-21 15:43:03 -0400
commit0dd0a4ac4343df036a1f16cbde070c524405bd21 (patch)
tree292a30ce0228560720214645805deb4b89f2eeae /src/components/notifications/Notification.tsx
parent5c438df5f6787cdc6c393873a98590cc827667b9 (diff)
parent4e8e1c0d58424e6b63cfb8470fc0a73c0e6b102b (diff)
Merge branch 'master' into hotfix-linting-fixup
# Conflicts: # .eslintrc.js # src/components/notifications/Notification.tsx # src/screens/onboarding/legacy/SocialMedia.tsx # src/screens/onboarding/legacy/WaitlistSuccessScreen.tsx # src/screens/profile/CategorySelection.tsx
Diffstat (limited to 'src/components/notifications/Notification.tsx')
-rw-r--r--src/components/notifications/Notification.tsx68
1 files changed, 42 insertions, 26 deletions
diff --git a/src/components/notifications/Notification.tsx b/src/components/notifications/Notification.tsx
index 87309c53..3cc1c7f1 100644
--- a/src/components/notifications/Notification.tsx
+++ b/src/components/notifications/Notification.tsx
@@ -208,6 +208,9 @@ const Notification: React.FC<NotificationProps> = (props) => {
const isOwnProfile = id === loggedInUser.userId;
const navigateToProfile = async () => {
+ if (notification_type === 'SYSTEM_MSG') {
+ return;
+ }
if (!userXInStore(state, screenType, id)) {
await fetchUserX(dispatch, {userId: id, username: username}, screenType);
}
@@ -231,34 +234,47 @@ const Notification: React.FC<NotificationProps> = (props) => {
}
/>
</TouchableWithoutFeedback>
- <View style={styles.contentContainer}>
- <TouchableWithoutFeedback onPress={navigateToProfile}>
- <Text style={styles.actorName}>
- {first_name} {last_name}
- </Text>
- </TouchableWithoutFeedback>
- <TouchableWithoutFeedback onPress={onNotificationTap}>
- <Text>{verbage}</Text>
- </TouchableWithoutFeedback>
- </View>
- {notification_type === 'FRD_REQ' && (
- <View style={styles.buttonsContainer}>
- <AcceptDeclineButtons
- onAccept={handleAcceptRequest}
- onReject={handleDeclineFriendRequest}
- />
+ {notification_type === 'SYSTEM_MSG' ? (
+ // Only verbage
+ <View style={styles.contentContainer}>
+ <Text style={styles.actorName}>{verbage}</Text>
</View>
+ ) : (
+ <>
+ {/* Text content: Actor name and verbage*/}
+ <View style={styles.contentContainer}>
+ <TouchableWithoutFeedback onPress={navigateToProfile}>
+ <Text style={styles.actorName}>
+ {first_name} {last_name}
+ </Text>
+ </TouchableWithoutFeedback>
+ <TouchableWithoutFeedback onPress={onNotificationTap}>
+ <Text>{verbage}</Text>
+ </TouchableWithoutFeedback>
+ </View>
+ {/* Friend request accept/decline button */}
+ {notification_type === 'FRD_REQ' && (
+ <View style={styles.buttonsContainer}>
+ <AcceptDeclineButtons
+ requester={{id, username, first_name, last_name}}
+ onAccept={handleAcceptRequest}
+ onReject={handleDeclineFriendRequest}
+ />
+ </View>
+ )}
+ {/* Moment Image Preview */}
+ {(notification_type === 'CMT' ||
+ notification_type === 'MOM_3+' ||
+ notification_type === 'MOM_FRIEND') &&
+ notification_object && (
+ <TouchableWithoutFeedback
+ style={styles.moment}
+ onPress={onNotificationTap}>
+ <Image style={styles.imageFlex} source={{uri: momentURI}} />
+ </TouchableWithoutFeedback>
+ )}
+ </>
)}
- {(notification_type === 'CMT' ||
- notification_type === 'MOM_3+' ||
- notification_type === 'MOM_FRIEND') &&
- notification_object && (
- <TouchableWithoutFeedback
- style={styles.moment}
- onPress={onNotificationTap}>
- <Image style={styles.imageFlex} source={{uri: momentURI}} />
- </TouchableWithoutFeedback>
- )}
</View>
);