Refactor components
This commit is contained in:
committed by
M. Shull
parent
ebe22aa98e
commit
7ddffb4dd5
@@ -7,7 +7,11 @@ import ReactStringReplace from 'react-string-replace';
|
|||||||
const userHostDomain = window.location.hostname.replace('www.', '');
|
const userHostDomain = window.location.hostname.replace('www.', '');
|
||||||
const suggestedEmailAddress = `contact@${userHostDomain}`;
|
const suggestedEmailAddress = `contact@${userHostDomain}`;
|
||||||
|
|
||||||
const OldInstallationWarning = ({ emailAddress }) => (
|
const SenderEmailAddressWarning = ({ emailAddress, mssActive }) => {
|
||||||
|
if (mssActive) return null
|
||||||
|
const emailAddressDomain = emailAddress.split('@').pop().toLowerCase();
|
||||||
|
if (window.mailpoet_free_domains.indexOf(emailAddressDomain) > -1) {
|
||||||
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<p
|
<p
|
||||||
className="sender_email_address_warning"
|
className="sender_email_address_warning"
|
||||||
@@ -37,16 +41,6 @@ const OldInstallationWarning = ({ emailAddress }) => (
|
|||||||
</p>
|
</p>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
|
|
||||||
OldInstallationWarning.propTypes = {
|
|
||||||
emailAddress: PropTypes.string.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
const SenderEmailAddressWarning = ({ emailAddress, mssActive }) => {
|
|
||||||
if (mssActive) return null
|
|
||||||
const emailAddressDomain = emailAddress.split('@').pop().toLowerCase();
|
|
||||||
if (window.mailpoet_free_domains.indexOf(emailAddressDomain) > -1) {
|
|
||||||
return <OldInstallationWarning emailAddress={emailAddress} />;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user