Skip to content

Commit 1ba7dc6

Browse files
Merge pull request #149 from NishidhJain/ui-enhacement/repo-cards-redesign
Issue #148: Improve overall readability for Repo cards
2 parents 39e69ad + d9224d5 commit 1ba7dc6

File tree

2 files changed

+50
-47
lines changed

2 files changed

+50
-47
lines changed

components/Card.tsx

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,66 +8,69 @@ 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 className="text-3xl cursor-pointer hover:underline text-2023-bavarian-gold-2 whitespace-nowrap overflow-hidden text-ellipsis max-w-full">
29+
<a
30+
href={repo.html_url}
31+
title={repo.name}
32+
target="_blank"
33+
rel="noreferrer"
34+
>
35+
{repo.name}
36+
</a>
37+
</h2>
38+
</div>
39+
40+
<h6 className="my-5 text-lg">{emojify(repo.description)}</h6>
41+
42+
<div className="card-actions gap-y-3">
43+
{repo.topics.map((topic: string) => (
44+
<a
45+
key={topic}
46+
href={`https://github.com/topics/${topic}`}
47+
target="_blank"
48+
rel="noreferrer"
49+
className={`badge inline px-3 py-0.5 h-auto ${
50+
topic === 'hacktoberfest'
51+
? 'bg-2023-bavarian-gold-1 text-2023-void-2'
52+
: 'bg-2023-bavarian-blue-2 text-2023-void-2'
53+
}`}
54+
>
55+
{topic}
56+
</a>
57+
))}
58+
</div>
5659
</div>
5760

5861
{/* stars and forks cards */}
59-
<div className="w-full flex gap-3 xl:gap-5 text-neutral-100 cursor-pointer mt-6">
62+
<div className="w-full flex gap-3 xl:gap-5 text-neutral-100 cursor-pointer mt-8">
6063
<a
6164
href={`${repo.html_url}/stargazers`}
6265
target="_blank"
6366
className="group w-full border rounded-xl p-3 xl:px-4 flex items-center gap-2 xl:gap-3 relative"
6467
>
6568
<GoStar className="text-yellow-200 text-2xl" />
6669
<div className="flex flex-col">
67-
<div className="xl:text-2xl text-lg font-semibold">
70+
<div className="text-lg xl:text-2xl font-semibold mb-0.5">
6871
{repo.stargazers_count}
6972
</div>
70-
<div className="text-neutral-400 text-xs lg:text-sm">Stars</div>
73+
<div className="text-neutral-300 text-xs lg:text-sm">Stars</div>
7174
</div>
7275
<div
7376
id="tooltip"
@@ -83,8 +86,8 @@ function Card({ repo }: Props) {
8386
>
8487
<GoRepoForked className="text-yellow-200 text-2xl" />
8588
<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>
89+
<div className="text-lg xl:text-2xl font-semibold mb-0.5">{repo.forks}</div>
90+
<div className="text-neutral-300 text-xs lg:text-sm">Forks</div>
8891
</div>
8992
<div
9093
id="tooltip"
@@ -95,7 +98,7 @@ function Card({ repo }: Props) {
9598
</a>
9699
</div>
97100
</div>
98-
</div>
101+
</section>
99102
);
100103
}
101104

components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function Header() {
4242
rel="noreferrer"
4343
className="btn btn-square btn-ghost umami--click--github-button"
4444
>
45-
<IoLogoGithub size="1.5rem" title="GitHub" />
45+
<IoLogoGithub size="1.5rem" color='white' title="GitHub" />
4646
</a>
4747
</div>
4848
</div>

0 commit comments

Comments
 (0)