Adjust the modal component

This commit is contained in:
John Furrow
2015-11-08 00:51:48 -08:00
parent 570c331f38
commit f4da39e6a3
+10 -3
View File
@@ -2,12 +2,12 @@ import React from 'react';
import Action from '../components/action-bar/Action'; import Action from '../components/action-bar/Action';
import { addTorrent, startTorrent, stopTorrent } from '../actions/ClientActions'; import { addTorrent, startTorrent, stopTorrent } from '../actions/ClientActions';
import AddTorrent from '../components/action-bar/AddTorrent'; import { displayModal } from '../actions/UIActions';
import { setTorrentsSort } from '../actions/UIActions'; import { setTorrentsSort } from '../actions/UIActions';
import SortDropdown from '../components/action-bar/SortDropdown'; import SortDropdown from '../components/action-bar/SortDropdown';
import UIActions from '../actions/UIActions';
const methodsToBind = [ const methodsToBind = [
'handleAddTorrents',
'handleSortChange', 'handleSortChange',
'handleStart', 'handleStart',
'handleStop' 'handleStop'
@@ -27,6 +27,12 @@ export default class FilterBar extends React.Component {
}); });
} }
handleAddTorrents() {
this.props.dispatch(displayModal({
modal: 'add-torrents'
}));
}
handleSortChange(sortBy) { handleSortChange(sortBy) {
this.props.dispatch(setTorrentsSort({ this.props.dispatch(setTorrentsSort({
sortBy sortBy
@@ -58,7 +64,8 @@ export default class FilterBar extends React.Component {
clickHandler={this.handlePause} /> clickHandler={this.handlePause} />
</div> </div>
<div className="action-bar__group action-bar__group--has-divider"> <div className="action-bar__group action-bar__group--has-divider">
<AddTorrent /> <Action label="Add Torrent" slug="add-torrent" icon="add"
clickHandler={this.handleAddTorrents} />
</div> </div>
</div> </div>
</nav> </nav>