Add a blank space between the emoji and the message within a notice popup (#35698)

* Add a blank space between the emoji and the message within a notice popup

* Apply comment suggestions

* Remove duplicated text in the snackbar message after publishing a product
This commit is contained in:
Maikel David Pérez Gómez 2022-11-25 10:21:22 -03:00 committed by GitHub
parent 12121a40ee
commit 410f06b8c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 37 deletions

View File

@ -83,24 +83,19 @@ export function useProductHelper() {
} ).then(
( newProduct ) => {
if ( ! skipNotice ) {
createNotice(
'success',
const noticeContent =
newProduct.status === 'publish'
? __(
'🎉 Product published. View in store',
'woocommerce'
)
? __( 'Product published.', 'woocommerce' )
: __(
'🎉 Product successfully created.',
'Product successfully created.',
'woocommerce'
),
{
actions: getNoticePreviewActions(
newProduct.status,
newProduct.permalink
),
}
);
);
createNotice( 'success', `🎉‎ ${ noticeContent }`, {
actions: getNoticePreviewActions(
newProduct.status,
newProduct.permalink
),
} );
}
setUpdating( {
...updating,
@ -160,25 +155,20 @@ export function useProductHelper() {
} ).then(
( updatedProduct ) => {
if ( ! skipNotice ) {
createNotice(
'success',
const noticeContent =
product.status === 'draft' &&
updatedProduct.status === 'publish'
? __(
'🎉 Product published. View in store.',
'woocommerce'
)
updatedProduct.status === 'publish'
? __( 'Product published.', 'woocommerce' )
: __(
'🎉 Product successfully updated.',
'Product successfully updated.',
'woocommerce'
),
{
actions: getNoticePreviewActions(
updatedProduct.status,
updatedProduct.permalink
),
}
);
);
createNotice( 'success', `🎉‎ ${ noticeContent }`, {
actions: getNoticePreviewActions(
updatedProduct.status,
updatedProduct.permalink
),
} );
}
setUpdating( {
...updating,
@ -234,13 +224,11 @@ export function useProductHelper() {
setIsDeleting( true );
return deleteProduct( id ).then(
( product ) => {
createNotice(
'success',
__(
'🎉 Successfully moved product to Trash.',
'woocommerce'
)
const noticeContent = __(
'Successfully moved product to Trash.',
'woocommerce'
);
createNotice( 'success', `🎉‎ ${ noticeContent }` );
setIsDeleting( false );
return product;
},

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Add a blank space between the emoji and the message within a notice popup