2020-08-05 00:14:56 +00:00
/ * *
* External dependencies
* /
import React , { useState , useEffect } from '@wordpress/element' ;
import { Guide } from '@wordpress/components' ;
import { _ _ } from '@wordpress/i18n' ;
2020-08-20 04:59:52 +00:00
import { recordEvent } from '@woocommerce/tracks' ;
2020-08-05 00:14:56 +00:00
/ * *
* Internal dependencies
* /
import { LineChartIllustration } from './illustrations/line-chart' ;
import { InboxIllustration } from './illustrations/inbox' ;
import { PieChartIllustration } from './illustrations/pie-chart' ;
import { PageContent } from './page-content' ;
import './style.scss' ;
const pages = [
{
image : < LineChartIllustration / > ,
content : (
< PageContent
title = { _ _ (
'Welcome to your WooCommerce store’ s online HQ!' ,
'woocommerce-admin'
) }
body = { _ _ (
"Here's where you’ ll find setup suggestions, tips and tools, and key data on your store’ s performance and earnings — all the basics for store management and growth." ,
'woocommerce-admin'
) }
/ >
) ,
} ,
{
image : < InboxIllustration / > ,
content : (
< PageContent
title = { _ _ (
2021-02-10 23:57:51 +00:00
'A personalized inbox full of relevant advice' ,
2020-08-05 00:14:56 +00:00
'woocommerce-admin'
) }
body = { _ _ (
'Check your inbox for helpful growth tips tailored to your store and notifications about key traffic and sales milestones. We look forward to celebrating them with you!' ,
'woocommerce-admin'
) }
/ >
) ,
} ,
{
image : < PieChartIllustration / > ,
content : (
< PageContent
title = { _ _ (
2021-02-10 23:57:51 +00:00
'Good data leads to smart business decisions' ,
2020-08-05 00:14:56 +00:00
'woocommerce-admin'
) }
2021-03-02 03:21:48 +00:00
body = { _ _ (
'Monitor your stats to improve performance, increase sales, and track your progress toward revenue goals. The more you know, the better you can serve your customers and grow your store.' ,
'woocommerce-admin'
) }
2020-08-05 00:14:56 +00:00
/ >
) ,
} ,
] ;
export const WelcomeModal = ( { onClose } ) => {
const [ guideIsOpen , setGuideIsOpen ] = useState ( true ) ;
useEffect ( ( ) => {
recordEvent ( 'task_list_welcome_modal_open' ) ;
} , [ ] ) ;
return (
< >
{ guideIsOpen && (
< Guide
onFinish = { ( ) => {
setGuideIsOpen ( false ) ;
onClose ( ) ;
recordEvent ( 'task_list_welcome_modal_close' ) ;
} }
className = { 'woocommerce__welcome-modal' }
finishButtonText = { _ _ ( "Let's go" , 'woocommerce-admin' ) }
pages = { pages }
/ >
) }
< / >
) ;
} ;