From 4fa4f802e947ba2502a857514ad7eefb82d8adc7 Mon Sep 17 00:00:00 2001 From: Gan Eng Chin Date: Fri, 23 Dec 2022 21:19:00 +0800 Subject: [PATCH 01/10] Check for empty recommended channels. --- .../overview-multichannel/Channels/Channels.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx index 5511a5c0957..38ecb794cd9 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx @@ -47,10 +47,18 @@ export const Channels = () => { /* * If users have no registered channels, - * we display recommended channels without collapsible list + * we should display recommended channels without collapsible list * and with a description in the card header. */ - if ( registeredChannels.length === 0 && recommendedChannels.length > 0 ) { + if ( registeredChannels.length === 0 ) { + /** + * If for some reasons we don't have recommended channels, + * then we should not show the Channels card at all. + */ + if ( recommendedChannels.length === 0 ) { + return null; + } + return ( From 06a303fc33da0a9691fa47168faa1418f199f661 Mon Sep 17 00:00:00 2001 From: Gan Eng Chin Date: Fri, 23 Dec 2022 21:21:52 +0800 Subject: [PATCH 02/10] Types for useRegisteredChannels. --- .../Channels/useRegisteredChannels.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useRegisteredChannels.ts b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useRegisteredChannels.ts index d02667433e9..d512f1d4d32 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useRegisteredChannels.ts +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useRegisteredChannels.ts @@ -1,3 +1,13 @@ +/** + * Internal dependencies + */ +import { InstalledChannel } from '~/marketing/types'; + +type UseRegisteredChannels = { + loading: boolean; + data: Array< InstalledChannel >; +}; + // // TODO: To be removed. This is for testing loading state. // export const useRegisteredChannels = () => { // // TODO: call API here to get data. @@ -17,7 +27,6 @@ // data: [ // { // slug: 'google-listings-and-ads', -// name: 'Google Listings and Ads', // title: 'Google Listings and Ads', // description: // 'Get in front of shoppers and drive traffic so you can grow your business with Smart Shopping Campaigns and free listings.', @@ -42,7 +51,6 @@ // data: [ // { // slug: 'google-listings-and-ads', -// name: 'Google Listings and Ads', // title: 'Google Listings and Ads', // description: // 'Get in front of shoppers and drive traffic so you can grow your business with Smart Shopping Campaigns and free listings.', @@ -59,7 +67,7 @@ // }; // TODO: To be removed. This is for testing everything works okay. -export const useRegisteredChannels = () => { +export const useRegisteredChannels = (): UseRegisteredChannels => { // TODO: call API here to get data. // The following are just dummy data for testing now. return { @@ -67,7 +75,6 @@ export const useRegisteredChannels = () => { data: [ { slug: 'google-listings-and-ads', - name: 'Google Listings and Ads', title: 'Google Listings and Ads', description: 'Get in front of shoppers and drive traffic so you can grow your business with Smart Shopping Campaigns and free listings.', From 31b635b88865a3f5cb5410ee63591765f86d262b Mon Sep 17 00:00:00 2001 From: Gan Eng Chin Date: Fri, 23 Dec 2022 21:53:42 +0800 Subject: [PATCH 03/10] Code refactor: move CSS code to corresponding SCSS file. --- .../overview-multichannel/Channels/Channels.scss | 4 ---- .../Channels/CollapsibleRecommendedChannels.scss | 5 +++++ .../Channels/CollapsibleRecommendedChannels.tsx | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.scss diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.scss b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.scss index a9d5343d54a..aff331de94f 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.scss +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.scss @@ -4,8 +4,4 @@ align-items: flex-start; gap: $gap-smallest; } - - .components-button.is-link { - text-decoration: none; - } } diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.scss b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.scss new file mode 100644 index 00000000000..eea3ae685b9 --- /dev/null +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.scss @@ -0,0 +1,5 @@ +.woocommerce-marketing-recommended-channels { + .components-button.is-link { + text-decoration: none; + } +} diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.tsx b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.tsx index ff32dedde99..48319ad41ef 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.tsx +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Fragment, useState } from '@wordpress/element'; +import { useState } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { CardBody, CardDivider, Button, Icon } from '@wordpress/components'; import { chevronUp, chevronDown } from '@wordpress/icons'; @@ -11,7 +11,7 @@ import { chevronUp, chevronDown } from '@wordpress/icons'; */ import { RecommendedChannel } from '~/marketing/types'; import { RecommendedChannelsList } from './RecommendedChannelsList'; -import './Channels.scss'; +import './CollapsibleRecommendedChannels.scss'; type RecommendedChannelsType = { recommendedChannels: Array< RecommendedChannel >; @@ -23,7 +23,7 @@ export const CollapsibleRecommendedChannels: React.FC< const [ collapsed, setCollapsed ] = useState( true ); return ( - <> +
); }; From af2f4eb904eda7ff31d3c21663b5851cb6a878df Mon Sep 17 00:00:00 2001 From: Gan Eng Chin Date: Fri, 23 Dec 2022 22:08:50 +0800 Subject: [PATCH 04/10] CSS for "Add channels" button. --- .../Channels/CollapsibleRecommendedChannels.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.scss b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.scss index eea3ae685b9..9a02c3861dc 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.scss +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.scss @@ -1,5 +1,8 @@ .woocommerce-marketing-recommended-channels { .components-button.is-link { + font-size: 14px; + font-weight: 600; + line-height: 17px; text-decoration: none; } } From 9e0b71ff1ccfc8a63bdff130e8a3b69aaa98dde1 Mon Sep 17 00:00:00 2001 From: Gan Eng Chin Date: Fri, 23 Dec 2022 22:12:16 +0800 Subject: [PATCH 05/10] Rename CollapsibleRecommendedChannels to RecommendedChannels. --- .../marketing/overview-multichannel/Channels/Channels.tsx | 4 ++-- ...eRecommendedChannels.scss => RecommendedChannels.scss} | 0 ...bleRecommendedChannels.tsx => RecommendedChannels.tsx} | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) rename plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/{CollapsibleRecommendedChannels.scss => RecommendedChannels.scss} (100%) rename plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/{CollapsibleRecommendedChannels.tsx => RecommendedChannels.tsx} (86%) diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx index 38ecb794cd9..fcae43a11dd 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx @@ -16,7 +16,7 @@ import { import { useChannels } from './useChannels'; import './Channels.scss'; import { InstalledChannelCardBody } from './InstalledChannelCardBody'; -import { CollapsibleRecommendedChannels } from './CollapsibleRecommendedChannels'; +import { RecommendedChannels } from './RecommendedChannels'; import { RecommendedChannelsList } from './RecommendedChannelsList'; export const Channels = () => { @@ -107,7 +107,7 @@ export const Channels = () => { { /* Recommended channels section. */ } { recommendedChannels.length > 0 && ( - ) } diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.scss b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/RecommendedChannels.scss similarity index 100% rename from plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.scss rename to plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/RecommendedChannels.scss diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.tsx b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/RecommendedChannels.tsx similarity index 86% rename from plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.tsx rename to plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/RecommendedChannels.tsx index 48319ad41ef..94bdd0bf557 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/CollapsibleRecommendedChannels.tsx +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/RecommendedChannels.tsx @@ -11,15 +11,15 @@ import { chevronUp, chevronDown } from '@wordpress/icons'; */ import { RecommendedChannel } from '~/marketing/types'; import { RecommendedChannelsList } from './RecommendedChannelsList'; -import './CollapsibleRecommendedChannels.scss'; +import './RecommendedChannels.scss'; type RecommendedChannelsType = { recommendedChannels: Array< RecommendedChannel >; }; -export const CollapsibleRecommendedChannels: React.FC< - RecommendedChannelsType -> = ( { recommendedChannels } ) => { +export const RecommendedChannels: React.FC< RecommendedChannelsType > = ( { + recommendedChannels, +} ) => { const [ collapsed, setCollapsed ] = useState( true ); return ( From 7bd32ba638b5aeaeb9caa4078350d682af781692 Mon Sep 17 00:00:00 2001 From: Gan Eng Chin Date: Sat, 24 Dec 2022 00:32:23 +0800 Subject: [PATCH 06/10] Remove useChannels and use useRegisteredChannels and useRecommendedChannels directly. --- .../Channels/Channels.tsx | 33 +++++++++---------- .../Channels/useChannels.ts | 20 ----------- 2 files changed, 15 insertions(+), 38 deletions(-) delete mode 100644 plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useChannels.ts diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx index fcae43a11dd..c485bef0bce 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx @@ -13,24 +13,25 @@ import { CardHeaderDescription, CenteredSpinner, } from '~/marketing/components'; -import { useChannels } from './useChannels'; -import './Channels.scss'; +import { useRegisteredChannels } from './useRegisteredChannels'; +import { useRecommendedChannels } from './useRecommendedChannels'; import { InstalledChannelCardBody } from './InstalledChannelCardBody'; import { RecommendedChannels } from './RecommendedChannels'; import { RecommendedChannelsList } from './RecommendedChannelsList'; +import './Channels.scss'; export const Channels = () => { - const { - loading, - data: { registeredChannels, recommendedChannels }, - } = useChannels(); + const { loading: loadingRegistered, data: dataRegistered } = + useRegisteredChannels(); + const { loading: loadingRecommended, data: dataRecommended } = + useRecommendedChannels(); /** * TODO: we may need to filter the channels against * `@woocommerce/data` installed plugins. */ - if ( loading ) { + if ( loadingRegistered || loadingRecommended ) { return ( @@ -50,12 +51,12 @@ export const Channels = () => { * we should display recommended channels without collapsible list * and with a description in the card header. */ - if ( registeredChannels.length === 0 ) { + if ( dataRegistered.length === 0 ) { /** * If for some reasons we don't have recommended channels, * then we should not show the Channels card at all. */ - if ( recommendedChannels.length === 0 ) { + if ( dataRecommended.length === 0 ) { return null; } @@ -73,7 +74,7 @@ export const Channels = () => { ); @@ -94,22 +95,18 @@ export const Channels = () => {
{ /* Registered channels section. */ } - { registeredChannels.map( ( el, idx ) => { + { dataRegistered.map( ( el, idx ) => { return ( - { idx < registeredChannels.length - 1 && ( - - ) } + { idx < dataRegistered.length - 1 && } ); } ) } { /* Recommended channels section. */ } - { recommendedChannels.length > 0 && ( - + { dataRecommended.length > 0 && ( + ) }
); diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useChannels.ts b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useChannels.ts deleted file mode 100644 index 122b466ddf7..00000000000 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useChannels.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Internal dependencies - */ -import { useRecommendedChannels } from './useRecommendedChannels'; -import { useRegisteredChannels } from './useRegisteredChannels'; - -export const useChannels = () => { - const { loading: loadingRegistered, data: dataRegistered } = - useRegisteredChannels(); - const { loading: loadingRecommended, data: dataRecommended } = - useRecommendedChannels(); - - return { - loading: loadingRegistered || loadingRecommended, - data: { - registeredChannels: dataRegistered, - recommendedChannels: dataRecommended, - }, - }; -}; From e950417542514b85325338552d8023c5756862fe Mon Sep 17 00:00:00 2001 From: Gan Eng Chin Date: Sat, 24 Dec 2022 00:48:03 +0800 Subject: [PATCH 07/10] Move useRegisteredChannels and useRecommendedChannels into shared hooks directory. --- plugins/woocommerce-admin/client/marketing/hooks/index.ts | 2 ++ .../Channels => hooks}/useRecommendedChannels.ts | 0 .../Channels => hooks}/useRegisteredChannels.ts | 0 .../marketing/overview-multichannel/Channels/Channels.tsx | 6 ++++-- 4 files changed, 6 insertions(+), 2 deletions(-) rename plugins/woocommerce-admin/client/marketing/{overview-multichannel/Channels => hooks}/useRecommendedChannels.ts (100%) rename plugins/woocommerce-admin/client/marketing/{overview-multichannel/Channels => hooks}/useRegisteredChannels.ts (100%) diff --git a/plugins/woocommerce-admin/client/marketing/hooks/index.ts b/plugins/woocommerce-admin/client/marketing/hooks/index.ts index a504ae73f17..0a80d7f7f22 100644 --- a/plugins/woocommerce-admin/client/marketing/hooks/index.ts +++ b/plugins/woocommerce-admin/client/marketing/hooks/index.ts @@ -1 +1,3 @@ export { useInstalledPlugins } from './useInstalledPlugins'; +export { useRegisteredChannels } from './useRegisteredChannels'; +export { useRecommendedChannels } from './useRecommendedChannels'; diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useRecommendedChannels.ts b/plugins/woocommerce-admin/client/marketing/hooks/useRecommendedChannels.ts similarity index 100% rename from plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useRecommendedChannels.ts rename to plugins/woocommerce-admin/client/marketing/hooks/useRecommendedChannels.ts diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useRegisteredChannels.ts b/plugins/woocommerce-admin/client/marketing/hooks/useRegisteredChannels.ts similarity index 100% rename from plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useRegisteredChannels.ts rename to plugins/woocommerce-admin/client/marketing/hooks/useRegisteredChannels.ts diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx index c485bef0bce..32b5d3a2879 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx @@ -13,8 +13,10 @@ import { CardHeaderDescription, CenteredSpinner, } from '~/marketing/components'; -import { useRegisteredChannels } from './useRegisteredChannels'; -import { useRecommendedChannels } from './useRecommendedChannels'; +import { + useRegisteredChannels, + useRecommendedChannels, +} from '~/marketing/hooks'; import { InstalledChannelCardBody } from './InstalledChannelCardBody'; import { RecommendedChannels } from './RecommendedChannels'; import { RecommendedChannelsList } from './RecommendedChannelsList'; From 52dd8845cc6e4ce66d2e408e290085173b20f34a Mon Sep 17 00:00:00 2001 From: Gan Eng Chin Date: Sat, 24 Dec 2022 01:14:02 +0800 Subject: [PATCH 08/10] Load registered and recommended channels in MarketingOverviewMultichannel. The data will be used to conditionally display Campaigns card later. --- .../Channels/Channels.tsx | 70 ++++++------------- .../MarketingOverviewMultichannel.tsx | 20 +++++- 2 files changed, 40 insertions(+), 50 deletions(-) diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx index 32b5d3a2879..0f3a07e140a 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx @@ -3,65 +3,33 @@ */ import { Fragment } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; -import { Card, CardHeader, CardBody, CardDivider } from '@wordpress/components'; +import { Card, CardHeader, CardDivider } from '@wordpress/components'; /** * Internal dependencies */ -import { - CardHeaderTitle, - CardHeaderDescription, - CenteredSpinner, -} from '~/marketing/components'; -import { - useRegisteredChannels, - useRecommendedChannels, -} from '~/marketing/hooks'; +import { CardHeaderTitle, CardHeaderDescription } from '~/marketing/components'; +import { InstalledChannel, RecommendedChannel } from '~/marketing/types'; import { InstalledChannelCardBody } from './InstalledChannelCardBody'; import { RecommendedChannels } from './RecommendedChannels'; import { RecommendedChannelsList } from './RecommendedChannelsList'; import './Channels.scss'; -export const Channels = () => { - const { loading: loadingRegistered, data: dataRegistered } = - useRegisteredChannels(); - const { loading: loadingRecommended, data: dataRecommended } = - useRecommendedChannels(); - - /** - * TODO: we may need to filter the channels against - * `@woocommerce/data` installed plugins. - */ - - if ( loadingRegistered || loadingRecommended ) { - return ( - - - - { __( 'Channels', 'woocommerce' ) } - - - - - - - ); - } +type ChannelsProps = { + registeredChannels: Array< InstalledChannel >; + recommendedChannels: Array< RecommendedChannel >; +}; +export const Channels: React.FC< ChannelsProps > = ( { + registeredChannels, + recommendedChannels, +} ) => { /* * If users have no registered channels, * we should display recommended channels without collapsible list * and with a description in the card header. */ - if ( dataRegistered.length === 0 ) { - /** - * If for some reasons we don't have recommended channels, - * then we should not show the Channels card at all. - */ - if ( dataRecommended.length === 0 ) { - return null; - } - + if ( registeredChannels.length === 0 ) { return ( @@ -76,7 +44,7 @@ export const Channels = () => { ); @@ -97,18 +65,22 @@ export const Channels = () => { { /* Registered channels section. */ } - { dataRegistered.map( ( el, idx ) => { + { registeredChannels.map( ( el, idx ) => { return ( - { idx < dataRegistered.length - 1 && } + { idx < registeredChannels.length - 1 && ( + + ) } ); } ) } { /* Recommended channels section. */ } - { dataRecommended.length > 0 && ( - + { recommendedChannels.length >= 1 && ( + ) } ); diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/MarketingOverviewMultichannel.tsx b/plugins/woocommerce-admin/client/marketing/overview-multichannel/MarketingOverviewMultichannel.tsx index cffa5655873..7cbad05d6a2 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/MarketingOverviewMultichannel.tsx +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/MarketingOverviewMultichannel.tsx @@ -12,18 +12,36 @@ import { InstalledExtensions } from './InstalledExtensions'; import { DiscoverTools } from './DiscoverTools'; import { LearnMarketing } from './LearnMarketing'; import '~/marketing/data'; +import { + useRegisteredChannels, + useRecommendedChannels, +} from '~/marketing/hooks'; import './MarketingOverviewMultichannel.scss'; +import { CenteredSpinner } from '../components'; export const MarketingOverviewMultichannel: React.FC = () => { + const { loading: loadingRegistered, data: dataRegistered } = + useRegisteredChannels(); + const { loading: loadingRecommended, data: dataRecommended } = + useRecommendedChannels(); const { currentUserCan } = useUser(); const shouldShowExtensions = getAdminSetting( 'allowMarketplaceSuggestions', false ) && currentUserCan( 'install_plugins' ); + if ( loadingRegistered || loadingRecommended ) { + return ; + } + return (
- + { ( dataRegistered.length >= 1 || dataRecommended.length >= 1 ) && ( + + ) } { shouldShowExtensions && } From 8e39098256c8fe016a42da7760a48efd37d2eb2c Mon Sep 17 00:00:00 2001 From: Gan Eng Chin Date: Sat, 24 Dec 2022 01:43:09 +0800 Subject: [PATCH 09/10] Show Campaigns card only when there is at least one registered channel. --- .../overview-multichannel/MarketingOverviewMultichannel.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/MarketingOverviewMultichannel.tsx b/plugins/woocommerce-admin/client/marketing/overview-multichannel/MarketingOverviewMultichannel.tsx index 3a650b32588..e7858c2c01a 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/MarketingOverviewMultichannel.tsx +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/MarketingOverviewMultichannel.tsx @@ -37,8 +37,7 @@ export const MarketingOverviewMultichannel: React.FC = () => { return (
- { /* TODO: show Campaigns card only when there is at least one registered channel. */ } - + { dataRegistered.length >= 1 && } { ( dataRegistered.length >= 1 || dataRecommended.length >= 1 ) && ( Date: Sat, 24 Dec 2022 01:45:59 +0800 Subject: [PATCH 10/10] Remove the unneeded "Create new campaign" button for now. --- .../overview-multichannel/Campaigns/Campaigns.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Campaigns/Campaigns.tsx b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Campaigns/Campaigns.tsx index e7448cea653..c422bd7b089 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Campaigns/Campaigns.tsx +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Campaigns/Campaigns.tsx @@ -34,9 +34,6 @@ export const Campaigns = () => { { __( 'Campaigns', 'woocommerce' ) } - @@ -52,9 +49,6 @@ export const Campaigns = () => { { __( 'Campaigns', 'woocommerce' ) } - @@ -86,9 +80,6 @@ export const Campaigns = () => { { __( 'Campaigns', 'woocommerce' ) } -