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

Remove copy for managing a block's style variations #48367

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
Expand Up @@ -44,7 +44,7 @@ const {
overrideSettingsWithSupports,
} = unlock( blockEditorPrivateApis );

function ContextMenu( { name, parentMenu = '' } ) {
function ContextMenu( { blockName, name, parentMenu = '' } ) {
const [ rawSettings ] = useGlobalSetting( '', name );
const supports = useSupportedStyles( name );
const settings = useMemo(
Expand Down Expand Up @@ -127,7 +127,11 @@ function ContextMenu( { name, parentMenu = '' } ) {
</NavigationButtonAsItem>
) }
{ hasVariationsPanel && (
<ScreenVariations name={ name } path={ parentMenu } />
<ScreenVariations
blockName={ blockName }
name={ name }
path={ parentMenu }
/>
) }
{ isBlocksPanel && canEditCSS && (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function ScreenBlock( { name } ) {
<ContextMenu
parentMenu={ '/blocks/' + encodeURIComponent( name ) }
name={ name }
blockName={ blockType.title }
/>
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, sprintf } from '@wordpress/i18n';
import { __experimentalVStack as VStack } from '@wordpress/components';
/**
* Internal dependencies
Expand All @@ -15,7 +15,8 @@ import ScreenHeader from './header';
import BlockPreviewPanel from './block-preview-panel';
import Subtitle from './subtitle';

export function ScreenVariations( { name, path = '' } ) {
export function ScreenVariations( props ) {
const { blockName, name, path } = props;
tomdevisser marked this conversation as resolved.
Show resolved Hide resolved
const hasVariationsPanel = useHasVariationsPanel( name, path );

if ( ! hasVariationsPanel ) {
Expand All @@ -24,7 +25,13 @@ export function ScreenVariations( { name, path = '' } ) {
return (
<div className="edit-site-global-styles-screen-variations">
<VStack spacing={ 3 }>
<p>Manage style variations, saved block appearence presets.</p>
<p>
{ sprintf(
// Translators: Name of the block.
__( 'Customize variations of the block: %s' ),
blockName
) }
</p>
<Subtitle>{ __( 'Style Variations' ) }</Subtitle>
<VariationsPanel name={ name } />
</VStack>
Expand Down