copy function

This commit is contained in:
BFlat authored and Brandon Thomas committed 2022-07-21 23:39:14 -04:00
1 parent 3866423be3
commit f167ec0627
1 file changed
+7 -2
@@ -187,6 +187,11 @@ function ProfileFc(props: Props) {
profileRows.push(<div key="twitter">{twitterLink}</div>);
}
function copyToClipboard(username: string): void {
navigator.clipboard.writeText(username);
alert("Copied the text: " + copyText);
}
if (userData.discord_username) {
profileRows.push(
<Tippy
@@ -198,9 +203,9 @@ function ProfileFc(props: Props) {
</span>
}
>
<Link to="#">
<a href="/" onclick="copyToClipboard(userData.discord_username)">
<FontAwesomeIcon icon={faDiscord} />
</Link>
</a>
</Tippy>
);
}