Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import {
RadioControl,
ToggleControl,
getRedirectUrl,
Container,
Col,
Chip,
Button as JetpackButton,
} from '@automattic/jetpack-components';
import { ExternalLink } from '@wordpress/components';
import { ExternalLink, ToggleControl } from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import { useCallback, useState } from 'react';
Expand Down Expand Up @@ -211,11 +210,11 @@ const EmailSettings = props => {
} }
>
<ToggleControl
__nextHasNoMarginBottom
disabled={ featuredImageInputDisabled }
checked={
isFeaturedImageInEmailEnabled && isSubscriptionsActive && ! featuredImageInputDisabled
}
toogling={ isSavingAnyOption( [ FEATURED_IMAGE_IN_EMAIL_OPTION ] ) }
label={ <span className="jp-form-toggle-explanation">{ featuredImageInfo }</span> }
onChange={ handleEnableFeaturedImageInEmailToggleChange }
className="email-settings__featured-image-toggle"
Expand Down Expand Up @@ -286,9 +285,9 @@ const EmailSettings = props => {
/>
<div className="email-settings__gravatar">
<ToggleControl
__nextHasNoMarginBottom
disabled={ gravatarInputDisabled }
checked={ isGravatarEnabled && isSubscriptionsActive }
toogling={ isSavingAnyOption( [ GRAVATER_OPTION ] ) }
label={
<span className="jp-form-toggle-explanation">
{ __( 'Show author avatar on your emails', 'jetpack' ) }
Expand Down Expand Up @@ -332,9 +331,9 @@ const EmailSettings = props => {
/>
</div>
<ToggleControl
__nextHasNoMarginBottom
disabled={ authorInputDisabled }
checked={ isAuthorEnabled && isSubscriptionsActive }
toogling={ isSavingAnyOption( [ AUTHOR_OPTION ] ) }
label={
<span className="jp-form-toggle-explanation">
{ __( 'Show author display name', 'jetpack' ) }
Expand All @@ -344,9 +343,9 @@ const EmailSettings = props => {
/>

<ToggleControl
__nextHasNoMarginBottom
disabled={ postDateInputDisabled }
checked={ isPostDateEnabled && isSubscriptionsActive }
toogling={ isSavingAnyOption( [ POST_DATE_OPTION ] ) }
label={
<span className="jp-form-toggle-explanation">
{ __( 'Add the post date', 'jetpack' ) }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ToggleControl, getRedirectUrl } from '@automattic/jetpack-components';
import { ExternalLink } from '@wordpress/components';
import { getRedirectUrl } from '@automattic/jetpack-components';
import { ExternalLink, ToggleControl } from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import clsx from 'clsx';
Expand Down Expand Up @@ -157,6 +157,7 @@ function NewsletterCategories( props ) {
</p>
<div className="newsletter-categories-toggle-wrapper">
<ToggleControl
__nextHasNoMarginBottom
disabled={ disabled }
checked={ isNewsletterCategoriesEnabled && isSubscriptionsActive }
onChange={ handleEnableNewsletterCategoriesToggleChange }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getRedirectUrl, ToggleControl } from '@automattic/jetpack-components';
import { getRedirectUrl } from '@automattic/jetpack-components';
import { ToggleControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { useCallback } from 'react';
import { connect } from 'react-redux';
Expand Down Expand Up @@ -157,14 +158,14 @@ function Newsletter( props ) {
} }
>
<ToggleControl
__nextHasNoMarginBottom
checked={ isSubscriptionsActive && !! newsletterSendDefault }
disabled={
! isSubscriptionsActive ||
! siteHasConnectedUser ||
unavailableInOfflineMode ||
isSavingAnyOption( [ SUBSCRIPTIONS_MODULE_NAME, NEWSLETTER_SEND_DEFAULT_OPTION ] )
}
toggling={ isSavingAnyOption( [ NEWSLETTER_SEND_DEFAULT_OPTION ] ) }
onChange={ handleEmailPostToSubsDefaultToggle }
label={
<span className="jp-form-toggle-explanation">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ToggleControl } from '@automattic/jetpack-components';
import { ExternalLink } from '@wordpress/components';
import { ExternalLink, ToggleControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { addQueryArgs } from '@wordpress/url';
import { useCallback } from 'react';
Expand Down Expand Up @@ -33,7 +32,6 @@ import { SUBSCRIPTIONS_MODULE_NAME } from './constants';
function SubscriptionsSettings( props ) {
const {
unavailableInOfflineMode,
isSavingAnyOption,
isStbEnabled,
isStcEnabled,
isSmEnabled,
Expand Down Expand Up @@ -164,9 +162,9 @@ function SubscriptionsSettings( props ) {
<FormFieldset>
<FormLegend>{ __( 'Homepage and posts', 'jetpack' ) }</FormLegend>
<ToggleControl
__nextHasNoMarginBottom
checked={ isSubscriptionsActive && isSubscribePostEndEnabled }
disabled={ isDisabled }
toggling={ isSavingAnyOption( [ 'jetpack_subscriptions_subscribe_post_end_enabled' ] ) }
onChange={ handleSubscribePostEndToggleChange }
label={
<span className="jp-form-toggle-explanation">
Expand All @@ -184,9 +182,9 @@ function SubscriptionsSettings( props ) {
}
/>
<ToggleControl
__nextHasNoMarginBottom
checked={ isSubscriptionsActive && isSmEnabled }
disabled={ isDisabled }
toggling={ isSavingAnyOption( [ 'sm_enabled' ] ) }
onChange={ handleSubscribeModalToggleChange }
label={
<span className="jp-form-toggle-explanation">
Expand All @@ -203,9 +201,9 @@ function SubscriptionsSettings( props ) {
}
/>
<ToggleControl
__nextHasNoMarginBottom
checked={ isSubscriptionsActive && isSubscribeOverlayEnabled }
disabled={ isDisabled }
toggling={ isSavingAnyOption( [ 'jetpack_subscribe_overlay_enabled' ] ) }
onChange={ handleSubscribeOverlayToggleChange }
label={
<span className="jp-form-toggle-explanation">
Expand All @@ -222,9 +220,9 @@ function SubscriptionsSettings( props ) {
}
/>
<ToggleControl
__nextHasNoMarginBottom
checked={ isSubscriptionsActive && isSubscribeFloatingEnabled }
disabled={ isDisabled }
toggling={ isSavingAnyOption( [ 'jetpack_subscribe_floating_button_enabled' ] ) }
onChange={ handleSubscribeFloatingToggleChange }
label={
<span className="jp-form-toggle-explanation">
Expand All @@ -245,11 +243,9 @@ function SubscriptionsSettings( props ) {
<FormFieldset>
<FormLegend>{ __( 'Navigation', 'jetpack' ) }</FormLegend>
<ToggleControl
__nextHasNoMarginBottom
checked={ isSubscriptionsActive && isSubscribeNavigationEnabled }
disabled={ isDisabled }
toggling={ isSavingAnyOption( [
'jetpack_subscriptions_subscribe_navigation_enabled',
] ) }
onChange={ handleSubscribeNavigationToggleChange }
label={
<span className="jp-form-toggle-explanation">
Expand All @@ -266,9 +262,9 @@ function SubscriptionsSettings( props ) {
}
/>
<ToggleControl
__nextHasNoMarginBottom
checked={ isSubscriptionsActive && isLoginNavigationEnabled }
disabled={ isDisabled }
toggling={ isSavingAnyOption( [ 'jetpack_subscriptions_login_navigation_enabled' ] ) }
onChange={ handleLoginNavigationToggleChange }
label={
<span className="jp-form-toggle-explanation">
Expand All @@ -289,9 +285,9 @@ function SubscriptionsSettings( props ) {
<FormFieldset>
<FormLegend>{ __( 'Comments', 'jetpack' ) }</FormLegend>
<ToggleControl
__nextHasNoMarginBottom
checked={ isSubscriptionsActive && isStbEnabled }
disabled={ isDisabled }
toggling={ isSavingAnyOption( [ 'stb_enabled' ] ) }
onChange={ handleSubscribeToBlogToggleChange }
label={
<span className="jp-form-toggle-explanation">
Expand All @@ -300,9 +296,9 @@ function SubscriptionsSettings( props ) {
}
/>
<ToggleControl
__nextHasNoMarginBottom
checked={ isSubscriptionsActive && isStcEnabled }
disabled={ isDisabled }
toggling={ isSavingAnyOption( [ 'stc_enabled' ] ) }
onChange={ handleSubscribeToCommentToggleChange }
label={
<span className="jp-form-toggle-explanation">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Newsletter: Migrate ToggleControl off @automattic/jetpack-components to @wordpress/components.
Loading