Display issue status in Channels card.
This commit is contained in:
parent
437ebb20a8
commit
e6e6dc19ef
|
@ -1,4 +1,13 @@
|
|||
.woocommerce-marketing-installed-channel-card-body {
|
||||
.woocommerce-marketing-installed-channel-description {
|
||||
display: flex;
|
||||
gap: $gap-smaller;
|
||||
|
||||
&__separator::before {
|
||||
content: '•';
|
||||
}
|
||||
}
|
||||
|
||||
.woocommerce-marketing-sync-status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -19,4 +28,20 @@
|
|||
fill: #008a20;
|
||||
}
|
||||
}
|
||||
|
||||
.woocommerce-marketing-issue-status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: $gap-smallest;
|
||||
|
||||
&__error {
|
||||
color: $alert-red;
|
||||
fill: $alert-red;
|
||||
}
|
||||
|
||||
&__warning {
|
||||
color: $alert-yellow;
|
||||
fill: $alert-yellow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,50 @@ const SyncStatus: React.FC< SyncStatusPropsType > = ( { status } ) => {
|
|||
);
|
||||
};
|
||||
|
||||
type IssueStatusPropsType = {
|
||||
installedChannel: InstalledChannel;
|
||||
};
|
||||
|
||||
const issueStatusClassName = 'woocommerce-marketing-issue-status';
|
||||
|
||||
const IssueStatus: React.FC< IssueStatusPropsType > = ( {
|
||||
installedChannel,
|
||||
} ) => {
|
||||
if ( installedChannel.issueType === 'error' ) {
|
||||
return (
|
||||
<div
|
||||
className={ classnames(
|
||||
issueStatusClassName,
|
||||
`${ issueStatusClassName }__error`
|
||||
) }
|
||||
>
|
||||
<GridiconNotice size={ iconSize } />
|
||||
{ installedChannel.issueText }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if ( installedChannel.issueType === 'warning' ) {
|
||||
return (
|
||||
<div
|
||||
className={ classnames(
|
||||
issueStatusClassName,
|
||||
`${ issueStatusClassName }__warning`
|
||||
) }
|
||||
>
|
||||
<GridiconNotice size={ iconSize } />
|
||||
{ installedChannel.issueText }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={ issueStatusClassName }>
|
||||
{ installedChannel.issueText }
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const InstalledChannelCardBody: React.FC<
|
||||
InstalledChannelCardBodyProps
|
||||
> = ( { installedChannel } ) => {
|
||||
|
@ -71,8 +115,10 @@ export const InstalledChannelCardBody: React.FC<
|
|||
}
|
||||
name={ installedChannel.title }
|
||||
description={
|
||||
<div>
|
||||
<div className="woocommerce-marketing-installed-channel-description">
|
||||
<SyncStatus status={ installedChannel.syncStatus } />
|
||||
<div className="woocommerce-marketing-installed-channel-description__separator" />
|
||||
<IssueStatus installedChannel={ installedChannel } />
|
||||
</div>
|
||||
}
|
||||
button={
|
||||
|
|
Loading…
Reference in New Issue