From 5684e473d201cc9dfa07173f4e259e54d18b6ad3 Mon Sep 17 00:00:00 2001 From: Carson Full Date: Mon, 21 Oct 2024 09:42:40 -0500 Subject: [PATCH] Stub out CommentViaMention view --- .../Notifications/Views/CommentViaMention.tsx | 22 +++++++++++++++++++ src/scenes/Root/Notifications/Views/index.ts | 2 ++ .../Root/Notifications/notification.graphql | 12 ++++++++++ 3 files changed, 36 insertions(+) create mode 100644 src/scenes/Root/Notifications/Views/CommentViaMention.tsx diff --git a/src/scenes/Root/Notifications/Views/CommentViaMention.tsx b/src/scenes/Root/Notifications/Views/CommentViaMention.tsx new file mode 100644 index 000000000..2e3c99c4d --- /dev/null +++ b/src/scenes/Root/Notifications/Views/CommentViaMention.tsx @@ -0,0 +1,22 @@ +import { Button, Typography } from '@mui/material'; +import { BaseView, Views } from './Base'; + +export const CommentViaMention: Views['CommentViaMention'] = ({ + notification, +}) => ( + + // TODO replace with navigation to comment + console.log( + 'You clicked on a comment mentioned', + notification.comment.container + ) + } + > + + {notification.comment.creator.fullName} mentioned you in a comment + + +); diff --git a/src/scenes/Root/Notifications/Views/index.ts b/src/scenes/Root/Notifications/Views/index.ts index b0daefb60..b759d789e 100644 --- a/src/scenes/Root/Notifications/Views/index.ts +++ b/src/scenes/Root/Notifications/Views/index.ts @@ -1,6 +1,8 @@ import { Views } from './Base'; +import { CommentViaMention } from './CommentViaMention'; import { System } from './System'; export const views: Views = { System, + CommentViaMention, }; diff --git a/src/scenes/Root/Notifications/notification.graphql b/src/scenes/Root/Notifications/notification.graphql index 31c764f95..7db65bb8e 100644 --- a/src/scenes/Root/Notifications/notification.graphql +++ b/src/scenes/Root/Notifications/notification.graphql @@ -7,4 +7,16 @@ fragment notification on Notification { ... on SystemNotification { message } + ... on CommentViaMentionNotification { + comment { + creator { + id + fullName + } + container { + __typename + id + } + } + } }