Skip to content

Commit 75de039

Browse files
fix(contributors): social circles hitbox (#17)
1 parent aaa79ca commit 75de039

File tree

2 files changed

+33
-24
lines changed

2 files changed

+33
-24
lines changed

src/components/contributors/Card.tsx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -508,28 +508,28 @@ export const Card: ParentComponent<CardProps> = (props) => {
508508
{Object.entries(socials).map(([key, value], i) => {
509509
if (!value) return null;
510510
return (
511-
<CircularIcon size={30}>
512-
<a
513-
href={value}
514-
target="_blank"
515-
rel="noopener noreferrer"
516-
>
517-
{key === "github" && <GithubIcon size={20} />}
518-
{key === "twitter" && <TwitterIcon size={20} />}
519-
{key === "bluesky" && <BlueskyIcon size={18} />}
520-
{key === "instagram" && <InstagramIcon size={22} />}
521-
{key === "youtube" && <YoutubeIcon size={22} />}
522-
{key === "twitch" && (
523-
<TwitchIcon size={18} class="mt-[2px] mr-[2px]" />
524-
)}
525-
{key === "kofi" && <KofiIcon size={20} />}
526-
{key === "discord" && <DiscordIcon size={20} />}
527-
{key === "tiktok" && <TiktokIcon size={20} />}
528-
{key === "printables" && <PrintablesIcon size={18} />}
529-
{key === "steam" && <SteamIcon size={18} />}
530-
{key === "matrix" && <MatrixIcon size={16} />}
531-
{key === "website" && <WebsiteIcon size={20} />}
532-
</a>
511+
<CircularIcon
512+
size={30}
513+
element="a"
514+
href={value}
515+
target="_blank"
516+
rel="noopener noreferrer"
517+
>
518+
{key === "github" && <GithubIcon size={20} />}
519+
{key === "twitter" && <TwitterIcon size={20} />}
520+
{key === "bluesky" && <BlueskyIcon size={18} />}
521+
{key === "instagram" && <InstagramIcon size={22} />}
522+
{key === "youtube" && <YoutubeIcon size={22} />}
523+
{key === "twitch" && (
524+
<TwitchIcon size={18} class="mt-[2px] mr-[2px]" />
525+
)}
526+
{key === "kofi" && <KofiIcon size={20} />}
527+
{key === "discord" && <DiscordIcon size={20} />}
528+
{key === "tiktok" && <TiktokIcon size={20} />}
529+
{key === "printables" && <PrintablesIcon size={18} />}
530+
{key === "steam" && <SteamIcon size={18} />}
531+
{key === "matrix" && <MatrixIcon size={16} />}
532+
{key === "website" && <WebsiteIcon size={20} />}
533533
</CircularIcon>
534534
);
535535
})}

src/components/contributors/CircularIcon.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,27 @@ type CircularIconProps = {
44
size: number;
55
children: JSX.Element;
66
class?: string;
7+
element?: "div" | "a";
8+
href?: string;
9+
target?: string;
10+
rel?: string;
711
};
812

913
export default function CircularIcon(props: CircularIconProps) {
14+
const BaseElement = props.element || "div";
15+
1016
return (
11-
<div
17+
<BaseElement
1218
class={`bg-background-10 shadow-lg rounded-full flex items-center justify-center overflow-hidden ${props.class ? `${props.class}` : ""}`}
1319
style={{
1420
width: `${props.size}px`,
1521
height: `${props.size}px`,
1622
}}
23+
href={props.href}
24+
target={props.target}
25+
rel={props.rel}
1726
>
1827
{props.children}
19-
</div>
28+
</BaseElement>
2029
);
2130
}

0 commit comments

Comments
 (0)