Skip to content

Commit

Permalink
Improve copy for managing a block's style variations
Browse files Browse the repository at this point in the history
The copy in question was: "Manage style variations, saved block appearence presets."

There's a typo (appearence should be appearance), and grammar — but I think we can do better all around. It's not clear where "block appearance presets" came from, but it seems like a fancier way to say "style variations".

Together we came to the best copy for this issue, considering accessibility.

I also made the copy translatable.

Props richtabor, ndiego, ntsekouras.
Fixes WordPress#48050.
  • Loading branch information
tomdevisser committed Feb 23, 2023
1 parent 2fbe9a0 commit 2df4231
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
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
Expand Up @@ -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;
const hasVariationsPanel = useHasVariationsPanel( name, path );

if ( ! hasVariationsPanel ) {
Expand All @@ -24,7 +25,11 @@ 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>
{ __( 'Customize variations of the block:' ) +
' ' +
blockName }
</p>
<Subtitle>{ __( 'Style Variations' ) }</Subtitle>
<VariationsPanel name={ name } />
</VStack>
Expand Down

0 comments on commit 2df4231

Please sign in to comment.