mirror of
https://github.com/dsoaress/link-free.git
synced 2026-11-30 05:34:44 +00:00
feat: add social links
This commit is contained in:
10 files changed
+207
-13
No files matched your search
@@ -0,0 +1,54 @@
|
||||
import {
|
||||
AiFillGithub as GitHub,
|
||||
AiOutlineInstagram as Instagram,
|
||||
AiOutlineWhatsApp as WhatsApp
|
||||
} from 'react-icons/ai'
|
||||
import { BsEnvelope as Email } from 'react-icons/bs'
|
||||
import { FaDev as Dev, FaLinkedinIn as LinkedIn } from 'react-icons/fa'
|
||||
import { IconType } from 'react-icons/lib'
|
||||
|
||||
import { Link } from '../Link'
|
||||
import { LinkVariantProps } from '../Link/styles'
|
||||
import { SocialItem, Wrapper } from './styles'
|
||||
|
||||
type SocialLink = {
|
||||
label: string
|
||||
href: string
|
||||
}
|
||||
|
||||
type SocialLinksProps = LinkVariantProps & {
|
||||
socialLinks: SocialLink[]
|
||||
}
|
||||
|
||||
const Icons = {
|
||||
Email,
|
||||
GitHub,
|
||||
LinkedIn,
|
||||
Dev,
|
||||
Instagram,
|
||||
WhatsApp
|
||||
}
|
||||
|
||||
export function SocialLinks({ socialLinks, color }: SocialLinksProps) {
|
||||
return (
|
||||
<Wrapper>
|
||||
{socialLinks.map(({ label, href }) => {
|
||||
const Icon: IconType = Icons[label as keyof typeof Icons]
|
||||
return (
|
||||
<SocialItem key={href}>
|
||||
<Link
|
||||
href={href}
|
||||
aria-label={label}
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
// @ts-ignore
|
||||
color={color}
|
||||
>
|
||||
<Icon size={22} />
|
||||
</Link>
|
||||
</SocialItem>
|
||||
)
|
||||
})}
|
||||
</Wrapper>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user