import Spinner from './Spinner' import DropZone from './DropZone' import ProgressBar from './ProgressBar' import React from 'react' import Tempalink from './Tempalink' import UploadActions from '../actions/UploadActions' import UploadStore from '../stores/UploadStore' import socket from '../socket' export default class UploadPage extends React.Component { constructor() { this.state = UploadStore.getState() this._onChange = () => { this.setState(UploadStore.getState()) } this._onDownload = (peerID) => { UploadActions.sendToDownloader(peerID) } } componentDidMount() { UploadStore.listen(this._onChange) socket.on('download', this._onDownload) } componentDidUnmount() { UploadStore.unlisten(this._onChange) socket.removeListener('download', this._onDownload) } uploadFile(file) { UploadActions.uploadFile(file) } render() { switch (this.state.status) { case 'ready': return

WebDrop

The easiest way to send someone a file.

Drag the file into this window to get started.

case 'processing': return

WebDrop

Processing...

case 'uploading': var keys = Object.keys(this.state.peerProgress) var numInProgress = 0 var numCompleted = 0 for (var k = 0; k < keys.length; k++) { if (this.state.peerProgress[keys[k]] < 1) { numInProgress++ } else { numCompleted++ } } keys.reverse() return

Send someone this link to download.

This link will work as long as this page is open.

{ keys.map((key) => { return })}
} } }