diff options
Diffstat (limited to 'client/src/Components/CopyButton.js')
| -rw-r--r-- | client/src/Components/CopyButton.js | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/client/src/Components/CopyButton.js b/client/src/Components/CopyButton.js deleted file mode 100644 index 65c4cb9..0000000 --- a/client/src/Components/CopyButton.js +++ /dev/null @@ -1,24 +0,0 @@ -import React, {useState} from 'react'; -import copy from 'clipboard-copy'; - -function CopyButton(props) { - const [copied, setCopied] = useState(false); - - const handleClick = async () => { - await copy("https://sho.rest/" + props.hash); - setCopied(true); - }; - - let content; - if (copied) { - content = <span>Link Copied!</span>; - } else { - content = <strong>Copy Link</strong>; - } - - return ( - <span className="copy-text right-item" onClick={handleClick}>{content}</span> - ) -} - -export default CopyButton; \ No newline at end of file |
