Skip to content

Commit ac297af

Browse files
committed
Issue #148: Improve overall readability for Repo cards
1 parent 9dc8344 commit ac297af

File tree

1 file changed

+50
-46
lines changed

1 file changed

+50
-46
lines changed

components/Card.tsx

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,66 +8,70 @@ interface Props {
88

99
function Card({ repo }: Props) {
1010
return (
11-
<div className="shadow-sm card bg-2023-void-2 ring-1 ring-2023-manga-3">
12-
<div className="relative card-body">
13-
<div className="flex gap-4 items-center justify-start">
14-
<a
15-
className="border-2 rounded-full h-14 aspect-square p-1 border-neutral-100"
16-
href={repo.owner.html_url}
17-
title={repo.owner.login}
18-
target="_blank"
19-
rel="noreferrer"
20-
>
21-
<img
22-
src={repo.owner.avatar_url}
23-
alt={repo.owner.login}
24-
className="rounded-full"
25-
/>
26-
</a>
27-
<a
28-
href={repo.html_url}
29-
title={repo.name}
30-
target="_blank"
31-
rel="noreferrer"
32-
className="text-3xl cursor-pointer hover:underline text-2023-bavarian-gold-2 whitespace-nowrap overflow-hidden text-ellipsis max-w-full"
33-
>
34-
{repo.name}
35-
</a>
36-
</div>
37-
38-
<p className="my-2 text-neutral-300">{emojify(repo.description)}</p>
39-
40-
<div className="card-actions">
41-
{repo.topics.map((topic: string) => (
11+
<section className="shadow-sm card bg-2023-void-2 ring-1 ring-2023-manga-3 transition duration-300 hover:scale-105 hover:shadow-2xl hover:shadow-2023-bavarian-gold-2/30">
12+
<div className="relative card-body p-6">
13+
<div className="flex-1">
14+
<div className="flex gap-4 items-center justify-start">
4215
<a
43-
key={topic}
44-
href={`https://github.com/topics/${topic}`}
16+
className="border-2 rounded-full h-14 aspect-square p-1.5 border-neutral-100"
17+
href={repo.owner.html_url}
18+
title={repo.owner.login}
4519
target="_blank"
4620
rel="noreferrer"
47-
className={`badge ${
48-
topic === 'hacktoberfest'
49-
? 'bg-2023-bavarian-gold-1 text-2023-void-2'
50-
: 'bg-2023-bavarian-blue-2 text-2023-void-2'
51-
}`}
5221
>
53-
{topic}
22+
<img
23+
src={repo.owner.avatar_url}
24+
alt={repo.owner.login}
25+
className="rounded-full"
26+
/>
5427
</a>
55-
))}
28+
<h2>
29+
<a
30+
href={repo.html_url}
31+
title={repo.name}
32+
target="_blank"
33+
rel="noreferrer"
34+
className="text-3xl cursor-pointer hover:underline text-2023-bavarian-gold-2 whitespace-nowrap overflow-hidden text-ellipsis max-w-full"
35+
>
36+
{repo.name}
37+
</a>
38+
</h2>
39+
</div>
40+
41+
<h6 className="my-5 text-lg">{emojify(repo.description)}</h6>
42+
43+
<div className="card-actions gap-y-3">
44+
{repo.topics.map((topic: string) => (
45+
<a
46+
key={topic}
47+
href={`https://github.com/topics/${topic}`}
48+
target="_blank"
49+
rel="noreferrer"
50+
className={`badge inline px-3 py-0.5 h-auto ${
51+
topic === 'hacktoberfest'
52+
? 'bg-2023-bavarian-gold-1 text-2023-void-2'
53+
: 'bg-2023-bavarian-blue-2 text-2023-void-2'
54+
}`}
55+
>
56+
{topic}
57+
</a>
58+
))}
59+
</div>
5660
</div>
5761

5862
{/* stars and forks cards */}
59-
<div className="w-full flex gap-3 xl:gap-5 text-neutral-100 cursor-pointer mt-6">
63+
<div className="w-full flex gap-3 xl:gap-5 text-neutral-100 cursor-pointer mt-8">
6064
<a
6165
href={`${repo.html_url}/stargazers`}
6266
target="_blank"
6367
className="group w-full border rounded-xl p-3 xl:px-4 flex items-center gap-2 xl:gap-3 relative"
6468
>
6569
<GoStar className="text-yellow-200 text-2xl" />
6670
<div className="flex flex-col">
67-
<div className="xl:text-2xl text-lg font-semibold">
71+
<div className="text-lg xl:text-2xl font-semibold mb-0.5">
6872
{repo.stargazers_count}
6973
</div>
70-
<div className="text-neutral-400 text-xs lg:text-sm">Stars</div>
74+
<div className="text-neutral-300 text-xs lg:text-sm">Stars</div>
7175
</div>
7276
<div
7377
id="tooltip"
@@ -83,8 +87,8 @@ function Card({ repo }: Props) {
8387
>
8488
<GoRepoForked className="text-yellow-200 text-2xl" />
8589
<div className="flex flex-col">
86-
<div className="text-2xl font-semibold">{repo.forks}</div>
87-
<div className="text-neutral-400 text-xs lg:text-sm">Forks</div>
90+
<div className="text-lg xl:text-2xl font-semibold mb-0.5">{repo.forks}</div>
91+
<div className="text-neutral-300 text-xs lg:text-sm">Forks</div>
8892
</div>
8993
<div
9094
id="tooltip"
@@ -95,7 +99,7 @@ function Card({ repo }: Props) {
9599
</a>
96100
</div>
97101
</div>
98-
</div>
102+
</section>
99103
);
100104
}
101105

0 commit comments

Comments
 (0)