Implemented first draft of issue modal

This commit is contained in:
ireic
2019-12-18 03:48:42 +01:00
parent f48b2a9d40
commit 386694d28f
97 changed files with 1972 additions and 428 deletions

View File

@@ -0,0 +1,21 @@
import React, { useState } from 'react';
import { copyToClipboard } from 'shared/utils/clipboard';
import { Button } from 'shared/components';
const CopyLinkButton = ({ ...otherProps }) => {
const [isLinkCopied, setLinkCopied] = useState(false);
const handleLinkCopy = () => {
setLinkCopied(true);
setTimeout(() => setLinkCopied(false), 2000);
copyToClipboard(window.location.href);
};
return (
<Button icon="link" onClick={handleLinkCopy} {...otherProps}>
{isLinkCopied ? 'Link Copied' : 'Copy link'}
</Button>
);
};
export default CopyLinkButton;