import classnames from 'classnames'; import React from 'react'; const methodsToBind = [ 'getContent', 'handleDestinationChange', 'handleUrlChange', 'handleAddTorrent', 'handleButtonClick' ]; export default class AddTorrentPanel extends React.Component { constructor() { super(); this.state = { isExpanded: false }; methodsToBind.forEach((method) => { this[method] = this[method].bind(this); }); } getContent() { return (
Add Torrent
); } handleAddTorrent() { // TorrentActions.add({ // url: this.state.url, // destination: this.state.destination // }); } handleButtonClick(evt) { evt.stopPropagation(); this.setState({ isExpanded: !this.state.isExpanded }); } handleDestinationChange(event) { this.setState({ destination: event.target.value }) } handleMenuWrapperClick(evt) { evt.stopPropagation(); } handleUrlChange(event) { this.setState({ url: event.target.value }) } render() { return this.getContent(); } }