mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
Prettier and a new readme
This commit is contained in:
parent
146b35d1d3
commit
f21d8f8086
16 changed files with 352 additions and 2594 deletions
|
@ -1,32 +1,43 @@
|
|||
import Link from 'next/link'
|
||||
import toast from 'react-hot-toast'
|
||||
import copy from 'copy-to-clipboard'
|
||||
import Link from "next/link";
|
||||
import toast from "react-hot-toast";
|
||||
import copy from "copy-to-clipboard";
|
||||
|
||||
type Icon = {
|
||||
children: any,
|
||||
reference: string,
|
||||
copyValue?: boolean,
|
||||
}
|
||||
children: any;
|
||||
reference: string;
|
||||
copyValue?: boolean;
|
||||
};
|
||||
|
||||
const notify = () => {
|
||||
toast.remove(),
|
||||
toast.success('Copied to clipboard', {
|
||||
style: {
|
||||
background: '#0f1012',
|
||||
color: '#fff',
|
||||
fontSize: '1em'
|
||||
}
|
||||
}
|
||||
)}
|
||||
toast.remove(),
|
||||
toast.success("Copied to clipboard", {
|
||||
style: {
|
||||
background: "#0f1012",
|
||||
color: "#fff",
|
||||
fontSize: "1em",
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export const Icon = ({ children, reference, copyValue }: Icon) => {
|
||||
if(copyValue) {
|
||||
return <a className={`cursor-pointer`} onClick={ () => { notify(), copy(reference) }} >{ children }</a>
|
||||
}
|
||||
|
||||
if (copyValue) {
|
||||
return (
|
||||
<Link href={ reference }>
|
||||
<a target='_blank' className={`cursor-pointer`}>{ children }</a>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
<a
|
||||
className={`cursor-pointer`}
|
||||
onClick={() => {
|
||||
notify(), copy(reference);
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Link href={reference}>
|
||||
<a target="_blank" className={`cursor-pointer`}>
|
||||
{children}
|
||||
</a>
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue