import DropZone from './DropZone'
import React from 'react'
import Spinner from './Spinner'
import Tempalink from './Tempalink'
import UploadActions from '../actions/UploadActions'
import UploadStore from '../stores/UploadStore'
import socket from 'filepizza-socket'
export default class UploadPage extends React.Component {
constructor() {
super()
this.state = UploadStore.getState()
this._onChange = () => {
this.setState(UploadStore.getState())
}
}
componentDidMount() {
UploadStore.listen(this._onChange)
}
componentDidUnmount() {
UploadStore.unlisten(this._onChange)
}
uploadFile(file) {
UploadActions.uploadFile(file)
}
handleSelectedFile(event) {
let files = event.target.files
if (files.length > 0) {
UploadActions.uploadFile(files[0])
}
}
render() {
switch (this.state.status) {
case 'ready':
return Free peer-to-peer file transfers in your browser. We never store anything. Files only served fresh.
FilePizza
Processing...
Send someone this link to download.
This link will work as long as this page is open.