2016-09-08 23:38:29 +02:00
|
|
|
/**
|
2016-10-04 17:49:40 +02:00
|
|
|
*
|
|
|
|
* PluginHeaderActions
|
|
|
|
*
|
|
|
|
*/
|
2016-09-08 23:38:29 +02:00
|
|
|
|
|
|
|
import React from 'react';
|
2016-10-12 18:42:42 +02:00
|
|
|
|
|
|
|
import messages from './messages.json';
|
|
|
|
import { define } from '../../i18n';
|
|
|
|
define(messages);
|
2016-10-12 12:07:26 +02:00
|
|
|
import { FormattedMessage } from 'react-intl';
|
2016-09-08 23:38:29 +02:00
|
|
|
|
2016-10-05 18:13:02 +02:00
|
|
|
import styles from './styles.scss';
|
2016-09-08 23:38:29 +02:00
|
|
|
|
|
|
|
class PluginHeaderActions extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className={`${styles.pluginHeaderActions} pull-lg-right`}>
|
2016-10-04 17:49:40 +02:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
className={`${styles.pluginHeaderActionsButton} btn btn-secondary`}
|
|
|
|
onClick={this.props.onCancel}
|
2016-10-04 17:09:03 +02:00
|
|
|
>
|
2016-10-12 12:07:26 +02:00
|
|
|
<FormattedMessage {...messages.cancelLabel} />
|
2016-09-27 18:06:35 +02:00
|
|
|
</button>
|
2016-10-04 17:49:40 +02:00
|
|
|
<button
|
|
|
|
type="submit"
|
|
|
|
className={`${styles.pluginHeaderActionsButton} btn btn-primary`}
|
|
|
|
disabled={this.props.loading}
|
|
|
|
onClick={this.props.onFormSubmit}
|
2016-09-27 18:06:35 +02:00
|
|
|
>
|
2016-10-12 12:07:26 +02:00
|
|
|
<FormattedMessage {...messages.saveLabel} />
|
2016-09-27 18:06:35 +02:00
|
|
|
</button>
|
2016-09-08 23:38:29 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-27 18:06:35 +02:00
|
|
|
PluginHeaderActions.propTypes = {
|
|
|
|
loading: React.PropTypes.bool,
|
2016-10-04 17:09:03 +02:00
|
|
|
onCancel: React.PropTypes.func,
|
2016-09-27 18:06:35 +02:00
|
|
|
onFormSubmit: React.PropTypes.func,
|
|
|
|
};
|
|
|
|
|
2016-09-08 23:38:29 +02:00
|
|
|
export default PluginHeaderActions;
|