stuff happened
This commit is contained in:
14
frontend/components/ShareLinkButton.tsx
Normal file
14
frontend/components/ShareLinkButton.tsx
Normal file
@ -0,0 +1,14 @@
|
||||
export const ShareLinkButton = function ShareLinkButton({props}) {
|
||||
const [text. setText] = useState("Share");
|
||||
|
||||
const onClickHandler = () => {
|
||||
navigator.clipboard.writeText(location.href);
|
||||
setText("Copied to clipboard!");
|
||||
};
|
||||
|
||||
return (
|
||||
<button onClick={onClickHandler}>
|
||||
{text}
|
||||
</button>
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user