Allow hiding header in newsletter types component

[MAILPOET-2383]
This commit is contained in:
Ján Mikláš
2019-12-16 15:04:27 +01:00
committed by Jack Kitterhing
parent 2abfae5eab
commit 902192131c

View File

@@ -11,6 +11,11 @@ class NewsletterTypes extends React.Component {
history: PropTypes.shape({ history: PropTypes.shape({
push: PropTypes.func.isRequired, push: PropTypes.func.isRequired,
}).isRequired, }).isRequired,
showHeader: PropTypes.bool,
};
static defaultProps = {
showHeader: true,
}; };
constructor(props) { constructor(props) {
@@ -245,9 +250,11 @@ class NewsletterTypes extends React.Component {
return ( return (
<div> <div>
<link rel="prefetch" href={window.mailpoet_editor_javascript_url} as="script" /> <link rel="prefetch" href={window.mailpoet_editor_javascript_url} as="script" />
<h1>{MailPoet.I18n.t(window.mailpoet_newsletters_count === 0 ? 'createFirstEmailTitle' : 'pickCampaignType')}</h1>
<Breadcrumb step="type" /> {this.props.showHeader
&& <h1>{MailPoet.I18n.t(window.mailpoet_newsletters_count === 0 ? 'createFirstEmailTitle' : 'pickCampaignType')}</h1>
&& <Breadcrumb step="type" />
}
<ul className="mailpoet_boxes mailpoet_boxes_types"> <ul className="mailpoet_boxes mailpoet_boxes_types">
{types.map((type) => ( {types.map((type) => (