2019-11-12 01:17:36 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { __ } from '@wordpress/i18n';
|
|
|
|
import { dispatch } from '@wordpress/data';
|
|
|
|
import domReady from '@wordpress/dom-ready';
|
2019-11-22 17:07:26 +00:00
|
|
|
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
2019-11-12 01:17:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays a notice after product creation.
|
|
|
|
*/
|
|
|
|
const showProductCompletionNotice = () => {
|
|
|
|
dispatch( 'core/notices' ).createSuccessNotice(
|
2020-01-06 15:27:09 +00:00
|
|
|
__( '🎉 Congrats on adding your first product!', 'woocommerce-admin' ),
|
2019-11-12 01:17:36 +00:00
|
|
|
{
|
|
|
|
id: 'WOOCOMMERCE_ONBOARDING_PRODUCT_NOTICE',
|
|
|
|
actions: [
|
|
|
|
{
|
|
|
|
url: getAdminLink( 'admin.php?page=wc-admin' ),
|
|
|
|
label: __( 'Continue setup.', 'woocommerce-admin' ),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
domReady( () => {
|
|
|
|
showProductCompletionNotice();
|
|
|
|
} );
|