From f3d5c56663fa7d44c09cd56c3ef8fe3a2c433400 Mon Sep 17 00:00:00 2001 From: Narek Zakarian Date: Tue, 26 Nov 2024 15:01:21 +0400 Subject: [PATCH] Fix the lint --- .../Components/ReusableComponents/BadgeBox.js | 70 +- .../WelcomeDocs/AcdcFlow.js | 813 +++++++++++------- .../WelcomeDocs/BcdcFlow.js | 372 ++++---- .../WelcomeDocs/WelcomeDocs.js | 231 ++--- .../resources/js/utils/badgeBoxUtils.js | 22 +- 5 files changed, 888 insertions(+), 620 deletions(-) diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/BadgeBox.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/BadgeBox.js index 83ebcaa76..5a257b22e 100644 --- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/BadgeBox.js +++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/BadgeBox.js @@ -1,39 +1,53 @@ import data from '../../utils/data'; -import TitleBadge, { TITLE_BADGE_INFO } from "./TitleBadge"; -import { __ } from "@wordpress/i18n"; +import TitleBadge, { TITLE_BADGE_INFO } from './TitleBadge'; +import { __ } from '@wordpress/i18n'; const BadgeBox = ( props ) => { - const titleSize = props.titleType && props.titleType === BADGE_BOX_TITLE_BIG ? BADGE_BOX_TITLE_BIG : BADGE_BOX_TITLE_SMALL + const titleSize = + props.titleType && props.titleType === BADGE_BOX_TITLE_BIG + ? BADGE_BOX_TITLE_BIG + : BADGE_BOX_TITLE_SMALL; - const titleTextClassName = 'ppcp-r-badge-box__title-text ' + `ppcp-r-badge-box__title-text--${ titleSize }`; + const titleTextClassName = + 'ppcp-r-badge-box__title-text ' + + `ppcp-r-badge-box__title-text--${ titleSize }`; - const titleBaseClassName = 'ppcp-r-badge-box__title'; - const titleClassName = props.imageBadge ? `${ titleBaseClassName } ppcp-r-badge-box__title--has-image-badge` : titleBaseClassName; + const titleBaseClassName = 'ppcp-r-badge-box__title'; + const titleClassName = props.imageBadge + ? `${ titleBaseClassName } ppcp-r-badge-box__title--has-image-badge` + : titleBaseClassName; return ( -
- - {props.title} +
+ + { props.title } - { props.imageBadge && ( - - { props.imageBadge.map( ( badge ) => data().getImage( badge ) ) } - - ) } + { props.imageBadge && ( + + { props.imageBadge.map( ( badge ) => + data().getImage( badge ) + ) } + + ) } - { props.textBadge && ( - - ) } - -
- { props?.description && ( -

- ) } -
-
- ); + { props.textBadge && ( + + ) } +
+
+ { props?.description && ( +

+ ) } +
+
+ ); }; export const BADGE_BOX_TITLE_BIG = 'big'; diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/WelcomeDocs/AcdcFlow.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/WelcomeDocs/AcdcFlow.js index 612fd32d5..5f713b3ee 100644 --- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/WelcomeDocs/AcdcFlow.js +++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/WelcomeDocs/AcdcFlow.js @@ -1,328 +1,503 @@ -import BadgeBox, { BADGE_BOX_TITLE_BIG } from "../BadgeBox"; +import BadgeBox, { BADGE_BOX_TITLE_BIG } from '../BadgeBox'; import { __, sprintf } from '@wordpress/i18n'; import Separator from '../Separator'; import generatePriceText from '../../../utils/badgeBoxUtils'; -const AcdcFlow = ( { isFastlane, isPayLater, storeCountry, storeCurrency, countryPriceInfo } ) => { - if (isFastlane && isPayLater && storeCountry === 'us') { - return ( -
-
- 1', 'woocommerce-paypal-payments')} - description={__( - 'Our all-in-one checkout solution lets you offer PayPal, Venmo, Pay Later options, and more to help maximise conversion', - 'woocommerce-paypal-payments' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> -
-
- - 1', 'woocommerce-paypal-payments')} - description={sprintf( - // translators: %s: Link to PayPal business fees guide - __( - 'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection. Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> - - 1', 'woocommerce-paypal-payments')} - description={sprintf( - // translators: %s: Link to PayPal business fees guide - __( - 'Accept Apple Pay on eligible devices and Google Pay through mobile and web. Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> - - 1', 'woocommerce-paypal-payments')} - description={sprintf( - // translators: %s: Link to PayPal business fees guide - __( - 'Seamless payments for customers across the globe using their preferred payment methods. Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> - - 1', 'woocommerce-paypal-payments')} - description={sprintf( - // translators: %s: Link to PayPal business fees guide - __( - 'Speed up guest checkout with Fatslane. Link a customer\'s email address to their payment details. Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> -
-
- ); - } +const AcdcFlow = ( { + isFastlane, + isPayLater, + storeCountry, + storeCurrency, + countryPriceInfo, +} ) => { + if ( isFastlane && isPayLater && storeCountry === 'us' ) { + return ( +
+
+ 1', + 'woocommerce-paypal-payments' + ) } + description={ __( + 'Our all-in-one checkout solution lets you offer PayPal, Venmo, Pay Later options, and more to help maximise conversion', + 'woocommerce-paypal-payments' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> +
+
+ + 1', + 'woocommerce-paypal-payments' + ) } + description={ sprintf( + // translators: %s: Link to PayPal business fees guide + __( + 'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection. Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> + + 1', + 'woocommerce-paypal-payments' + ) } + description={ sprintf( + // translators: %s: Link to PayPal business fees guide + __( + 'Accept Apple Pay on eligible devices and Google Pay through mobile and web. Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> + + 1', + 'woocommerce-paypal-payments' + ) } + description={ sprintf( + // translators: %s: Link to PayPal business fees guide + __( + 'Seamless payments for customers across the globe using their preferred payment methods. Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> + + 1', + 'woocommerce-paypal-payments' + ) } + description={ sprintf( + // translators: %s: Link to PayPal business fees guide + __( + 'Speed up guest checkout with Fatslane. Link a customer\'s email address to their payment details. Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> +
+
+ ); + } - if (isPayLater && storeCountry === 'uk') { - return ( -
-
- 1', 'woocommerce-paypal-payments')} - description={__( - 'Our all-in-one checkout solution lets you offer PayPal, Venmo, Pay Later options, and more to help maximise conversion', - 'woocommerce-paypal-payments' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' - )} - /> -
-
- - 1', 'woocommerce-paypal-payments')} - description={sprintf( - // translators: %s: Link to PayPal business fees guide - __( - 'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection. Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> - - 1', 'woocommerce-paypal-payments')} - description={sprintf( - // translators: %s: Link to PayPal business fees guide - __( - 'Accept Apple Pay on eligible devices and Google Pay through mobile and web. Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> - - 1', 'woocommerce-paypal-payments')} - description={sprintf( - // translators: %s: Link to PayPal business fees guide - __( - 'Seamless payments for customers across the globe using their preferred payment methods. Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> -
-
- ); - } + if ( isPayLater && storeCountry === 'uk' ) { + return ( +
+
+ 1', + 'woocommerce-paypal-payments' + ) } + description={ __( + 'Our all-in-one checkout solution lets you offer PayPal, Venmo, Pay Later options, and more to help maximise conversion', + 'woocommerce-paypal-payments' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' + ) } + /> +
+
+ + 1', + 'woocommerce-paypal-payments' + ) } + description={ sprintf( + // translators: %s: Link to PayPal business fees guide + __( + 'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection. Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> + + 1', + 'woocommerce-paypal-payments' + ) } + description={ sprintf( + // translators: %s: Link to PayPal business fees guide + __( + 'Accept Apple Pay on eligible devices and Google Pay through mobile and web. Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> + + 1', + 'woocommerce-paypal-payments' + ) } + description={ sprintf( + // translators: %s: Link to PayPal business fees guide + __( + 'Seamless payments for customers across the globe using their preferred payment methods. Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> +
+
+ ); + } - return ( -
-
- - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' - )} - /> -
-
- - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://www.paypal.com/us/business/paypal-business-fees' - )} - /> -
-
- ); + return ( +
+
+ + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' + ) } + /> +
+
+ + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://www.paypal.com/us/business/paypal-business-fees' + ) } + /> +
+
+ ); }; export default AcdcFlow; diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/WelcomeDocs/BcdcFlow.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/WelcomeDocs/BcdcFlow.js index c551ce881..e82118b44 100644 --- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/WelcomeDocs/BcdcFlow.js +++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/WelcomeDocs/BcdcFlow.js @@ -1,161 +1,227 @@ -import BadgeBox, { BADGE_BOX_TITLE_BIG } from "../BadgeBox"; +import BadgeBox, { BADGE_BOX_TITLE_BIG } from '../BadgeBox'; import { __, sprintf } from '@wordpress/i18n'; import Separator from '../Separator'; import generatePriceText from '../../../utils/badgeBoxUtils'; -const BcdcFlow = ( { isPayLater, storeCountry, storeCurrency, countryPriceInfo } ) => { - if (isPayLater && storeCountry === 'us') { - return ( -
-
- 1', 'woocommerce-paypal-payments')} - description={__( - 'Our all-in-one checkout solution lets you offer PayPal, Venmo, Pay Later options, and more to help maximise conversion', - 'woocommerce-paypal-payments' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' - )} - /> -
-
- - 1', 'woocommerce-paypal-payments')} - description={sprintf( - // translators: %s: Link to PayPal REST application guide - __( - 'Process major credit and debit cards through PayPal’s card fields. Learn more', - 'woocommerce-paypal-payments' - ), - 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' - )} - /> -
-
- ); - } +const BcdcFlow = ( { + isPayLater, + storeCountry, + storeCurrency, + countryPriceInfo, +} ) => { + if ( isPayLater && storeCountry === 'us' ) { + return ( +
+
+ 1', + 'woocommerce-paypal-payments' + ) } + description={ __( + 'Our all-in-one checkout solution lets you offer PayPal, Venmo, Pay Later options, and more to help maximise conversion', + 'woocommerce-paypal-payments' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' + ) } + /> +
+
+ + 1', + 'woocommerce-paypal-payments' + ) } + description={ sprintf( + // translators: %s: Link to PayPal REST application guide + __( + 'Process major credit and debit cards through PayPal’s card fields. Learn more', + 'woocommerce-paypal-payments' + ), + 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' + ) } + /> +
+
+ ); + } - return ( -
- - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' - )} - /> - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' - )} - /> - - - Learn more', - 'woocommerce-paypal-payments' - ), - 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' - )} - /> -
- ); + return ( +
+ + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' + ) } + /> + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' + ) } + /> + + + Learn more', + 'woocommerce-paypal-payments' + ), + 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' + ) } + /> +
+ ); }; export default BcdcFlow; diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/WelcomeDocs/WelcomeDocs.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/WelcomeDocs/WelcomeDocs.js index a05dcb0d1..a8c905026 100644 --- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/WelcomeDocs/WelcomeDocs.js +++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/WelcomeDocs/WelcomeDocs.js @@ -1,116 +1,129 @@ import { __, sprintf } from '@wordpress/i18n'; -import AcdcFlow from "./AcdcFlow"; -import BcdcFlow from "./BcdcFlow"; -import {Button} from "@wordpress/components"; +import AcdcFlow from './AcdcFlow'; +import BcdcFlow from './BcdcFlow'; +import { Button } from '@wordpress/components'; -const WelcomeDocs = ( { useAcdc, isFastlane, isPayLater, storeCountry, storeCurrency } ) => { - const pricesBasedDescription = sprintf( - // translators: %s: Link to PayPal REST application guide - __( - '1Prices based on domestic transactions as of October 25th, 2024. Click here for full pricing details.', - 'woocommerce-paypal-payments' - ), - 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' - ); +const WelcomeDocs = ( { + useAcdc, + isFastlane, + isPayLater, + storeCountry, + storeCurrency, +} ) => { + const pricesBasedDescription = sprintf( + // translators: %s: Link to PayPal REST application guide + __( + '1Prices based on domestic transactions as of October 25th, 2024. Click here for full pricing details.', + 'woocommerce-paypal-payments' + ), + 'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input ' + ); - const countryPriceInfo = { - "us" : { - "currencySymbol" : "$", - "fixedFee" : 0.49, - "checkout" : 3.49, - "ccf" : 2.59, - "dw" : 2.59, - "apm" : 2.59, - "standardCardFields" : 2.99, - }, - "uk" : { - "currencySymbol" : "£", - "fixedFee" : 0.30, - "checkout" : 2.90, - "ccf" : 1.20, - "dw" : 1.20, - "apm" : 1.20, - "standardCardFields" : 1.20, - }, - "ca" : { - "currencySymbol" : "$", - "fixedFee" : 0.30, - "checkout" : 2.90, - "ccf" : 2.70, - "dw" : 2.70, - "apm" : 2.90, - "standardCardFields" : 2.90, - }, - "au" : { - "currencySymbol" : "$", - "fixedFee" : 0.30, - "checkout" : 2.60, - "ccf" : 1.75, - "dw" : 1.75, - "apm" : 2.60, - "standardCardFields" : 2.60, - }, - "fr" : { - "currencySymbol" : "€", - "fixedFee" : 0.35, - "checkout" : 2.90, - "ccf" : 1.20, - "dw" : 1.20, - "apm" : 1.20, - "standardCardFields" : 1.20, - }, - "it" : { - "currencySymbol" : "€", - "fixedFee" : 0.35, - "checkout" : 3.40, - "ccf" : 1.20, - "dw" : 1.20, - "apm" : 1.20, - "standardCardFields" : 1.20, - }, - "de" : { - "currencySymbol" : "€", - "fixedFee" : 0.39, - "checkout" : 2.99, - "ccf" : 2.99, - "dw" : 2.99, - "apm" : 2.99, - "standardCardFields" : 2.99, - }, - "es" : { - "currencySymbol" : "€", - "fixedFee" : 0.35, - "checkout" : 2.90, - "ccf" : 1.20, - "dw" : 1.20, - "apm" : 1.20, - "standardCardFields" : 1.20, - } - } + const countryPriceInfo = { + us: { + currencySymbol: '$', + fixedFee: 0.49, + checkout: 3.49, + ccf: 2.59, + dw: 2.59, + apm: 2.59, + standardCardFields: 2.99, + }, + uk: { + currencySymbol: '£', + fixedFee: 0.3, + checkout: 2.9, + ccf: 1.2, + dw: 1.2, + apm: 1.2, + standardCardFields: 1.2, + }, + ca: { + currencySymbol: '$', + fixedFee: 0.3, + checkout: 2.9, + ccf: 2.7, + dw: 2.7, + apm: 2.9, + standardCardFields: 2.9, + }, + au: { + currencySymbol: '$', + fixedFee: 0.3, + checkout: 2.6, + ccf: 1.75, + dw: 1.75, + apm: 2.6, + standardCardFields: 2.6, + }, + fr: { + currencySymbol: '€', + fixedFee: 0.35, + checkout: 2.9, + ccf: 1.2, + dw: 1.2, + apm: 1.2, + standardCardFields: 1.2, + }, + it: { + currencySymbol: '€', + fixedFee: 0.35, + checkout: 3.4, + ccf: 1.2, + dw: 1.2, + apm: 1.2, + standardCardFields: 1.2, + }, + de: { + currencySymbol: '€', + fixedFee: 0.39, + checkout: 2.99, + ccf: 2.99, + dw: 2.99, + apm: 2.99, + standardCardFields: 2.99, + }, + es: { + currencySymbol: '€', + fixedFee: 0.35, + checkout: 2.9, + ccf: 1.2, + dw: 1.2, + apm: 1.2, + standardCardFields: 1.2, + }, + }; - return ( -
-

{__(`Want to know more about PayPal Payments?`, 'woocommerce-paypal-payments')}

- {useAcdc ? ( - - ) : ( - - )} -

-
- ); + return ( +
+

+ { __( + `Want to know more about PayPal Payments?`, + 'woocommerce-paypal-payments' + ) } +

+ { useAcdc ? ( + + ) : ( + + ) } +

+
+ ); }; export default WelcomeDocs; diff --git a/modules/ppcp-settings/resources/js/utils/badgeBoxUtils.js b/modules/ppcp-settings/resources/js/utils/badgeBoxUtils.js index 67af5031c..60c4da274 100644 --- a/modules/ppcp-settings/resources/js/utils/badgeBoxUtils.js +++ b/modules/ppcp-settings/resources/js/utils/badgeBoxUtils.js @@ -1,18 +1,18 @@ import { __ } from '@wordpress/i18n'; -const generatePriceText = (type, selectedCountryPrice, storeCurrency) => { - if (!selectedCountryPrice || !selectedCountryPrice[type]) { - console.warn(`Invalid type or price data for: ${type}`); - return ''; - } +const generatePriceText = ( type, selectedCountryPrice, storeCurrency ) => { + if ( ! selectedCountryPrice || ! selectedCountryPrice[ type ] ) { + console.warn( `Invalid type or price data for: ${ type }` ); + return ''; + } - const percentage = selectedCountryPrice[type].toFixed(2); - const fixedFee = `${selectedCountryPrice.currencySymbol}${selectedCountryPrice.fixedFee}`; + const percentage = selectedCountryPrice[ type ].toFixed( 2 ); + const fixedFee = `${ selectedCountryPrice.currencySymbol }${ selectedCountryPrice.fixedFee }`; - return __( - `from ${percentage}% + ${fixedFee} ${storeCurrency}1`, - 'woocommerce-paypal-payments' - ); + return __( + `from ${ percentage }% + ${ fixedFee } ${ storeCurrency }1`, + 'woocommerce-paypal-payments' + ); }; export default generatePriceText;