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.
47 lines
1000 B
TypeScript
47 lines
1000 B
TypeScript
import Arrow from '@app/components/Arrow'
|
|
import React from 'react'
|
|
import UploadActions from '@app/actions/UploadActions'
|
|
|
|
export default class UploadPage extends React.Component {
|
|
constructor() {
|
|
super()
|
|
this.uploadFile = this.uploadFile.bind(this)
|
|
}
|
|
|
|
uploadFile(file) {
|
|
UploadActions.uploadFile(file)
|
|
}
|
|
|
|
render() {
|
|
switch (this.props.status) {
|
|
case 'ready':
|
|
return (
|
|
<div>
|
|
<DropZone onDrop={this.uploadFile} />
|
|
<Arrow dir="up" />
|
|
</div>
|
|
)
|
|
break
|
|
|
|
case 'processing':
|
|
return (
|
|
<div>
|
|
<Arrow dir="up" animated />
|
|
<FileDescription file={this.props.file} />
|
|
</div>
|
|
)
|
|
break
|
|
|
|
case 'uploading':
|
|
return (
|
|
<div>
|
|
<Arrow dir="up" animated />
|
|
<FileDescription file={this.props.file} />
|
|
<Temaplink token={this.props.token} />
|
|
</div>
|
|
)
|
|
break
|
|
}
|
|
}
|
|
}
|