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.
36 lines
846 B
TypeScript
36 lines
846 B
TypeScript
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(e) {
|
|
e.target.setSelectionRange(0, 9999)
|
|
}
|
|
|
|
render() {
|
|
const url = `${window.location.origin}/${this.props.token}`
|
|
const shortUrl = `${window.location.origin}/download/${this.props.shortToken}`
|
|
|
|
return (
|
|
<div className="tempalink">
|
|
<div className="qr">
|
|
<QRCode text={url} />
|
|
</div>
|
|
<div className="urls">
|
|
<div className="long-url">
|
|
<input onClick={this.onClick} readOnly type="text" value={url} />
|
|
</div>
|
|
|
|
<div className="short-url">
|
|
or, for short: <span>{shortUrl}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
}
|