Commit b3f87eba authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Add copy to clipboard of upload id to uploads on upload page.

parent cbd3076a
......@@ -20,6 +20,8 @@ import DecideIcon from '@material-ui/icons/Help'
import { withApi } from '../api'
import Markdown from '../Markdown'
import ConfirmDialog from './ConfirmDialog'
import ClipboardIcon from '@material-ui/icons/Assignment'
import { CopyToClipboard } from 'react-copy-to-clipboard'
class PublishConfirmDialog extends React.Component {
static propTypes = {
......@@ -352,11 +354,20 @@ class Upload extends React.Component {
renderTitle() {
const { classes } = this.props
const { name, create_time } = this.state.upload
const { name, create_time, upload_id } = this.state.upload
return (
<div className={classes.titleContainer}>
<Typography variant="h6" className={name ? classes.shortTitle : classes.title}>
<CopyToClipboard
text={upload_id} onCopy={() => null}
>
<Tooltip title={`Copy the upload id to clipboard`} onClick={e => e.stopPropagation()}>
<IconButton style={{margin: 3, marginRight: 0, padding: 4}}>
<ClipboardIcon style={{fontSize: 16}} />
</IconButton>
</Tooltip>
</CopyToClipboard>
{name || new Date(Date.parse(create_time)).toLocaleString()}
</Typography>
{name
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment