Use total count of subscribers
[MAILPOET-2832]
This commit is contained in:
@@ -3,17 +3,17 @@ import MailPoet from 'mailpoet';
|
|||||||
import HelpTooltip from 'help-tooltip.jsx';
|
import HelpTooltip from 'help-tooltip.jsx';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
subscribersLimit: number | false,
|
subscribersInPlan: number | false,
|
||||||
hasValidApiKey: boolean,
|
hasValidApiKey: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
const SubscribersLimit = ({ subscribersLimit, hasValidApiKey }: Props) => {
|
const SubscribersLimit = ({ subscribersInPlan, hasValidApiKey }: Props) => {
|
||||||
if (!subscribersLimit) return null;
|
if (!subscribersInPlan) return null;
|
||||||
if (!hasValidApiKey) return null;
|
if (!hasValidApiKey) return null;
|
||||||
return (
|
return (
|
||||||
<h3>
|
<h3>
|
||||||
{MailPoet.I18n.t('subscribersInPlan')
|
{MailPoet.I18n.t('subscribersInPlan')
|
||||||
.replace('%$1d', subscribersLimit.toLocaleString())}
|
.replace('%$1d', subscribersInPlan.toLocaleString())}
|
||||||
{' '}
|
{' '}
|
||||||
<HelpTooltip
|
<HelpTooltip
|
||||||
tooltip={MailPoet.I18n.t('subscribersInPlanTooltip')}
|
tooltip={MailPoet.I18n.t('subscribersInPlanTooltip')}
|
||||||
|
@@ -127,7 +127,7 @@ function DynamicSegmentList(props) {
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<SubscribersLimit
|
<SubscribersLimit
|
||||||
subscribersLimit={window.mailpoet_subscribers_limit}
|
subscribersInPlan={window.mailpoet_subscribers_in_plan_count}
|
||||||
hasValidApiKey={window.mailpoet_has_valid_api_key}
|
hasValidApiKey={window.mailpoet_has_valid_api_key}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@@ -304,7 +304,7 @@ class SegmentList extends React.Component {
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<SubscribersLimit
|
<SubscribersLimit
|
||||||
subscribersLimit={window.mailpoet_subscribers_limit}
|
subscribersInPlan={window.mailpoet_subscribers_in_plan_count}
|
||||||
hasValidApiKey={window.mailpoet_has_valid_api_key}
|
hasValidApiKey={window.mailpoet_has_valid_api_key}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@@ -378,7 +378,7 @@ class SubscriberList extends React.Component {
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<SubscribersLimit
|
<SubscribersLimit
|
||||||
subscribersLimit={window.mailpoet_subscribers_limit}
|
subscribersInPlan={window.mailpoet_subscribers_in_plan_count}
|
||||||
hasValidApiKey={window.mailpoet_has_valid_api_key}
|
hasValidApiKey={window.mailpoet_has_valid_api_key}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
return product;
|
return product;
|
||||||
});
|
});
|
||||||
var is_woocommerce_active = <%= json_encode(is_woocommerce_active) %>;
|
var is_woocommerce_active = <%= json_encode(is_woocommerce_active) %>;
|
||||||
|
var mailpoet_subscribers_in_plan_count = <%= subscriber_count %>;
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<% endblock %>
|
<% endblock %>
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
var mailpoet_has_valid_api_key = <%= has_valid_api_key ? 'true' : 'false' %>;
|
var mailpoet_has_valid_api_key = <%= has_valid_api_key ? 'true' : 'false' %>;
|
||||||
var mailpoet_mss_key_invalid = <%= mss_key_invalid ? 'true' : 'false' %>;
|
var mailpoet_mss_key_invalid = <%= mss_key_invalid ? 'true' : 'false' %>;
|
||||||
var mailpoet_subscribers_count = <%= subscriber_count %>;
|
var mailpoet_subscribers_count = <%= subscriber_count %>;
|
||||||
|
var mailpoet_subscribers_in_plan_count = <%= subscriber_count %>;
|
||||||
</script>
|
</script>
|
||||||
<% endblock %>
|
<% endblock %>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user