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';
|
2022-01-06 12:53:30 +00:00
|
|
|
import { getAdminLink } from '@woocommerce/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();
|
|
|
|
} );
|