Skip to content

Commit 1070d1c

Browse files
committed
feat: added number of open issues
1 parent 1ba7dc6 commit 1070d1c

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

components/Card.tsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { emojify } from '@twuni/emojify';
2-
import { GoStar, GoRepoForked } from 'react-icons/go';
2+
import { GoStar, GoRepoForked, GoIssueOpened } from 'react-icons/go';
33
import { RepoItem } from 'types';
44

55
interface Props {
@@ -59,7 +59,7 @@ function Card({ repo }: Props) {
5959
</div>
6060

6161
{/* stars and forks cards */}
62-
<div className="w-full flex gap-3 xl:gap-5 text-neutral-100 cursor-pointer mt-8">
62+
<div className="w-full grid grid-cols-[repeat(auto-fit,_minmax(120px,_1fr))] gap-3 xl:gap-5 text-neutral-100 cursor-pointer mt-8">
6363
<a
6464
href={`${repo.html_url}/stargazers`}
6565
target="_blank"
@@ -86,7 +86,9 @@ function Card({ repo }: Props) {
8686
>
8787
<GoRepoForked className="text-yellow-200 text-2xl" />
8888
<div className="flex flex-col">
89-
<div className="text-lg xl:text-2xl font-semibold mb-0.5">{repo.forks}</div>
89+
<div className="text-lg xl:text-2xl font-semibold mb-0.5">
90+
{repo.forks}
91+
</div>
9092
<div className="text-neutral-300 text-xs lg:text-sm">Forks</div>
9193
</div>
9294
<div
@@ -96,6 +98,25 @@ function Card({ repo }: Props) {
9698
Checkout all the forks here!
9799
</div>
98100
</a>
101+
<a
102+
href={`${repo.html_url}/issues`}
103+
target="_blank"
104+
className="group w-full border rounded-xl p-3 flex items-center gap-3 relative"
105+
>
106+
<GoIssueOpened className="text-yellow-200 text-2xl" />
107+
<div className="flex flex-col">
108+
<div className="text-lg xl:text-2xl font-semibold mb-0.5">
109+
{repo.open_issues_count}
110+
</div>
111+
<div className="text-neutral-300 text-xs lg:text-sm">Issues</div>
112+
</div>
113+
<div
114+
id="tooltip"
115+
className="hidden group-hover:block absolute bg-2023-void-2 text-2023-bavarian-gold-2 px-2 py-1 rounded-md"
116+
>
117+
Checkout all open issues here!
118+
</div>
119+
</a>
99120
</div>
100121
</div>
101122
</section>

pages/repos/[language].tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ export const getServerSideProps: GetServerSideProps<Props> = async ctx => {
5656

5757
const repos = await res.json();
5858

59+
console.log(repos);
60+
5961
repos.items = repos.items.filter((repo: RepoItem) => !repo.archived);
6062

6163
if (repos.items.length < 1) {

0 commit comments

Comments
 (0)