diff --git a/README.md b/README.md index e260cdb..364a74b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # webdrop + + Peer-to-peer file transfers in your browser ## Usage diff --git a/client/actions/DownloadActions.js b/client/actions/DownloadActions.js index 29568a1..42551f8 100644 --- a/client/actions/DownloadActions.js +++ b/client/actions/DownloadActions.js @@ -4,7 +4,7 @@ export default alt.createActions(class DownloadActions { constructor() { this.generateActions( 'requestDownload', - 'setDownloadInfo' + 'beginDownload' ) } }) diff --git a/client/actions/PeerActions.js b/client/actions/PeerActions.js deleted file mode 100644 index c363f1f..0000000 --- a/client/actions/PeerActions.js +++ /dev/null @@ -1,9 +0,0 @@ -import alt from '../alt'; - -export default alt.createActions(class PeerActions { - constructor() { - this.generateActions( - 'peerConnected' - ) - } -}) diff --git a/client/alt.js b/client/alt.js index 487e70b..aa4173f 100644 --- a/client/alt.js +++ b/client/alt.js @@ -1,2 +1,2 @@ var Alt = require('alt'); -module.exports = new Alt(); +export default new Alt(); diff --git a/client/components/App.js b/client/components/App.js index 9a4c877..d08dfaa 100644 --- a/client/components/App.js +++ b/client/components/App.js @@ -1,70 +1,23 @@ -import DownloadActions from '../actions/DownloadActions'; -import DownloadStore from '../stores/DownloadStore'; -import DropZone from './DropZone'; -import FileDescription from './FileDescription'; -import PeerStore from '../stores/PeerStore'; +import FrozenHead from 'react-frozenhead'; import React from 'react'; -import Tempalink from './Tempalink'; -import UploadActions from '../actions/UploadActions'; -import UploadStore from '../stores/UploadStore'; - -function getState() { - return { - peerID: PeerStore.getPeerID(), - readyToUpload: UploadStore.getState().status.isUploading(), - uploadFile: UploadStore.getState().file, - uploadToken: UploadStore.getState().token, - downloadFile: DownloadStore.getState().file, - downloadToken: DownloadStore.getState().token, - readyToDownload: DownloadStore.getState().status.isReady() - }; -} +import { RouteHandler } from 'react-router'; export default class App extends React.Component { - constructor() { - - this.state = getState(); - this._onChange = function() { - this.setState(getState()); - }.bind(this); - - } - - componentDidMount() { - PeerStore.listen(this._onChange); - UploadStore.listen(this._onChange); - DownloadStore.listen(this._onChange); - } - - componentDidUnmount() { - PeerStore.unlisten(this._onChange); - UploadStore.unlisten(this._onChange); - DownloadStore.unlisten(this._onChange); - } - - uploadFile(file) { - UploadActions.uploadFile(file); - } - - downloadFile() { - DownloadActions.requestDownload(); - } - render() { - if (this.state.readyToUpload) { - return
The easiest way to send someone a file.
+Drag the file into this window to get started.
+Processing...
+Send someone this link to download.
+This link will work as long as this page is open.
+ +