CopyToClipboard: remove tooltip
This commit is contained in:
parent
522b7108f9
commit
e9e9475830
@ -15,6 +15,10 @@
|
|||||||
/* along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
/* along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
.data {
|
.data {
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ import styles from './copyToClipboard.css';
|
|||||||
export default class CopyToClipboard extends Component {
|
export default class CopyToClipboard extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
data: PropTypes.string.isRequired,
|
data: PropTypes.string.isRequired,
|
||||||
label: PropTypes.string,
|
|
||||||
onCopy: PropTypes.func,
|
onCopy: PropTypes.func,
|
||||||
size: PropTypes.number, // in px
|
size: PropTypes.number, // in px
|
||||||
cooldown: PropTypes.number // in ms
|
cooldown: PropTypes.number // in ms
|
||||||
@ -36,7 +35,6 @@ export default class CopyToClipboard extends Component {
|
|||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
className: '',
|
className: '',
|
||||||
label: 'copy to clipboard',
|
|
||||||
onCopy: () => {},
|
onCopy: () => {},
|
||||||
size: 16,
|
size: 16,
|
||||||
cooldown: 1000
|
cooldown: 1000
|
||||||
@ -55,12 +53,12 @@ export default class CopyToClipboard extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { data, label, size } = this.props;
|
const { data, size } = this.props;
|
||||||
const { copied } = this.state;
|
const { copied } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Clipboard onCopy={ this.onCopy } text={ data }>
|
<Clipboard onCopy={ this.onCopy } text={ data }>
|
||||||
<div>
|
<div className={ styles.wrapper }>
|
||||||
<Snackbar
|
<Snackbar
|
||||||
open={ copied }
|
open={ copied }
|
||||||
message={
|
message={
|
||||||
@ -70,10 +68,7 @@ export default class CopyToClipboard extends Component {
|
|||||||
bodyStyle={ { backgroundColor: darkBlack } }
|
bodyStyle={ { backgroundColor: darkBlack } }
|
||||||
/>
|
/>
|
||||||
<IconButton
|
<IconButton
|
||||||
tooltip={ copied ? 'done!' : label }
|
|
||||||
disableTouchRipple
|
disableTouchRipple
|
||||||
tooltipPosition={ 'top-right' }
|
|
||||||
tooltipStyles={ { marginTop: `-${size / 4}px` } }
|
|
||||||
style={ { width: size, height: size, padding: '0' } }
|
style={ { width: size, height: size, padding: '0' } }
|
||||||
iconStyle={ { width: size, height: size } }
|
iconStyle={ { width: size, height: size } }
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user