Prettier and a new readme

This commit is contained in:
skidoodle 2022-08-26 21:27:32 +02:00
parent 146b35d1d3
commit f21d8f8086
16 changed files with 352 additions and 2594 deletions

View file

@ -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>
);
};

View file

@ -1,39 +1,45 @@
import { IconType } from 'react-icons/lib'
import { FaDiscord, FaEnvelope, FaGithub, FaInstagram, FaSteam } from 'react-icons/fa'
import { IconType } from "react-icons/lib";
import {
FaDiscord,
FaEnvelope,
FaGithub,
FaInstagram,
FaSteam,
} from "react-icons/fa";
type Socials = {
id: number,
ref: string
icon: IconType,
copyValue?: boolean,
}
id: number;
ref: string;
icon: IconType;
copyValue?: boolean;
};
export const socials: Array<Socials> = [
{
id: 1,
ref: 'https://github.com/skidoodle',
icon: FaGithub,
},
{
id: 2,
ref: 'https://steamcommunity.com/id/_albert',
icon: FaSteam,
},
{
id: 3,
ref: 'contact@albert.lol',
icon: FaEnvelope,
copyValue: true,
},
{
id: 4,
ref: 'https://www.instagram.com/albertadam_/',
icon: FaInstagram,
},
{
id: 5,
ref: 'albert#8838',
icon: FaDiscord,
copyValue: true,
}
]
{
id: 1,
ref: "https://github.com/skidoodle",
icon: FaGithub,
},
{
id: 2,
ref: "https://steamcommunity.com/id/_albert",
icon: FaSteam,
},
{
id: 3,
ref: "contact@albert.lol",
icon: FaEnvelope,
copyValue: true,
},
{
id: 4,
ref: "https://www.instagram.com/albertadam_/",
icon: FaInstagram,
},
{
id: 5,
ref: "albert#8838",
icon: FaDiscord,
copyValue: true,
},
];