Skip to content

Commit a526da4

Browse files
committed
Contributor: Avatar image now clickable
1 parent 46c49b7 commit a526da4

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

components/mdx/Contributor.tsx

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,30 @@ export function Contributor({ handle, avatarSize }: ContributorProps) {
1616
return (
1717
<HStack paddingX={2} columnGap={4}>
1818
<Center width={40}>
19-
<Avatar
20-
size={avatarSize}
21-
name={contrib.displayName}
22-
src={contrib.avatarUrl}
23-
/>
19+
{contrib.moreInfoUrl ? (
20+
<Link
21+
as={NextLink}
22+
href={contrib.moreInfoUrl}
23+
passHref
24+
isExternal
25+
textDecoration="underline"
26+
>
27+
<Avatar
28+
size={avatarSize}
29+
name={contrib.displayName}
30+
src={contrib.avatarUrl}
31+
/>
32+
</Link>
33+
) : (
34+
<Avatar
35+
size={avatarSize}
36+
name={contrib.displayName}
37+
src={contrib.avatarUrl}
38+
/>
39+
)}
2440
</Center>
2541
<Box>
26-
{contrib.moreInfoUrl && (
42+
{contrib.moreInfoUrl ? (
2743
<Link
2844
as={NextLink}
2945
href={contrib.moreInfoUrl}
@@ -33,8 +49,9 @@ export function Contributor({ handle, avatarSize }: ContributorProps) {
3349
>
3450
<Text fontSize={18}>{contrib.displayName}</Text>
3551
</Link>
52+
) : (
53+
<Text>{contrib.displayName}</Text>
3654
)}
37-
{!contrib.moreInfoUrl && <Text>{contrib.displayName}</Text>}
3855

3956
{contrib.about && (
4057
<Box mt={2} maxWidth="xl">

0 commit comments

Comments
 (0)