2020-04-27 14:56:15 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { compose } from '@wordpress/compose';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import ProfileWizard from '../profile-wizard';
|
|
|
|
import withSelect from 'wc-api/with-select';
|
|
|
|
import { isOnboardingEnabled } from 'dashboard/utils';
|
|
|
|
|
|
|
|
const Homepage = ( { profileItems, query } ) => {
|
|
|
|
if ( isOnboardingEnabled() && ! profileItems.completed ) {
|
|
|
|
return <ProfileWizard query={ query } />;
|
|
|
|
}
|
|
|
|
|
2020-04-22 21:32:44 +00:00
|
|
|
return <div>Hello World</div>;
|
|
|
|
};
|
|
|
|
|
2020-04-27 14:56:15 +00:00
|
|
|
export default compose(
|
|
|
|
withSelect( ( select ) => {
|
|
|
|
if ( ! isOnboardingEnabled() ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const { getProfileItems } = select( 'wc-api' );
|
|
|
|
const profileItems = getProfileItems();
|
|
|
|
|
|
|
|
return { profileItems };
|
|
|
|
} )
|
|
|
|
)( Homepage );
|