Skip to content

Commit 938f3a7

Browse files
authored
Feat(events): add PullRequestReviewComment (#13)
Resolves issue #10 Adds `PullRequestReviewComment` to the list of events in `GithubEventAction.tsx`
1 parent 9f991a2 commit 938f3a7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

components/GitHubEventAction.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@ function GitHubEventAction({type, payload}: GitHubEventActionProps): JSX.Element
6363
}
6464
return <span>{action} <ELink link={prURL}>pull request #{prNum}</ELink> in</span>;
6565
}
66+
case 'PullRequestReviewCommentEvent': {
67+
const action = payload?.action;
68+
const actionStr = action === 'created' ? 'commented' : action;
69+
const prNum = payload?.pull_request?.number;
70+
const prURL = payload?.comment?.html_url;
71+
if (!action || !prNum || !prURL) {
72+
return unknown;
73+
}
74+
return (
75+
<span>{actionStr} on <ELink link={prURL}> pull request #{prNum}</ELink> in</span>
76+
);
77+
}
6678
case 'PullRequestReviewEvent': {
6779
const action = payload?.action;
6880
const prNum = payload?.pull_request?.number;

0 commit comments

Comments
 (0)