Skip to content

Commit 56af19b

Browse files
committed
Add social media information to the game showcase frontend
1 parent c7fba0d commit 56af19b

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

client/src/hooks/useGameshowcase.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import api from "@/lib/api";
66
type Contributor = {
77
name: string;
88
role: string;
9+
social_media?: {
10+
socialMediaName: string;
11+
link: string;
12+
socialMediaUserName: string;
13+
}[];
914
};
1015

1116
type ApiShowcaseGame = {

client/src/pages/games/index.tsx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,22 +131,17 @@ export default function HomePage() {
131131
>
132132
- {contributor.role}
133133
</span>
134-
{/* Social icons placeholder */}
135-
{/* TODO: Add actual links */}
134+
{/* Social icons from API */}
136135
<span className="flex gap-2 text-primary">
137-
{/* Social icons using react-social-icons */}
138-
<SocialIcon
139-
url="https://facebook.com/"
140-
style={{ height: 24, width: 24 }}
141-
/>
142-
<SocialIcon
143-
url="https://instagram.com/"
144-
style={{ height: 24, width: 24 }}
145-
/>
146-
<SocialIcon
147-
url="https://github.com/"
148-
style={{ height: 24, width: 24 }}
149-
/>
136+
{Array.isArray(contributor.social_media) &&
137+
contributor.social_media.map((sm) => (
138+
<SocialIcon
139+
key={sm.link}
140+
url={sm.link}
141+
style={{ height: 24, width: 24 }}
142+
title={sm.socialMediaUserName}
143+
/>
144+
))}
150145
</span>
151146
</li>
152147
))}

0 commit comments

Comments
 (0)