Skip to content

Commit

Permalink
Feat(events): add PullRequestReviewComment (#13)
Browse files Browse the repository at this point in the history
Resolves issue #10 

Adds `PullRequestReviewComment` to the list of events in `GithubEventAction.tsx`
  • Loading branch information
devtayls committed Oct 17, 2021
1 parent 9f991a2 commit 938f3a7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions components/GitHubEventAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ function GitHubEventAction({type, payload}: GitHubEventActionProps): JSX.Element
}
return <span>{action} <ELink link={prURL}>pull request #{prNum}</ELink> in</span>;
}
case 'PullRequestReviewCommentEvent': {
const action = payload?.action;
const actionStr = action === 'created' ? 'commented' : action;
const prNum = payload?.pull_request?.number;
const prURL = payload?.comment?.html_url;
if (!action || !prNum || !prURL) {
return unknown;
}
return (
<span>{actionStr} on <ELink link={prURL}> pull request #{prNum}</ELink> in</span>
);
}
case 'PullRequestReviewEvent': {
const action = payload?.action;
const prNum = payload?.pull_request?.number;
Expand Down

0 comments on commit 938f3a7

Please sign in to comment.