aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-02-01 17:44:11 -0500
committerIvan Chen <ivan@tagg.id>2021-02-01 17:44:11 -0500
commitc758829621b78aadfb17c52da81aa2cba28dbf4d (patch)
tree22274c997f08f6549e4aad7ab19071253a04a4e3
parent7a09cc96bf1fe468a612bb44362bbef24fccc773 (diff)
first version
-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';