1
0
mirror of https://github.com/XFox111/my-website.git synced 2026-04-22 07:28:01 +03:00

init: First version

This commit is contained in:
2024-08-19 23:08:50 +00:00
commit 3ec7d9a722
134 changed files with 17088 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import socials from "@/_data/socials";
import React from "react";
import { SocialIcon, networkFor, social_icons } from "react-social-icons";
import cls from "./SocialLinks.module.scss";
const SocialLinks: React.FC<SocialLinksProps> = ({ size = 50, ...props }) => (
<div aria-label="Social links" { ...props } className={ `${cls.socials} ${props.className}` }>
{ Object.entries(socials).map(([network, i]) =>
<SocialIcon
key={ network } title={ network }
url={ i.href } target="_blank"
className={ `${cls.link} ${cls[networkFor(i.href)] ?? ""}` }
style={ {
// @ts-expect-error Inline variables are not supported in TS definition, but it works.
"--network-color": social_icons.get(networkFor(i.href))?.color,
width: size,
height: size
} } />
) }
</div>
);
export default SocialLinks;
export type SocialLinksProps = React.HTMLAttributes<HTMLDivElement> & {
size?: number;
};