Fix new code

This commit is contained in:
Pavel Dohnal
2019-01-29 12:35:41 +01:00
parent 3128da45b3
commit 6ffac49364
11 changed files with 1748 additions and 1741 deletions

View File

@@ -45,29 +45,29 @@ class ConfirmAlert extends React.Component {
return (this.state.show
&& (
<div className="mailpoet_modal_overlay">
<div className="mailpoet_popup" tabIndex="-1">
<div className="mailpoet_popup_wrapper">
<button className="mailpoet_modal_close" onClick={this.onClose} type="button" />
{title
<div className="mailpoet_modal_overlay">
<div className="mailpoet_popup" tabIndex="-1">
<div className="mailpoet_popup_wrapper">
<button className="mailpoet_modal_close" onClick={this.onClose} type="button" />
{title
&& (
<div className="mailpoet_popup_title">
<h2>{title}</h2>
</div>
<div className="mailpoet_popup_title">
<h2>{title}</h2>
</div>
)
}
<div className="mailpoet_popup_body clearfix">
<p className="mailpoet_hp_email_label">{message}</p>
<button className="button button-secondary" onClick={this.onClose} type="button">
{cancelLabel}
</button>
<button className="button button-primary" onClick={this.onConfirm} type="submit">
{confirmLabel}
</button>
}
<div className="mailpoet_popup_body clearfix">
<p className="mailpoet_hp_email_label">{message}</p>
<button className="button button-secondary" onClick={this.onClose} type="button">
{cancelLabel}
</button>
<button className="button button-primary" onClick={this.onConfirm} type="submit">
{confirmLabel}
</button>
</div>
</div>
</div>
</div>
</div>
)
);
}

View File

@@ -56,29 +56,31 @@ const SenderEmailAddressWarning = ({ emailAddress }) => {
const emailAddressDomain = emailAddress.split('@').pop().toLowerCase();
if (badDomains.indexOf(emailAddressDomain) > -1) {
const userHostDomain = window.location.hostname.replace('www.', '');
return (<React.Fragment>
<p className="sender_email_address_warning">{MailPoet.I18n.t('senderEmailAddressWarning1')}</p>
<p className="sender_email_address_warning">
{ReactStringReplace(
MailPoet.I18n.t('senderEmailAddressWarning2'),
/(%suggested|%originalSender|<em>.*<\/em>)/,
(match) => {
if (match === '%suggested') return `info@${userHostDomain}`;
if (match === '%originalSender') return <em key="sender-email">{ emailAddress }</em>;
return <em key="reply-to">{match.replace(/<\/?em>/g, '')}</em>;
}
)}
</p>
<p className="sender_email_address_warning">
<a
href="https://kb.mailpoet.com/article/259-your-from-address-cannot-be-yahoo-com-gmail-com-outlook-com"
target="_blank"
rel="noopener noreferrer"
>
{MailPoet.I18n.t('senderEmailAddressWarning3')}
</a>
</p>
</React.Fragment>);
return (
<React.Fragment>
<p className="sender_email_address_warning">{MailPoet.I18n.t('senderEmailAddressWarning1')}</p>
<p className="sender_email_address_warning">
{ReactStringReplace(
MailPoet.I18n.t('senderEmailAddressWarning2'),
/(%suggested|%originalSender|<em>.*<\/em>)/,
(match) => {
if (match === '%suggested') return `info@${userHostDomain}`;
if (match === '%originalSender') return <em key="sender-email">{ emailAddress }</em>;
return <em key="reply-to">{match.replace(/<\/?em>/g, '')}</em>;
}
)}
</p>
<p className="sender_email_address_warning">
<a
href="https://kb.mailpoet.com/article/259-your-from-address-cannot-be-yahoo-com-gmail-com-outlook-com"
target="_blank"
rel="noopener noreferrer"
>
{MailPoet.I18n.t('senderEmailAddressWarning3')}
</a>
</p>
</React.Fragment>
);
}
return null;
};