From 83434bf46dc0529d9a97e8c4a5155d2a57c407f2 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Fri, 8 Dec 2023 20:56:37 +0000 Subject: [PATCH] Improve text and design of the block removal warnings (#56869) * Improve text and design of the block removal warnings * Updating heading from "Are you sure?" to "Be careful!" --------- Co-authored-by: annezazu --- .../block-removal-warning-modal/index.js | 21 +++++++------------ .../specs/site-editor/block-removal.spec.js | 6 ++++-- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/packages/block-editor/src/components/block-removal-warning-modal/index.js b/packages/block-editor/src/components/block-removal-warning-modal/index.js index 08f3deccb5ae08..a6de602bcdda81 100644 --- a/packages/block-editor/src/components/block-removal-warning-modal/index.js +++ b/packages/block-editor/src/components/block-removal-warning-modal/index.js @@ -8,7 +8,7 @@ import { Button, __experimentalHStack as HStack, } from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; +import { __, _n } from '@wordpress/i18n'; /** * Internal dependencies @@ -48,22 +48,15 @@ export function BlockRemovalWarningModal( { rules } ) { return ( - { blockNamesForPrompt.length === 1 ? ( -

{ rules[ blockNamesForPrompt[ 0 ] ] }

- ) : ( -
    - { blockNamesForPrompt.map( ( name ) => ( -
  • { rules[ name ] }
  • - ) ) } -
- ) }

- { blockNamesForPrompt.length > 1 - ? __( 'Removing these blocks is not advised.' ) - : __( 'Removing this block is not advised.' ) } + { _n( + 'Post or page content will not be displayed if you delete this block.', + 'Post or page content will not be displayed if you delete these blocks.', + blockNamesForPrompt.length + ) }