Fix build error after merging.

This commit is contained in:
Gan Eng Chin 2023-02-27 23:49:50 +08:00
parent f420a0ed9e
commit 418e4fba02
No known key found for this signature in database
GPG Key ID: 94D5D972860ADB01
2 changed files with 20 additions and 7 deletions

View File

@ -8,4 +8,3 @@ export { PluginCardBody, SmartPluginCardBody } from './PluginCardBody';
export { CardHeaderTitle } from './CardHeaderTitle';
export { CardHeaderDescription } from './CardHeaderDescription';
export { CenteredSpinner } from './CenteredSpinner';
export { RecommendedChannelsList } from './RecommendedChannelsList';

View File

@ -2,9 +2,10 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { useState } from '@wordpress/element';
import { Fragment, useState } from '@wordpress/element';
import {
Button,
CardDivider,
Modal,
Icon,
Flex,
@ -17,8 +18,8 @@ import classnames from 'classnames';
/**
* Internal dependencies
*/
import { RecommendedChannelsList } from '~/marketing/components';
import { useRecommendedChannels } from '~/marketing/hooks';
import { SmartPluginCardBody } from '~/marketing/components';
import { useNewCampaignTypes } from './useNewCampaignTypes';
import './CreateNewCampaignModal.scss';
@ -115,7 +116,7 @@ export const CreateNewCampaignModal = ( props: CreateCampaignModalProps ) => {
} ) }
</div>
</div>
{ recommendedChannels.length > 0 && (
{ recommendedChannels?.length && (
<div className="woocommerce-marketing-add-channels">
<Flex direction="column">
<FlexItem>
@ -135,9 +136,22 @@ export const CreateNewCampaignModal = ( props: CreateCampaignModalProps ) => {
</FlexItem>
{ ! collapsed && (
<FlexItem>
<RecommendedChannelsList
recommendedChannels={ recommendedChannels }
{ recommendedChannels.map( ( el, idx ) => {
return (
<Fragment key={ el.plugin }>
<SmartPluginCardBody
plugin={ el }
onInstalledAndActivated={
// TODO: check what to do here.
() => {}
}
/>
{ idx !==
recommendedChannels.length -
1 && <CardDivider /> }
</Fragment>
);
} ) }
</FlexItem>
) }
</Flex>