Skip to content

Commit

Permalink
show all available ECE buttons in settins preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristófer R committed Jul 6, 2024
1 parent 6b3c136 commit f05a885
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { useState, useMemo } from 'react';
import { useState } from 'react';
import { Elements, ExpressCheckoutElement } from '@stripe/react-stripe-js';
import { __ } from '@wordpress/i18n';

Expand Down Expand Up @@ -50,12 +50,6 @@ export const ExpressCheckoutPreviewComponent = ( {

const type = buttonType === 'default' ? 'plain' : buttonType;

const shouldOnlyShowApplePay = useMemo(
() =>
window.ApplePaySession && window.ApplePaySession.canMakePayments(),
[]
);

const buttonOptions = {
buttonHeight: Math.min( Math.max( height, 40 ), 55 ),
buttonTheme: {
Expand All @@ -68,8 +62,8 @@ export const ExpressCheckoutPreviewComponent = ( {
},
paymentMethods: {
link: 'never',
googlePay: shouldOnlyShowApplePay ? 'never' : 'always',
applePay: shouldOnlyShowApplePay ? 'always' : 'never',
googlePay: 'always',
applePay: 'always',
},
layout: { maxColumns: 1, overflow: 'never' },
};
Expand Down

0 comments on commit f05a885

Please sign in to comment.