This commit is contained in:
skidoodle 2022-05-01 22:50:31 +02:00
commit b9dc57578a
26 changed files with 2590 additions and 0 deletions

35
components/Icon.tsx Normal file
View file

@ -0,0 +1,35 @@
import toast, { Toaster } from 'react-hot-toast';
import copy from 'copy-to-clipboard'
const Icon = ({icon, reference, copy = false} : {icon: any, reference: any, copy?: boolean}) => {
return(
<>
{
copy ? (
<a onClick={() => doThings(reference)}>
{icon}
</a>
) : (
<a href={reference} target='_blank' rel='noopener noreferrer' aria-label="Icon">
{icon}
</a>
)
}
<Toaster position='bottom-left' reverseOrder={false} />
</>
)
}
const doThings = (value: any) => {
copy(value)
toast.remove()
toast.success('Successfully copied to clipboard', {
style: {
background: '#111',
color: '#fff',
fontSize: '1.1rem'
}
})
}
export default Icon