Add option to add torrent without starting

This commit is contained in:
John Furrow
2016-04-23 14:33:40 -07:00
parent fc01d93431
commit dda0ce0e88
25 changed files with 155 additions and 182 deletions

View File

@@ -0,0 +1,50 @@
import React from 'react';
import LoadingIndicatorDots from '../icons/LoadingIndicatorDots';
import ModalActions from './ModalActions';
export default class AddTorrents extends React.Component {
getActions() {
let icon = null;
let primaryButtonText = 'Add Torrent';
if (this.props.isAddingTorrents) {
icon = <LoadingIndicatorDots viewBox="0 0 32 32" />;
primaryButtonText = 'Adding...';
}
return [
{
checked: true,
clickHandler: this.props.onStartTorrentsToggle,
content: 'Start Torrent',
triggerDismiss: false,
type: 'checkbox'
},
{
clickHandler: null,
content: 'Cancel',
triggerDismiss: true,
type: 'secondary'
},
{
clickHandler: this.props.onAddTorrentsClick,
content: (
<span>
{icon}
{primaryButtonText}
</span>
),
supplementalClassName: icon != null ? 'has-icon' : '',
triggerDismiss: false,
type: 'primary'
}
];
}
render() {
return (
<ModalActions actions={this.getActions()} dismiss={this.props.dismiss} />
);
}
}