diff --git a/assets/js/src/newsletters/types/automatic_emails/event.jsx b/assets/js/src/newsletters/types/automatic_emails/event.jsx
new file mode 100644
index 0000000000..752390f7e9
--- /dev/null
+++ b/assets/js/src/newsletters/types/automatic_emails/event.jsx
@@ -0,0 +1,78 @@
+import React from 'react';
+import MailPoet from 'mailpoet';
+import _ from 'underscore';
+import PropTypes from 'prop-types';
+
+class AutomaticEmailEvent extends React.PureComponent {
+ render() {
+ const event = this.props.event;
+ let action;
+
+ if (this.props.premium) {
+ action = (
+
+ {MailPoet.I18n.t('premiumFeatureLink')}
+
+ );
+ } else {
+ const disabled = event.soon;
+
+ action = (
+
+ {event.actionButtonTitle || MailPoet.I18n.t('setUp')}
+
+ );
+ }
+
+ return (
+
+
+
+ {event.thumbnailImage ?

: null}
+
+
+
+
{event.title} {event.soon ? `(${MailPoet.I18n.t('soon').toLowerCase()})` : ''}
+ {event.badge ? (
+
+ {event.badge.text}
+
+ ) : ''
+ }
+
+
{event.description}
+
+
+ {action}
+
+
+
+ );
+ }
+}
+
+AutomaticEmailEvent.propTypes = {
+ premium: PropTypes.bool.isRequired,
+ eventsConfigurator: PropTypes.func.isRequired,
+ event: PropTypes.shape({
+ slug: PropTypes.string.isRequired,
+ thumbnailImage: PropTypes.string,
+ title: PropTypes.string.isRequired,
+ soon: PropTypes.bool,
+ badge: PropTypes.shape({
+ style: PropTypes.string,
+ text: PropTypes.string,
+ }),
+ description: PropTypes.string.isRequired,
+ actionButtonTitle: PropTypes.string,
+ }).isRequired,
+};
+
+module.exports = AutomaticEmailEvent;
diff --git a/assets/js/src/newsletters/types/automatic_emails/events_list.jsx b/assets/js/src/newsletters/types/automatic_emails/events_list.jsx
index 7883897abf..6093359875 100644
--- a/assets/js/src/newsletters/types/automatic_emails/events_list.jsx
+++ b/assets/js/src/newsletters/types/automatic_emails/events_list.jsx
@@ -1,5 +1,6 @@
import React from 'react';
import AutomaticEmailsBreadcrumb from 'newsletters/types/automatic_emails/breadcrumb.jsx';
+import AutomaticEmailEvent from 'newsletters/types/automatic_emails/event.jsx';
import MailPoet from 'mailpoet';
import _ from 'underscore';
import PropTypes from 'prop-types';
@@ -17,57 +18,15 @@ class AutomaticEmailEventsList extends React.Component {
}
displayEvents() {
- const events = _.map(this.emailEvents, (event, index) => {
- let action;
-
- if (this.email.premium) {
- action = (
-
- {MailPoet.I18n.t('premiumFeatureLink')}
-
- );
- } else {
- const disabled = event.soon;
-
- action = (
-
- {event.actionButtonTitle || MailPoet.I18n.t('setUp')}
-
- );
- }
-
- return (
-
-
-
- {event.thumbnailImage ?

: null}
-
-
-
-
{event.title} {event.soon ? `(${MailPoet.I18n.t('soon').toLowerCase()})` : ''}
- {event.badge ? (
-
- {event.badge.text}
-
- ) : ''
- }
-
-
{event.description}
-
-
- {action}
-
-
-
- );
- });
+ const events = _.map(this.emailEvents, (event, index) => (
+
+ )
+ );
return (