Skip to content

Commit 49a4393

Browse files
committed
Add social media icons for contributors in individual game page
1 parent b01bb64 commit 49a4393

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

client/src/pages/games/[id].tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Image from "next/image";
22
import { useRouter } from "next/router";
33
import React from "react";
4+
import { SocialIcon } from "react-social-icons";
45

56
import { ItchEmbed } from "@/components/ui/ItchEmbed";
67
import { useGame } from "@/hooks/useGames";
@@ -107,17 +108,29 @@ export default function IndividualGamePage() {
107108
Contributors
108109
</td>
109110
<td className="py-1 text-right sm:py-2">
110-
<div className="grid grid-cols-[auto_auto] gap-x-1 gap-y-1">
111+
<div className="flex flex-col gap-y-1">
111112
{game.contributors.map((c) => (
112-
<React.Fragment key={c.member_id}>
113+
<div
114+
key={c.member_id}
115+
className="flex items-center gap-x-2"
116+
>
113117
<a
114118
href={`/member/${c.member_id}`}
115119
className="text-primary hover:underline"
116120
>
117121
{c.name}
118122
</a>
119-
<span>{c.role}</span>
120-
</React.Fragment>
123+
{Array.isArray(c.social_media) &&
124+
c.social_media.map((sm) => (
125+
<SocialIcon
126+
key={sm.link}
127+
url={sm.link}
128+
style={{ height: 24, width: 24 }}
129+
title={sm.socialMediaUserName}
130+
/>
131+
))}
132+
<span className="ml-auto">{c.role}</span>
133+
</div>
121134
))}
122135
</div>
123136
</td>

0 commit comments

Comments
 (0)