From 0890fdd951d021308550a0db2e7b6f2593512957 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 30 May 2020 17:27:04 +0200 Subject: initial site copied in --- frontend/common/copyToClipboardButton.component.js | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 frontend/common/copyToClipboardButton.component.js (limited to 'frontend/common/copyToClipboardButton.component.js') diff --git a/frontend/common/copyToClipboardButton.component.js b/frontend/common/copyToClipboardButton.component.js new file mode 100644 index 0000000..cfe7103 --- /dev/null +++ b/frontend/common/copyToClipboardButton.component.js @@ -0,0 +1,24 @@ +import React, { Component } from 'react'; +import { writeToClipboard } from '../util' + +export default class CopyToClipboardButton extends Component { + state = { + copied: false, + } + + handleClick() { + writeToClipboard(this.props.data) + this.setState({ copied: true }) + } + + render() { + return ( + + ) + } +} -- cgit v1.2.3-70-g09d2