mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
♻️ Extract price description to custom component
This commit is contained in:
parent
e59ae23c43
commit
561f71f0b5
3 changed files with 31 additions and 20 deletions
|
@ -0,0 +1,27 @@
|
|||
import { __, sprintf } from '@wordpress/i18n';
|
||||
|
||||
import { countryPriceInfo } from '../../utils/countryPriceInfo';
|
||||
|
||||
const PricingDescription = ( { country } ) => {
|
||||
if ( ! countryPriceInfo[ country ] ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const label = sprintf(
|
||||
// translators: %s: Link to PayPal REST application guide
|
||||
__(
|
||||
'<sup>1</sup>Prices based on domestic transactions as of October 25th, 2024. <a target="_blank" href="%s">Click here</a> for full pricing details.',
|
||||
'woocommerce-paypal-payments'
|
||||
),
|
||||
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input'
|
||||
);
|
||||
|
||||
return (
|
||||
<p
|
||||
className="ppcp-r-optional-payment-methods__description"
|
||||
dangerouslySetInnerHTML={ { __html: label } }
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default PricingDescription;
|
|
@ -1,9 +1,8 @@
|
|||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
import { countryPriceInfo } from '../../../utils/countryPriceInfo';
|
||||
import PricingDescription from '../PricingDescription';
|
||||
import AcdcFlow from './AcdcFlow';
|
||||
import BcdcFlow from './BcdcFlow';
|
||||
import { pricesBasedDescription } from './pricesBasedDescription';
|
||||
|
||||
const WelcomeDocs = ( {
|
||||
useAcdc,
|
||||
|
@ -34,14 +33,7 @@ const WelcomeDocs = ( {
|
|||
storeCurrency={ storeCurrency }
|
||||
/>
|
||||
) }
|
||||
{ storeCountry in countryPriceInfo && (
|
||||
<p
|
||||
className="ppcp-r-optional-payment-methods__description"
|
||||
dangerouslySetInnerHTML={ {
|
||||
__html: pricesBasedDescription,
|
||||
} }
|
||||
></p>
|
||||
) }
|
||||
<PricingDescription country={ storeCountry } />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -5,8 +5,7 @@ import SelectBoxWrapper from '../../ReusableComponents/SelectBoxWrapper';
|
|||
import SelectBox from '../../ReusableComponents/SelectBox';
|
||||
import { CommonHooks, OnboardingHooks } from '../../../data';
|
||||
import OptionalPaymentMethods from '../../ReusableComponents/OptionalPaymentMethods/OptionalPaymentMethods';
|
||||
import { pricesBasedDescription } from '../../ReusableComponents/WelcomeDocs/pricesBasedDescription';
|
||||
import { countryPriceInfo } from '../../../utils/countryPriceInfo';
|
||||
import PricingDescription from '../../ReusableComponents/PricingDescription';
|
||||
|
||||
const OPM_RADIO_GROUP_NAME = 'optional-payment-methods';
|
||||
|
||||
|
@ -60,14 +59,7 @@ const StepPaymentMethods = ( {} ) => {
|
|||
type="radio"
|
||||
></SelectBox>
|
||||
</SelectBoxWrapper>
|
||||
{ storeCountry in countryPriceInfo && (
|
||||
<p
|
||||
className="ppcp-r-optional-payment-methods__description"
|
||||
dangerouslySetInnerHTML={ {
|
||||
__html: pricesBasedDescription,
|
||||
} }
|
||||
></p>
|
||||
) }
|
||||
<PricingDescription country={ storeCountry } />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue