Skip to content

Commit

Permalink
Don't show "Include social followers in count" when showSubscribersTo…
Browse files Browse the repository at this point in the history
…tal is not toggled or isPublicizeEnabled is false
  • Loading branch information
TimBroddin committed Feb 14, 2023
1 parent 48b1358 commit e2b3533
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { numberFormat } from '@automattic/jetpack-components';
import { usePublicizeConfig } from '@automattic/jetpack-publicize-components';
import { isSimpleSite } from '@automattic/jetpack-shared-extension-utils';
import {
ContrastChecker,
Expand Down Expand Up @@ -54,6 +55,8 @@ export default function SubscriptionControls( {
buttonWidth,
successMessage,
} ) {
const { isPublicizeEnabled } = usePublicizeConfig();

return (
<>
{ isNewsletterFeatureEnabled() && <PaidPlanPanel /> }
Expand Down Expand Up @@ -240,14 +243,17 @@ export default function SubscriptionControls( {
}
} }
/>
<ToggleControl
disabled={ ! showSubscribersTotal }
label={ __( 'Include social followers in count', 'jetpack' ) }
checked={ includeSocialFollowers }
onChange={ () => {
setAttributes( { includeSocialFollowers: ! includeSocialFollowers } );
} }
/>
{ showSubscribersTotal && isPublicizeEnabled ? (
<ToggleControl
disabled={ ! showSubscribersTotal }
label={ __( 'Include social followers in count', 'jetpack' ) }
checked={ includeSocialFollowers }
onChange={ () => {
setAttributes( { includeSocialFollowers: ! includeSocialFollowers } );
} }
/>
) : null }

<ToggleControl
label={ __( 'Place button on new line', 'jetpack' ) }
checked={ buttonOnNewLine }
Expand Down

0 comments on commit e2b3533

Please sign in to comment.