-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
329 additions
and
28 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
'use client'; | ||
|
||
import GridContainer from '@/components/GridContainer'; | ||
import { Bar, Doughnut, Line, Radar } from 'react-chartjs-2'; | ||
|
||
const backgroundColor = [ | ||
'rgba(153, 102, 255, 0.5)', | ||
'rgba(75, 192, 192, 0.5)', | ||
'rgba(201, 203, 207, 0.5)', | ||
'rgba(255, 99, 132, 0.5)', | ||
]; | ||
|
||
const borderColor = [ | ||
'rgba(153, 102, 255, 0.8)', | ||
'rgba(75, 192, 192, 0.8)', | ||
'rgba(201, 203, 207, 0.8)', | ||
'rgba(255, 99, 132, 0.8)', | ||
]; | ||
|
||
const chartConfig = { | ||
backgroundColor, | ||
borderColor, | ||
}; | ||
|
||
const FollowUp = ({ follwoup }) => { | ||
const { issues_by_user, pr_by_user, issues_on_user, pr_on_user, login } = follwoup; | ||
|
||
return ( | ||
<GridContainer name="Follow Up" className={'grid-cols-2 gap-x-10 md:grid-cols-4'}> | ||
<div> | ||
<Doughnut | ||
options={{ plugins: { title: { text: `Issues opened by ${login}` } } }} | ||
data={{ | ||
labels: Object.keys(issues_by_user), | ||
datasets: [ | ||
{ | ||
data: Object.values(issues_by_user), | ||
...chartConfig, | ||
}, | ||
], | ||
}} | ||
/> | ||
</div> | ||
|
||
<div> | ||
<Doughnut | ||
options={{ plugins: { title: { text: `Pull Requests by ${login}` } } }} | ||
data={{ | ||
labels: Object.keys(pr_by_user), | ||
datasets: [ | ||
{ | ||
data: Object.values(pr_by_user), | ||
...chartConfig, | ||
}, | ||
], | ||
}} | ||
/> | ||
</div> | ||
|
||
<div> | ||
<Doughnut | ||
options={{ plugins: { title: { text: `Issues opened on ${login}'s repos` } } }} | ||
data={{ | ||
labels: Object.keys(issues_on_user), | ||
datasets: [ | ||
{ | ||
data: Object.values(issues_on_user), | ||
...chartConfig, | ||
}, | ||
], | ||
}} | ||
/> | ||
</div> | ||
|
||
<div> | ||
<Doughnut | ||
options={{ plugins: { title: { text: `Pull Requests opened on ${login}'s repos` } } }} | ||
data={{ | ||
labels: Object.keys(pr_on_user), | ||
datasets: [ | ||
{ | ||
data: Object.values(pr_on_user), | ||
...chartConfig, | ||
}, | ||
], | ||
}} | ||
/> | ||
</div> | ||
</GridContainer> | ||
); | ||
}; | ||
|
||
export default FollowUp; |
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,39 @@ | ||
// 'use client'; | ||
|
||
import GridContainer from '@/components/GridContainer'; | ||
import { IoGitPullRequestSharp, IoGitMergeSharp } from 'react-icons/io5'; | ||
import { RiGitClosePullRequestLine } from 'react-icons/ri'; | ||
|
||
const PrIcon = ({ status }) => { | ||
if (status === 'MERGED') { | ||
return ( | ||
<div className="rounded bg-purple-500 p-[3px] text-white"> | ||
<IoGitMergeSharp /> | ||
</div> | ||
); | ||
} | ||
|
||
if (status === 'CLOSED') { | ||
return ( | ||
<div className="rounded bg-red-500 p-[3px] text-white"> | ||
<RiGitClosePullRequestLine /> | ||
</div> | ||
); | ||
} | ||
|
||
return ( | ||
<div className="rounded bg-green-600 p-[3px] text-white"> | ||
<IoGitPullRequestSharp /> | ||
</div> | ||
); | ||
}; | ||
|
||
const RecentActivity = ({ activity }) => { | ||
return ( | ||
<GridContainer name="Recent Activity" className={'grid-cols-1 md:grid-cols-3'}> | ||
|
||
</GridContainer> | ||
); | ||
}; | ||
|
||
export default RecentActivity; |
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
Oops, something went wrong.