Skip to content

Commit

Permalink
Newsletter prepublish panel: update toggle appearance (#34724)
Browse files Browse the repository at this point in the history
  • Loading branch information
lezama authored Dec 20, 2023
1 parent 75cda2f commit 2254c83
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/update-newsletter-prepanel
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

update feature not released yet
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function NewsletterPrePublishSettingsPanel( { accessLevel, isModuleActive, showP
{ showMisconfigurationWarning && <MisconfigurationWarning /> }

{ ! isSendEmailEnabled || showMisconfigurationWarning ? (
<p>{ __( 'Only publishing, not sending this post.', 'jetpack' ) }</p>
<p>{ __( 'Not sent via email.', 'jetpack' ) }</p>
) : (
<SubscribersAffirmation prePublish={ true } accessLevel={ accessLevel } />
) }
Expand Down
16 changes: 11 additions & 5 deletions projects/plugins/jetpack/extensions/shared/memberships/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import {
PanelRow,
RadioControl,
Spinner,
ToggleControl,
VisuallyHidden,
// eslint-disable-next-line wpcalypso/no-unsafe-wp-apis
__experimentalToggleGroupControl as ToggleGroupControl,
// eslint-disable-next-line wpcalypso/no-unsafe-wp-apis
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
} from '@wordpress/components';
import { useViewportMatch } from '@wordpress/compose';
import { useEntityProp } from '@wordpress/core-data';
Expand Down Expand Up @@ -312,12 +315,15 @@ export function NewsletterEmailDocumentSettings() {
<PostVisibilityCheck
render={ ( { canEdit } ) => {
return (
<ToggleControl
checked={ isSendEmailEnabled }
<ToggleGroupControl
value={ isSendEmailEnabled }
disabled={ isPostPublished || ! canEdit }
label={ __( 'Send an email', 'jetpack' ) }
onChange={ toggleSendEmail }
/>
isBlock
>
<ToggleGroupControlOption label={ __( 'Post & email', 'jetpack' ) } value={ true } />
<ToggleGroupControlOption label={ __( 'Post only', 'jetpack' ) } value={ false } />
</ToggleGroupControl>
);
} }
/>
Expand Down

0 comments on commit 2254c83

Please sign in to comment.