Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Premium content: Improve editing consistency #22626

Merged
merged 5 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
@@ -0,0 +1,4 @@
Significance: minor
Type: enhancement

Make premium content block be more consistent: Use 'Guest' rather than visitor/Logged-out
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export default function Blocks() {
allowedBlocks={ [ 'premium-content/subscriber-view', 'premium-content/logged-out-view' ] }
templateLock={ 'all' }
template={ [
[ 'premium-content/subscriber-view' ],
[ 'premium-content/logged-out-view' ],
[ 'premium-content/subscriber-view' ],
] }
__experimentalCaptureToolbars={ true }
templateInsertUpdatesSelection={ false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ function Edit( props ) {
className="components-tab-button"
isPressed={ selectedTab.className === 'wp-premium-content-logged-out-view' }
>
<span>{ __( 'Visitor View', 'jetpack' ) }</span>
<span>{ __( 'Guest View', 'jetpack' ) }</span>
</ToolbarButton>
<ToolbarButton
onClick={ () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ import { registerFormatType, unregisterFormatType } from '@wordpress/rich-text';

const name = 'premium-content/logged-out-view';
const settings = {
title: __( 'Logged Out View', 'jetpack' ),
description: __( 'The container for all content shown to site visitors who are not subscribers.', 'jetpack' ),
title: __( 'Guest View', 'jetpack' ),
description: __(
'The container for all content shown to site visitors who are not subscribers.',
'jetpack'
),
icon,
category: 'grow',
parent: [ 'premium-content/container' ],
Expand Down Expand Up @@ -52,13 +55,13 @@ const unsubscribe = subscribe( () => {

// Use the existing link button functionality but limit it so that it doesn't run inside this view.
const newLinkButton = compose(
withSelect( ( composeSelect ) => {
withSelect( composeSelect => {
return {
selectedBlock: composeSelect( 'core/block-editor' ).getSelectedBlock(),
};
} ),
// @ts-ignore
ifCondition( ( props ) => {
ifCondition( props => {
// @ts-ignore
return props.selectedBlock && props.selectedBlock.name !== name;
} )
Expand Down