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
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, sprintf } from '@wordpress/i18n';
import { __experimentalVStack as VStack } from '@wordpress/components';
import { useSelect } from '@wordpress/data';
import { store as blocksStore } from '@wordpress/blocks';
/**
* Internal dependencies
*/
Expand All @@ -17,14 +19,24 @@ import Subtitle from './subtitle';

export function ScreenVariations( { name, path = '' } ) {
const hasVariationsPanel = useHasVariationsPanel( name, path );
const blockTitle = useSelect(
( select ) => select( blocksStore ).getBlockType( name ).title,
[ name ]
);

if ( ! hasVariationsPanel ) {
return null;
}
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' ),
blockTitle
) }
</p>
<Subtitle>{ __( 'Style Variations' ) }</Subtitle>
<VariationsPanel name={ name } />
</VStack>
Expand Down