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

View File

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