Add InstalledChannelCardBody to Channels.

This commit is contained in:
Gan Eng Chin 2022-12-10 01:37:21 +08:00
parent 92112e27a1
commit a9010ffd68
No known key found for this signature in database
GPG Key ID: 94D5D972860ADB01
3 changed files with 41 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import {
} from '~/marketing/components';
import { useChannels } from './useChannels';
import './Channels.scss';
import { InstalledChannelCardBody } from './InstalledChannelCardBody';
export const Channels = () => {
const {
@ -90,10 +91,23 @@ export const Channels = () => {
</CardHeader>
{ /* TODO: registered channels here. */ }
{ registeredChannels.map( ( el, idx ) => {
return (
<Fragment key={ el.slug }>
<InstalledChannelCardBody installedChannel={ el } />
{ idx < registeredChannels.length - 1 && (
<CardDivider />
) }
</Fragment>
);
} ) }
{ /* TODO: recommended channels here. */ }
{ recommendedChannels.length > 0 && (
<CardBody>recommended</CardBody>
<>
<CardDivider />
<CardBody>recommended</CardBody>
</>
) }
</Card>
);

View File

@ -0,0 +1,2 @@
.woocommerce-marketing-installed-channel-card-body {
}

View File

@ -0,0 +1,24 @@
/**
* External dependencies
*/
import { CardBody } from '@wordpress/components';
/**
* Internal dependencies
*/
import { InstalledChannel } from '~/marketing/types';
import './InstalledChannelCardBody.scss';
type InstalledChannelCardBodyProps = {
installedChannel: InstalledChannel;
};
export const InstalledChannelCardBody: React.FC<
InstalledChannelCardBodyProps
> = ( { installedChannel } ) => {
return (
<CardBody className="woocommerce-marketing-installed-channel-card-body">
InstalledChannelCardBody
</CardBody>
);
};