review comments

This commit is contained in:
Jonathan Rainville 2018-10-19 13:22:37 -04:00 committed by Pascal Precht
parent 2d66870773
commit fd67844235
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
2 changed files with 4 additions and 4 deletions

View File

@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import {Badge, Tooltip} from "reactstrap";
import classNames from 'classnames';
import {CopyToClipboard} from 'react-copy-to-clipboard';
import FontAwesome from 'react-fontawesome';
import uuid from 'uuid/v1';
import './CopyButton.css';
@ -23,7 +24,7 @@ class CopyButton extends React.Component {
this.setState({
showCopied: true
});
// Hide the tooltip after a few seconds
// Hide the tooltip after 1.5s
clearTimeout(this.showTimeout);
this.showTimeout = setTimeout(() => {
this.setState({showCopied: false});
@ -35,9 +36,9 @@ class CopyButton extends React.Component {
return (<CopyToClipboard text={text}
onCopy={() => this.onCopy()}
title={title}>
<Badge className={classNames('copy-to-clipboard', 'p-' + (size ? size : 3))}
<Badge className={classNames('copy-to-clipboard', 'p-' + (size || 3))}
color="primary" id={'copy-button-' + this.id}>
<i className="fa fa-copy"/>
<FontAwesome name="copy"/>
{this.state.showCopied &&
<Tooltip isOpen={true} target={'copy-button-' + this.id}>
Copied to clipboard

View File

@ -25,7 +25,6 @@
display: none;
}
.react-json-view {
border-radius: .25rem;
}