2021-01-08 02:06:52 +00:00
/ * *
* External dependencies
* /
import React , { useState , useEffect } from '@wordpress/element' ;
import { Guide } from '@wordpress/components' ;
import { _ _ } from '@wordpress/i18n' ;
import { recordEvent } from '@woocommerce/tracks' ;
2022-02-21 02:34:25 +00:00
import interpolateComponents from '@automattic/interpolate-components' ;
2024-05-31 03:49:36 +00:00
import clsx from 'clsx' ;
2021-01-08 02:06:52 +00:00
import { Link } from '@woocommerce/components' ;
/ * *
* Internal dependencies
* /
import { LineChartIllustration } from '../welcome-modal/illustrations/line-chart' ;
import { PageContent } from '../welcome-modal/page-content' ;
import './style.scss' ;
const page = {
image : < LineChartIllustration / > ,
content : (
< PageContent
title = { _ _ (
2021-02-10 23:57:51 +00:00
'Welcome to your new store management experience' ,
2022-03-30 09:00:04 +00:00
'woocommerce'
2021-01-08 02:06:52 +00:00
) }
body = { interpolateComponents ( {
mixedString : _ _ (
"We've designed your navigation and home screen to help you focus on the things that matter most in managing your online store. {{link}}Learn more{{/link}} about these changes – or explore on your own." ,
2022-03-30 09:00:04 +00:00
'woocommerce'
2021-01-08 02:06:52 +00:00
) ,
components : {
link : (
< Link
2021-01-20 04:04:37 +00:00
href = "https://wordpress.com/support/new-woocommerce-experience-on-wordpress-dot-com/"
2021-01-08 02:06:52 +00:00
type = "external"
target = "_blank"
/ >
) ,
} ,
} ) }
/ >
) ,
} ;
export default function WelcomeFromCalypsoModal ( { onClose } ) {
const [ guideIsOpen , setGuideIsOpen ] = useState ( true ) ;
useEffect ( ( ) => {
recordEvent ( 'welcome_from_calypso_modal_open' ) ;
} , [ ] ) ;
if ( ! guideIsOpen ) {
return null ;
}
2024-05-31 03:49:36 +00:00
const guideClassNames = clsx (
2021-01-08 02:06:52 +00:00
'woocommerce__welcome-modal' ,
'woocommerce__welcome-from-calypso-modal'
) ;
return (
< Guide
onFinish = { ( ) => {
if ( onClose ) {
onClose ( ) ;
}
setGuideIsOpen ( false ) ;
recordEvent ( 'welcome_from_calypso_modal_close' ) ;
} }
className = { guideClassNames }
2022-03-30 09:00:04 +00:00
finishButtonText = { _ _ ( "Let's go" , 'woocommerce' ) }
2021-01-08 02:06:52 +00:00
pages = { [ page ] }
/ >
) ;
}