Pass child props to partners card (https://github.com/woocommerce/woocommerce-admin/pull/7929)
This commit is contained in:
parent
30e9922986
commit
331ca075c4
|
@ -12,13 +12,12 @@ import { recordEvent } from '@woocommerce/tracks';
|
||||||
import { PartnerCard } from '../components/partner-card';
|
import { PartnerCard } from '../components/partner-card';
|
||||||
import logo from './logo.png';
|
import logo from './logo.png';
|
||||||
|
|
||||||
export const Card = ( { isPending, task } ) => {
|
export const Card = ( { task } ) => {
|
||||||
const { avalaraActivated } = task.additionalData;
|
const { avalaraActivated } = task.additionalData;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PartnerCard
|
<PartnerCard
|
||||||
name={ __( 'Avalara', 'woocommerce-admin' ) }
|
name={ __( 'Avalara', 'woocommerce-admin' ) }
|
||||||
isPending={ isPending }
|
|
||||||
logo={ logo }
|
logo={ logo }
|
||||||
description={ __(
|
description={ __(
|
||||||
'Powerful all-in-one tax tool',
|
'Powerful all-in-one tax tool',
|
||||||
|
|
|
@ -18,7 +18,7 @@ export const PartnerCard: React.FC< {
|
||||||
terms: string;
|
terms: string;
|
||||||
actionText: string;
|
actionText: string;
|
||||||
onClick: () => void;
|
onClick: () => void;
|
||||||
isPending: boolean;
|
isBusy?: boolean;
|
||||||
} > = ( {
|
} > = ( {
|
||||||
name,
|
name,
|
||||||
logo,
|
logo,
|
||||||
|
@ -27,7 +27,7 @@ export const PartnerCard: React.FC< {
|
||||||
terms,
|
terms,
|
||||||
actionText,
|
actionText,
|
||||||
onClick,
|
onClick,
|
||||||
isPending,
|
isBusy,
|
||||||
} ) => {
|
} ) => {
|
||||||
return (
|
return (
|
||||||
<div className="woocommerce-tax-partner-card">
|
<div className="woocommerce-tax-partner-card">
|
||||||
|
@ -63,8 +63,8 @@ export const PartnerCard: React.FC< {
|
||||||
<Button
|
<Button
|
||||||
isSecondary
|
isSecondary
|
||||||
onClick={ onClick }
|
onClick={ onClick }
|
||||||
isBusy={ isPending }
|
isBusy={ isBusy }
|
||||||
disabled={ isPending }
|
disabled={ isBusy }
|
||||||
>
|
>
|
||||||
{ actionText }
|
{ actionText }
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -238,7 +238,7 @@ const Tax = ( { onComplete, query, task } ) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Partners>
|
<Partners { ...childProps }>
|
||||||
{ partners.map( ( partner ) =>
|
{ partners.map( ( partner ) =>
|
||||||
createElement( partner.card, {
|
createElement( partner.card, {
|
||||||
key: partner.id,
|
key: partner.id,
|
||||||
|
|
|
@ -14,11 +14,10 @@ import { PartnerCard } from '../components/partner-card';
|
||||||
import logo from './logo.png';
|
import logo from './logo.png';
|
||||||
import { TaxChildProps } from '../utils';
|
import { TaxChildProps } from '../utils';
|
||||||
|
|
||||||
export const Card: React.FC< TaxChildProps > = ( { isPending } ) => {
|
export const Card: React.FC< TaxChildProps > = () => {
|
||||||
return (
|
return (
|
||||||
<PartnerCard
|
<PartnerCard
|
||||||
name={ __( 'WooCommerce Tax', 'woocommerce-admin' ) }
|
name={ __( 'WooCommerce Tax', 'woocommerce-admin' ) }
|
||||||
isPending={ isPending }
|
|
||||||
logo={ logo }
|
logo={ logo }
|
||||||
description={ __( 'Best for new stores', 'woocommerce-admin' ) }
|
description={ __( 'Best for new stores', 'woocommerce-admin' ) }
|
||||||
benefits={ [
|
benefits={ [
|
||||||
|
|
Loading…
Reference in New Issue