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 a504e14
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/scenes/Root/Notifications/Views/CommentViaMention.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Button, Typography } from '@mui/material';
import { BaseView, Views } from './Base';

export const CommentViaMention: Views['CommentViaMention'] = ({
notification,
}) => (
<BaseView
notification={notification}
component={Button}
onClick={() =>
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 a504e14

Please sign in to comment.