80 lines
2.1 KiB
TypeScript
80 lines
2.1 KiB
TypeScript
export type Icon =
|
|
| 'twitter'
|
|
| 'bandcamp'
|
|
| 'discord'
|
|
| 'envelope'
|
|
| 'soundcloud'
|
|
| 'teespring'
|
|
| 'twitch'
|
|
import styles from "../styles/Icons.module.sass"
|
|
import {
|
|
FaBandcamp,
|
|
FaDiscord,
|
|
FaEnvelope,
|
|
FaSoundcloud,
|
|
FaTwitter,
|
|
FaTwitch
|
|
} from 'react-icons/fa'
|
|
import { SiSpringCreators } from 'react-icons/si'
|
|
const Icon = ({
|
|
icon,
|
|
className,
|
|
}: {
|
|
icon: Icon | string
|
|
className?: string
|
|
}) => {
|
|
const size = '3rem'
|
|
switch (icon) {
|
|
case 'twitter':
|
|
return (
|
|
<FaTwitter
|
|
className={[styles.icon, styles[className]].join(' ')}
|
|
size={size}
|
|
/>
|
|
)
|
|
case 'bandcamp':
|
|
return (
|
|
<FaBandcamp
|
|
className={[styles.icon, styles[className]].join(' ')}
|
|
size={size}
|
|
/>
|
|
)
|
|
case 'twitch':
|
|
return (
|
|
<FaTwitch
|
|
className={[styles.icon, styles[className]].join(' ')}
|
|
size={size}
|
|
/>
|
|
)
|
|
case 'discord':
|
|
return (
|
|
<FaDiscord
|
|
className={[styles.icon, styles[className]].join(' ')}
|
|
size={size}
|
|
/>
|
|
)
|
|
case 'envelope':
|
|
return (
|
|
<FaEnvelope
|
|
className={[styles.icon, styles[className]].join(' ')}
|
|
size={size}
|
|
/>
|
|
)
|
|
case 'soundcloud':
|
|
return (
|
|
<FaSoundcloud
|
|
className={[styles.icon, styles[className]].join(' ')}
|
|
size={size}
|
|
/>
|
|
)
|
|
case 'teespring':
|
|
return (
|
|
<SiSpringCreators
|
|
className={[styles.icon, styles[className]].join(' ')}
|
|
size={size}
|
|
/>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default Icon
|