diff --git a/assets/images/payment-method-icons/affirm.svg b/assets/images/payment-method-icons/affirm.svg new file mode 100644 index 00000000000..142ddff5361 --- /dev/null +++ b/assets/images/payment-method-icons/affirm.svg @@ -0,0 +1 @@ + diff --git a/assets/images/payment-method-icons/afterpay.svg b/assets/images/payment-method-icons/afterpay.svg new file mode 100644 index 00000000000..d61125e3b66 --- /dev/null +++ b/assets/images/payment-method-icons/afterpay.svg @@ -0,0 +1,21 @@ + diff --git a/assets/images/payment-method-icons/amex.svg b/assets/images/payment-method-icons/amex.svg new file mode 100644 index 00000000000..f476392e52a --- /dev/null +++ b/assets/images/payment-method-icons/amex.svg @@ -0,0 +1,20 @@ + diff --git a/assets/images/payment-method-icons/applepay.svg b/assets/images/payment-method-icons/applepay.svg new file mode 100644 index 00000000000..c0d1dc61af3 --- /dev/null +++ b/assets/images/payment-method-icons/applepay.svg @@ -0,0 +1 @@ + diff --git a/assets/images/payment-method-icons/discover.svg b/assets/images/payment-method-icons/discover.svg new file mode 100644 index 00000000000..7f7a66af36f --- /dev/null +++ b/assets/images/payment-method-icons/discover.svg @@ -0,0 +1 @@ + diff --git a/assets/images/payment-method-icons/gpay.svg b/assets/images/payment-method-icons/gpay.svg new file mode 100644 index 00000000000..e70aae5d46c --- /dev/null +++ b/assets/images/payment-method-icons/gpay.svg @@ -0,0 +1 @@ + diff --git a/assets/images/payment-method-icons/jcb.svg b/assets/images/payment-method-icons/jcb.svg new file mode 100644 index 00000000000..697c616c071 --- /dev/null +++ b/assets/images/payment-method-icons/jcb.svg @@ -0,0 +1 @@ + diff --git a/assets/images/payment-method-icons/klarna.svg b/assets/images/payment-method-icons/klarna.svg new file mode 100644 index 00000000000..27151a76668 --- /dev/null +++ b/assets/images/payment-method-icons/klarna.svg @@ -0,0 +1,15 @@ + diff --git a/assets/images/payment-method-icons/mastercard.svg b/assets/images/payment-method-icons/mastercard.svg new file mode 100644 index 00000000000..c8c61efb07f --- /dev/null +++ b/assets/images/payment-method-icons/mastercard.svg @@ -0,0 +1 @@ + diff --git a/assets/images/payment-method-icons/visa.svg b/assets/images/payment-method-icons/visa.svg new file mode 100644 index 00000000000..ffcf787ed7c --- /dev/null +++ b/assets/images/payment-method-icons/visa.svg @@ -0,0 +1 @@ + diff --git a/assets/images/payment-method-icons/woopay.svg b/assets/images/payment-method-icons/woopay.svg new file mode 100644 index 00000000000..3617507266d --- /dev/null +++ b/assets/images/payment-method-icons/woopay.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/changelog/add-8808-woo-payment-method-logo b/changelog/add-8808-woo-payment-method-logo new file mode 100644 index 00000000000..30c7a1d340f --- /dev/null +++ b/changelog/add-8808-woo-payment-method-logo @@ -0,0 +1,4 @@ +Significance: minor +Type: add + +Add the new payment method logos to the connect page. diff --git a/client/components/payment-method-logos/index.tsx b/client/components/payment-method-logos/index.tsx new file mode 100644 index 00000000000..06c5b35d9f4 --- /dev/null +++ b/client/components/payment-method-logos/index.tsx @@ -0,0 +1,113 @@ +/** + * External dependencies + */ +import React, { useState, useEffect } from 'react'; + +/** + * Internal dependencies + */ +import Visa from 'assets/images/payment-method-icons/visa.svg?asset'; +import Mastercard from 'assets/images/payment-method-icons/mastercard.svg?asset'; +import Amex from 'assets/images/payment-method-icons/amex.svg?asset'; +import Discover from 'assets/images/payment-method-icons/discover.svg?asset'; +import WooPay from 'assets/images/payment-method-icons/woopay.svg?asset'; +import ApplePay from 'assets/images/payment-method-icons/applepay.svg?asset'; +import AfterPay from 'assets/images/payment-method-icons/afterpay.svg?asset'; +import Affirm from 'assets/images/payment-method-icons/affirm.svg?asset'; +import Klarna from 'assets/images/payment-method-icons/klarna.svg?asset'; +import Jcb from 'assets/images/payment-method-icons/jcb.svg?asset'; +import GooglePay from 'assets/images/payment-method-icons/gpay.svg?asset'; + +import './style.scss'; + +const PaymentMethods = [ + { + name: 'visa', + component: Visa, + }, + { + name: 'mastercard', + component: Mastercard, + }, + { + name: 'amex', + component: Amex, + }, + { + name: 'discover', + component: Discover, + }, + { + name: 'woopay', + component: WooPay, + }, + { + name: 'applepay', + component: ApplePay, + }, + { + name: 'googlepay', + component: GooglePay, + }, + { + name: 'afterpay', + component: AfterPay, + }, + { + name: 'affirm', + component: Affirm, + }, + { + name: 'klarna', + component: Klarna, + }, + { + name: 'jcb', + component: Jcb, + }, +]; + +export const WooPaymentMethodsLogos: React.VFC< { + maxElements: number; +} > = ( { maxElements = 10 } ) => { + const totalPaymentMethods = 20; + const [ maxShownElements, setMaxShownElements ] = useState( maxElements ); + + useEffect( () => { + const updateMaxElements = () => { + if ( window.innerWidth <= 480 ) { + setMaxShownElements( 5 ); + } else if ( window.innerWidth <= 768 ) { + setMaxShownElements( 7 ); + } else { + setMaxShownElements( maxElements ); + } + }; + + updateMaxElements(); + window.addEventListener( 'resize', updateMaxElements ); + }, [ maxElements ] ); + + return ( + <> +
Deposits
diff --git a/client/connect-account-page/payment-methods.tsx b/client/connect-account-page/payment-methods.tsx deleted file mode 100644 index f82adcff7a3..00000000000 --- a/client/connect-account-page/payment-methods.tsx +++ /dev/null @@ -1,53 +0,0 @@ -/** - * External dependencies - */ -import React from 'react'; - -/** - * Internal dependencies - */ - -import './style.scss'; -import { - AffirmIcon, - AfterpayIcon, - ClearpayIcon, - AmericanExpressIcon, - ApplePayIcon, - CBIcon, - IdealIcon, - DiscoverIcon, - GooglePayIcon, - MastercardIcon, - VisaIcon, - WooIcon, - KlarnaIcon, -} from 'wcpay/payment-methods-icons'; - -const PaymentMethods: React.FC = () => { - return ( - <> -