mirror of
https://github.com/zoriya/flood.git
synced 2025-12-20 06:05:15 +00:00
Add option to add torrent without starting
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import classnames from 'classnames';
|
||||
import React from 'react';
|
||||
|
||||
import Checkbox from '../forms/Checkbox';
|
||||
import UIActions from '../../actions/UIActions';
|
||||
|
||||
export default class ModalActions extends React.Component {
|
||||
@@ -12,6 +13,15 @@ export default class ModalActions extends React.Component {
|
||||
'button--primary': action.type === 'primary'
|
||||
});
|
||||
|
||||
if (action.type === 'checkbox') {
|
||||
return (
|
||||
<Checkbox checked={action.checked} key={index}
|
||||
onChange={this.getClickHandler(action)}>
|
||||
{action.content}
|
||||
</Checkbox>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<button className={classes} onClick={this.getClickHandler(action)} key={index}>
|
||||
{action.content}
|
||||
@@ -27,15 +37,15 @@ export default class ModalActions extends React.Component {
|
||||
}
|
||||
|
||||
getClickHandler(action) {
|
||||
return () => {
|
||||
return (data) => {
|
||||
if (action.clickHandler) {
|
||||
action.clickHandler();
|
||||
action.clickHandler(data);
|
||||
}
|
||||
|
||||
if (action.triggerDismiss) {
|
||||
UIActions.dismissModal();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user