Skip to content

Commit

Permalink
Stub out CommentViaMention view
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonF committed Oct 21, 2024
1 parent 9001ca7 commit 5684e47
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/scenes/Root/Notifications/Views/CommentViaMention.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Button, Typography } from '@mui/material';
import { BaseView, Views } from './Base';

export const CommentViaMention: Views['CommentViaMention'] = ({
notification,
}) => (
<BaseView
notification={notification}
component={Button}
onClick={() =>
// TODO replace with navigation to comment
console.log(
'You clicked on a comment mentioned',
notification.comment.container
)
}
>
<Typography color="text.primary">
{notification.comment.creator.fullName} mentioned you in a comment
</Typography>
</BaseView>
);
2 changes: 2 additions & 0 deletions src/scenes/Root/Notifications/Views/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Views } from './Base';
import { CommentViaMention } from './CommentViaMention';
import { System } from './System';

export const views: Views = {
System,
CommentViaMention,
};
12 changes: 12 additions & 0 deletions src/scenes/Root/Notifications/notification.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,16 @@ fragment notification on Notification {
... on SystemNotification {
message
}
... on CommentViaMentionNotification {
comment {
creator {
id
fullName
}
container {
__typename
id
}
}
}
}

0 comments on commit 5684e47

Please sign in to comment.