woocommerce/plugins/woocommerce-admin/client/wp-admin-scripts/onboarding-product-notice/index.js

30 lines
709 B
JavaScript

/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { dispatch } from '@wordpress/data';
import domReady from '@wordpress/dom-ready';
import { getAdminLink } from '@woocommerce/wc-admin-settings';
/**
* Displays a notice after product creation.
*/
const showProductCompletionNotice = () => {
dispatch( 'core/notices' ).createSuccessNotice(
__( '🎉 Congrats on adding your first product!', 'woocommerce-admin' ),
{
id: 'WOOCOMMERCE_ONBOARDING_PRODUCT_NOTICE',
actions: [
{
url: getAdminLink( 'admin.php?page=wc-admin' ),
label: __( 'Continue setup.', 'woocommerce-admin' ),
},
],
}
);
};
domReady( () => {
showProductCompletionNotice();
} );