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

Fix errors caused by demo payment methods #1547

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
};