diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-dashboard-widgets/wpcom-dashboard-widgets.php b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-dashboard-widgets/wpcom-dashboard-widgets.php index ec76b2d6eab10..f5d89001a4171 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-dashboard-widgets/wpcom-dashboard-widgets.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-dashboard-widgets/wpcom-dashboard-widgets.php @@ -23,7 +23,8 @@ function load_wpcom_dashboard_widgets() { ), array( 'id' => 'wpcom_general_tasks_widget', - 'name' => __( 'Tasks', 'jetpack-mu-wpcom' ), + 'name' => __( 'Suggestions', 'jetpack-mu-wpcom' ), + //
'priority' => 'high', ), ); diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-dashboard-widgets/wpcom-general-tasks-widget/index.js b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-dashboard-widgets/wpcom-general-tasks-widget/index.js index cccf61b1022a7..a71cb29254ab1 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-dashboard-widgets/wpcom-general-tasks-widget/index.js +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-dashboard-widgets/wpcom-general-tasks-widget/index.js @@ -1,7 +1,10 @@ import apiFetch from '@wordpress/api-fetch'; import { useEffect, useState } from '@wordpress/element'; +import { __ } from '@wordpress/i18n'; import TaskDomainUpsell from './tasks/home-task-domain-upsell'; +import './style.scss'; + const taskMap = { 'home-task-domain-upsell': TaskDomainUpsell, }; @@ -22,25 +25,65 @@ export default ( { siteId } ) => { // The secondary array countains strings that refer to cards, except for the // tasks which is an array. const tasks = response.secondary.find( item => Array.isArray( item ) ); - const task = tasks[ index ]; + if ( ! tasks ) { + return{ __( 'No suggestions.', 'jetpack-mu-wpcom' ) }
; + } + + const task = tasks[ index ]; const TaskComponent = taskMap[ task ]; return ( <> - { TaskComponent ?To do: { task }
} -To do: { task }
+ ) } + { /* { createPortal( + +Domain Upsell Component
; + // To do: actually fetch it from the API. + const domain = new URL( window.location.href ).hostname.split( '.' )[ 0 ] + '.com'; + return ( + <> ++ { domain } is a perfect site address. It’s available, easy to find, share, + and follow. Get it now and claim a corner of the web. +
++ { /* To do: convert to SVG. */ } + + { domain } + + +
+