Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
fix errors caused by demo payment methods (#1547)
Browse files Browse the repository at this point in the history
  • Loading branch information
nerrad authored Jan 13, 2020
1 parent 1c44e3b commit 2245022
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
4 changes: 2 additions & 2 deletions assets/js/payment-methods-demo/express-payment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
import { applePayImage } from './apple-pay';
import { paypalImage } from './paypal';

export const expressApplePay = <img src={ applePayImage } alt="" />;
export const ExpressApplePay = () => <img src={ applePayImage } alt="" />;

export const expressPaypal = <img src={ paypalImage } alt="" />;
export const ExpressPaypal = () => <img src={ paypalImage } alt="" />;
6 changes: 3 additions & 3 deletions assets/js/payment-methods-demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ import {
/**
* Internal dependencies
*/
import { expressApplePay, expressPaypal } from './express-payment';
import { ExpressApplePay, ExpressPaypal } from './express-payment';
import { paypalPaymentMethod, ccPaymentMethod } from './payment-methods';

registerExpressPaymentMethod(
( Config ) =>
new Config( {
id: 'applepay',
activeContent: expressApplePay,
activeContent: <ExpressApplePay />,
canMakePayment: Promise.resolve( true ),
} )
);
registerExpressPaymentMethod(
( Config ) =>
new Config( {
id: 'paypal',
activeContent: expressPaypal,
activeContent: <ExpressPaypal />,
canMakePayment: Promise.resolve( true ),
} )
);
Expand Down
28 changes: 18 additions & 10 deletions assets/js/payment-methods-demo/payment-methods/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,27 @@
import { paypalSvg } from './paypal';
import { ccSvg } from './cc';

const PaypalActivePaymentMethod = () => {
return (
<div>
<p>This is where paypal payment method stuff would be.</p>
</div>
);
};

const CreditCardActivePaymentMethod = () => {
return (
<div>
<p>This is where cc payment method stuff would be.</p>
</div>
);
};

export const paypalPaymentMethod = {
id: 'paypal',
label: <img src={ paypalSvg } alt="" />,
stepContent: <div>Billing steps</div>,
activeContent: (
<div>
<p>This is where paypal payment method stuff would be.</p>
</div>
),
activeContent: <PaypalActivePaymentMethod />,
canMakePayment: Promise.resolve( true ),
ariaLabel: 'paypal payment method',
};
Expand All @@ -21,11 +33,7 @@ export const ccPaymentMethod = {
id: 'cc',
label: <img src={ ccSvg } alt="" />,
stepContent: null,
activeContent: (
<div>
<p>This is where cc payment method stuff would be.</p>
</div>
),
activeContent: <CreditCardActivePaymentMethod />,
canMakePayment: Promise.resolve( true ),
ariaLabel: 'credit-card-payment-method',
};

0 comments on commit 2245022

Please sign in to comment.