mirror of https://github.com/kern/filepizza
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
558 B
JavaScript
29 lines
558 B
JavaScript
import React from 'react'
|
|
import QRCode from 'react-qr'
|
|
|
|
export default class Tempalink extends React.Component {
|
|
constructor() {
|
|
super()
|
|
this.onClick = this.onClick.bind(this)
|
|
}
|
|
|
|
onClick() {
|
|
this.refs.input.getDOMNode().setSelectionRange(0, 9999)
|
|
}
|
|
|
|
render() {
|
|
var url = window.location.origin + '/' + this.props.token
|
|
return <div className="tempalink">
|
|
<input
|
|
onClick={this.onClick}
|
|
readOnly
|
|
ref="input"
|
|
type="text"
|
|
value={url} />
|
|
|
|
<QRCode text={url} />
|
|
</div>
|
|
}
|
|
|
|
}
|