ESLint rules
This commit is contained in:
@@ -28,7 +28,7 @@ const ListingTabs = React.createClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
const tabs = this.state.tabs.map(tab => {
|
const tabs = this.state.tabs.map((tab) => {
|
||||||
const tabClasses = classNames(
|
const tabClasses = classNames(
|
||||||
'nav-tab',
|
'nav-tab',
|
||||||
{ 'nav-tab-active': (this.props.tab === tab.name) }
|
{ 'nav-tab-active': (this.props.tab === tab.name) }
|
||||||
|
@@ -1,64 +1,50 @@
|
|||||||
define(
|
import React from 'react';
|
||||||
[
|
import Router from 'react-router';
|
||||||
'react',
|
import MailPoet from 'mailpoet';
|
||||||
'react-router',
|
import Form from 'form/form.jsx';
|
||||||
'mailpoet',
|
|
||||||
'form/form.jsx',
|
|
||||||
],
|
|
||||||
(
|
|
||||||
React,
|
|
||||||
Router,
|
|
||||||
MailPoet,
|
|
||||||
Form
|
|
||||||
) => {
|
|
||||||
const fields = [
|
|
||||||
{
|
|
||||||
name: 'name',
|
|
||||||
label: MailPoet.I18n.t('name'),
|
|
||||||
type: 'text',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'description',
|
|
||||||
label: MailPoet.I18n.t('description'),
|
|
||||||
type: 'textarea',
|
|
||||||
tip: MailPoet.I18n.t('segmentDescriptionTip'),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const messages = {
|
const fields = [
|
||||||
onUpdate: function onUpdate() {
|
{
|
||||||
MailPoet.Notice.success(MailPoet.I18n.t('segmentUpdated'));
|
name: 'name',
|
||||||
},
|
label: MailPoet.I18n.t('name'),
|
||||||
onCreate: function onCreate() {
|
type: 'text',
|
||||||
MailPoet.Notice.success(MailPoet.I18n.t('segmentAdded'));
|
},
|
||||||
MailPoet.trackEvent('Lists > Add new', {
|
{
|
||||||
'MailPoet Free version': window.mailpoet_version,
|
name: 'description',
|
||||||
});
|
label: MailPoet.I18n.t('description'),
|
||||||
},
|
type: 'textarea',
|
||||||
};
|
tip: MailPoet.I18n.t('segmentDescriptionTip'),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const Link = Router.Link;
|
const messages = {
|
||||||
|
onUpdate: function onUpdate() {
|
||||||
const SegmentForm = React.createClass({
|
MailPoet.Notice.success(MailPoet.I18n.t('segmentUpdated'));
|
||||||
render: function render() {
|
},
|
||||||
return (
|
onCreate: function onCreate() {
|
||||||
<div>
|
MailPoet.Notice.success(MailPoet.I18n.t('segmentAdded'));
|
||||||
<h1 className="title">
|
MailPoet.trackEvent('Lists > Add new', {
|
||||||
{MailPoet.I18n.t('segment')}
|
'MailPoet Free version': window.mailpoet_version,
|
||||||
<Link className="page-title-action" to="/">{MailPoet.I18n.t('backToList')}</Link>
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<Form
|
|
||||||
endpoint="segments"
|
|
||||||
fields={fields}
|
|
||||||
params={this.props.params}
|
|
||||||
messages={messages}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
return SegmentForm;
|
const Link = Router.Link;
|
||||||
}
|
|
||||||
|
const SegmentForm = params => (
|
||||||
|
<div>
|
||||||
|
<h1 className="title">
|
||||||
|
{MailPoet.I18n.t('segment')}
|
||||||
|
<Link className="page-title-action" to="/">{MailPoet.I18n.t('backToList')}</Link>
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<Form
|
||||||
|
endpoint="segments"
|
||||||
|
fields={fields}
|
||||||
|
params={params}
|
||||||
|
messages={messages}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export default SegmentForm;
|
||||||
|
Reference in New Issue
Block a user