forked from open-sauced/open-sauced
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enhance contributions rendering (open-sauced#1139)
- Loading branch information
1 parent
d3e2963
commit 0cc646a
Showing
6 changed files
with
74 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from "react"; | ||
import {GitPullRequestDraftIcon, GitPullRequestIcon, IssueOpenedIcon, | ||
IssueClosedIcon, GitPullRequestClosedIcon, GitMergeIcon} from "@primer/octicons-react"; | ||
|
||
function CommitType({status, isDraft, mergeable, merged}) { | ||
switch (status) { // Check the status variable for OPEN/CLOSED/MERGED ISSUES | ||
case "OPEN": | ||
{ | ||
if (isDraft) { //check wether if its a draft | ||
return ( | ||
<GitPullRequestDraftIcon className="gitGrey" /> | ||
); | ||
} | ||
if (mergeable === "MERGEABLE") {//check if its a pull request | ||
return ( | ||
<GitPullRequestIcon verticalAlign="middle" className="gitGreen" /> | ||
); | ||
} | ||
return ( | ||
<IssueOpenedIcon verticalAlign="middle" className="gitGreen"/> | ||
); | ||
} | ||
case "CLOSED": // check for closed PR or Closed issue | ||
{ | ||
if (mergeable === "MERGEABLE" && merged === false) { | ||
return ( | ||
<GitPullRequestClosedIcon verticalAlign="middle" className="gitRed"/> | ||
); | ||
} | ||
return ( | ||
<IssueClosedIcon verticalAlign="middle" className="gitRed" /> | ||
); | ||
} | ||
case "MERGED": | ||
return ( | ||
<GitMergeIcon verticalAlign="middle" className="gitPurple" /> | ||
); | ||
default: | ||
return ( | ||
"" | ||
); | ||
} | ||
} | ||
export default CommitType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters