1
0
Fork 0
freesewing/sites/shared/components/social/icons.mjs

90 lines
2.3 KiB
JavaScript
Raw Normal View History

2023-09-29 16:01:27 +02:00
// __SDEFILE__ - This file is a dependency for the stand-alone environment
2023-03-26 14:02:19 +02:00
import Link from 'next/link'
import { useTheme } from 'shared/hooks/use-theme.mjs'
2023-03-26 14:02:19 +02:00
import {
MsfIcon,
HelpIcon,
DiscordIcon,
FacebookIcon,
2023-05-17 17:04:15 +02:00
GitHubIcon,
2023-03-26 14:02:19 +02:00
InstagramIcon,
RedditIcon,
TwitterIcon,
OpenSourceIcon,
YouTubeIcon,
2023-03-26 14:02:19 +02:00
} from 'shared/components/icons.mjs'
import { social } from 'config/social.mjs'
2023-07-26 08:52:26 +02:00
import { siteConfig } from 'site/site.config.mjs'
2023-03-26 14:02:19 +02:00
const iconClasses = (color) => ({
className: `w-8 lg:w-12 h-8 lg:h-12 text-${color} hover:text-neutral-content`,
2023-03-26 14:02:19 +02:00
})
export const socialList = (spectrum) => ({
MSF: {
icon: <MsfIcon {...iconClasses(spectrum[0])} fill />,
2023-07-26 08:52:26 +02:00
href:
siteConfig.tld === 'org'
? '/docs/various/pledge/'
: 'https://freesewing.org/docs/various/pledge',
name: 'Doctors Without Borders / Médecins Sans Frontières',
community: false,
2023-03-26 14:02:19 +02:00
},
Discord: {
icon: <DiscordIcon {...iconClasses(spectrum[1])} />,
href: social.Discord,
community: true,
2023-03-26 14:02:19 +02:00
},
Instagram: {
icon: <InstagramIcon {...iconClasses(spectrum[2])} />,
href: social.Instagram,
community: true,
2023-03-26 14:02:19 +02:00
},
Facebook: {
icon: <FacebookIcon {...iconClasses(spectrum[3])} />,
href: social.Facebook,
community: true,
2023-03-26 14:02:19 +02:00
},
GitHub: {
icon: <GitHubIcon {...iconClasses(spectrum[4])} />,
href: social.GitHub,
community: true,
2023-03-26 14:02:19 +02:00
},
Reddit: {
icon: <RedditIcon {...iconClasses(spectrum[5])} />,
href: social.Reddit,
community: true,
2023-03-26 14:02:19 +02:00
},
Twitter: {
icon: <TwitterIcon {...iconClasses(spectrum[6])} />,
href: social.Twitter,
community: true,
2023-03-26 14:02:19 +02:00
},
YouTube: {
icon: <YouTubeIcon {...iconClasses(spectrum[7])} fill stroke={0} />,
href: social.YouTube,
community: true,
2023-03-26 14:02:19 +02:00
},
'Open Souce License: MIT': {
icon: <OpenSourceIcon {...iconClasses(spectrum[8])} />,
2023-03-26 14:02:19 +02:00
href: 'https://github.com/freesewing/freesewing/blob/develop/LICENSE',
community: false,
2023-03-26 14:02:19 +02:00
},
'Contact Information': {
icon: <HelpIcon {...iconClasses(spectrum[9])} />,
2023-03-26 14:02:19 +02:00
href: '/contact',
community: false,
2023-03-26 14:02:19 +02:00
},
})
2023-03-26 14:02:19 +02:00
export const SocialIcons = () => {
const { spectrum } = useTheme()
const list = socialList(spectrum)
return Object.keys(list).map((item) => (
<Link key={item} href={list[item].href} className="hover:text-secondary" title={item}>
{list[item].icon}
2023-03-26 14:02:19 +02:00
</Link>
))
}