mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
🔥
This commit is contained in:
parent
452f8a4e16
commit
e1fd388272
15 changed files with 1926 additions and 20 deletions
|
@ -1,36 +0,0 @@
|
|||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
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)}>
|
||||
<FontAwesomeIcon icon={icon} />
|
||||
</a>
|
||||
) : (
|
||||
<a href={reference} target='_blank' rel='noopener noreferrer' aria-label="Icon">
|
||||
<FontAwesomeIcon 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
|
Loading…
Add table
Add a link
Reference in a new issue