aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/notifications/Notification.tsx14
-rw-r--r--src/types/types.ts19
2 files changed, 31 insertions, 2 deletions
diff --git a/src/components/notifications/Notification.tsx b/src/components/notifications/Notification.tsx
index e0ae231e..265c21b1 100644
--- a/src/components/notifications/Notification.tsx
+++ b/src/components/notifications/Notification.tsx
@@ -166,6 +166,20 @@ const Notification: React.FC<NotificationProps> = (props) => {
}, 500);
}
break;
+ case 'MOMENT_3+':
+ case 'MOMENT_FRIEND':
+ const object = notification_object as MomentType;
+ await fetchUserX(
+ dispatch,
+ {userId: id, username: username},
+ screenType,
+ );
+ navigation.push('IndividualMoment', {
+ moment: object,
+ userXId: id,
+ screenType,
+ });
+ break;
default:
break;
}
diff --git a/src/types/types.ts b/src/types/types.ts
index 1775cd5f..f5f96278 100644
--- a/src/types/types.ts
+++ b/src/types/types.ts
@@ -179,10 +179,25 @@ export type TaggPopupType = {
export type NotificationType = {
actor: ProfilePreviewType;
verbage: string;
- notification_type: 'DFT' | 'FRD_REQ' | 'FRD_ACPT' | 'FRD_DEC' | 'CMT';
- notification_object: CommentType | CommentThreadType | undefined;
+ notification_type: TypeOfNotification;
+ notification_object: CommentType | CommentThreadType | MomentType | undefined;
timestamp: string;
unread: boolean;
};
export type TypeOfComment = 'Comment' | 'Thread';
+export type TypeOfNotification =
+ // notification_object is undefined
+ | 'DFT'
+ // notification_object is undefined
+ | 'FRD_REQ'
+ // notification_object is undefined
+ | 'FRD_ACPT'
+ // notification_object is undefined
+ | 'FRD_DEC'
+ // notification_object is CommentType || CommentThreadType
+ | 'CMT'
+ // notification_object is MomentType
+ | 'MOMENT_3+'
+ // notification_object is MomentType
+ | 'MOMENT_FRIEND';