Hide tab behind the feature flag

[MAILPOET-3763]
This commit is contained in:
Pavel Dohnal
2021-09-14 09:28:57 +02:00
committed by Veljko V
parent ac3625e434
commit 377910a2c2

View File

@@ -45,6 +45,7 @@ const trackTabSwitch = (tabKey) => MailPoet.trackEvent(
const Tabs = withNpsPoll(() => {
const { parentId } = useParams();
const { features } = React.useContext(GlobalContext);
return (
<>
<ListingHeadingDisplay>
@@ -85,14 +86,16 @@ const Tabs = withNpsPoll(() => {
: <NewsletterListNotification />
}
</Tab>
<Tab
key="re_engagement"
route="re_engagement/(.*)?"
title={MailPoet.I18n.t('tabReEngagementTitle')}
automationId={`tab-${MailPoet.I18n.t('tabReEngagementTitle')}`}
>
<NewsletterListReEngagement />
</Tab>
{(features.isSupported('re-engagement-email')) && (
<Tab
key="re_engagement"
route="re_engagement/(.*)?"
title={MailPoet.I18n.t('tabReEngagementTitle')}
automationId={`tab-${MailPoet.I18n.t('tabReEngagementTitle')}`}
>
<NewsletterListReEngagement />
</Tab>
)}
{window.mailpoet_woocommerce_active && _.map(automaticEmails, (email) => (
<Tab
key={email.slug}