Skip to content

Commit 9c066f9

Browse files
Merge pull request #167 from Keith-Web3/OpenIssues
feat: added number of open issues
2 parents f87a4c1 + 4fee598 commit 9c066f9

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed

components/Card.tsx

Lines changed: 25 additions & 6 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 {
@@ -61,11 +61,11 @@ function Card({ repo }: Props) {
6161
</div>
6262

6363
{/* stars and forks cards */}
64-
<div className="w-full flex gap-3 xl:gap-5 text-neutral-100 cursor-pointer mt-8">
64+
<div className="container-query flex flex-wrap justify-between gap-3 xl:gap-5 text-neutral-100 cursor-pointer mt-8">
6565
<a
6666
href={`${repo.html_url}/stargazers`}
6767
target="_blank"
68-
className="group w-full border rounded-xl p-3 xl:px-4 flex items-center gap-2 xl:gap-3 relative"
68+
className="group w-full flex-shrink-0 flex-grow-1 basis-[120px] border rounded-xl p-3 xl:px-4 flex items-center gap-2 xl:gap-3 relative"
6969
>
7070
<GoStar className="text-yellow-200 text-2xl" />
7171
<div className="flex flex-col">
@@ -76,15 +76,15 @@ function Card({ repo }: Props) {
7676
</div>
7777
<div
7878
id="tooltip"
79-
className="hidden group-hover:block absolute bg-2023-void-2 text-2023-bavarian-gold-2 px-2 py-1 rounded-md"
79+
className="hidden group-hover:block text-sm absolute bg-2023-void-2 text-2023-bavarian-gold-2 px-2 py-1 rounded-md"
8080
>
8181
Checkout all the stars here!
8282
</div>
8383
</a>
8484
<a
8585
href={`${repo.html_url}/forks`}
8686
target="_blank"
87-
className="group w-full border rounded-xl p-3 flex items-center gap-3 relative"
87+
className="group flex-shrink-0 flex-grow-1 basis-[120px] border rounded-xl p-3 flex items-center gap-3 relative"
8888
>
8989
<GoRepoForked className="text-yellow-200 text-2xl" />
9090
<div className="flex flex-col">
@@ -95,11 +95,30 @@ function Card({ repo }: Props) {
9595
</div>
9696
<div
9797
id="tooltip"
98-
className="hidden group-hover:block absolute bg-2023-void-2 text-2023-bavarian-gold-2 px-2 py-1 rounded-md"
98+
className="hidden group-hover:block absolute text-sm bg-2023-void-2 text-2023-bavarian-gold-2 px-2 py-1 rounded-md"
9999
>
100100
Checkout all the forks here!
101101
</div>
102102
</a>
103+
<a
104+
href={`${repo.html_url}/issues`}
105+
target="_blank"
106+
className="group issues-btn flex-shrink-0 flex-grow-1 basis-[120px] border rounded-xl p-3 flex items-center gap-3 relative"
107+
>
108+
<GoIssueOpened className="text-yellow-200 text-2xl" />
109+
<div className="flex flex-col">
110+
<div className="text-lg xl:text-2xl font-semibold mb-0.5">
111+
{repo.open_issues_count}
112+
</div>
113+
<div className="text-neutral-300 text-xs lg:text-sm">Issues</div>
114+
</div>
115+
<div
116+
id="tooltip"
117+
className="hidden group-hover:block absolute text-sm bg-2023-void-2 text-2023-bavarian-gold-2 px-2 py-1 rounded-md"
118+
>
119+
Checkout all open issues here!
120+
</div>
121+
</a>
103122
</div>
104123
</div>
105124
</section>

styles/globals.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,18 @@ a {
7070
);
7171
border-radius: 2px;
7272
}
73+
74+
.container-query {
75+
container-type: inline-size;
76+
}
77+
78+
@container (max-width: 383px) {
79+
.issues-btn {
80+
margin-inline: auto;
81+
}
82+
}
83+
@container (max-width: 251px) {
84+
.issues-btn {
85+
margin-inline: 0;
86+
}
87+
}

0 commit comments

Comments
 (0)