mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Update option name and labels
This commit is contained in:
parent
b540db4954
commit
55c4a214f5
7 changed files with 24 additions and 27 deletions
|
@ -4,25 +4,22 @@ import { ControlToggleButton } from '../../../../../ReusableComponents/Controls'
|
|||
import { SettingsHooks } from '../../../../../../data';
|
||||
import SettingsBlock from '../../../../../ReusableComponents/SettingsBlock';
|
||||
|
||||
const KeepUpdated = () => {
|
||||
const { keepUpdated, setKeepUpdated } = SettingsHooks.useSettings();
|
||||
const StayUpdated = () => {
|
||||
const { stayUpdated, setStayUpdated } = SettingsHooks.useSettings();
|
||||
|
||||
return (
|
||||
<SettingsBlock className="ppcp--pay-now-experience">
|
||||
<ControlToggleButton
|
||||
label={ __(
|
||||
'Keep updated with PayPal',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
label={ __( 'Stay Updated', 'woocommerce-paypal-payments' ) }
|
||||
description={ __(
|
||||
'Receive updates on PayPal features, promotions, and news.',
|
||||
'Get the latest PayPal features and capabilities as they are released. When the extension is updated, new features, payment methods, styling options, and more will automatically update.',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
onChange={ setKeepUpdated }
|
||||
value={ keepUpdated }
|
||||
onChange={ setStayUpdated }
|
||||
value={ stayUpdated }
|
||||
/>
|
||||
</SettingsBlock>
|
||||
);
|
||||
};
|
||||
|
||||
export default KeepUpdated;
|
||||
export default StayUpdated;
|
|
@ -5,7 +5,7 @@ import OrderIntent from './Blocks/OrderIntent';
|
|||
import SavePaymentMethods from './Blocks/SavePaymentMethods';
|
||||
import InvoicePrefix from './Blocks/InvoicePrefix';
|
||||
import PayNowExperience from './Blocks/PayNowExperience';
|
||||
import KeepUpdated from './Blocks/KeepUpdated';
|
||||
import StayUpdated from './Blocks/StayUpdated';
|
||||
|
||||
const CommonSettings = ( { ownBradOnly } ) => (
|
||||
<SettingsCard
|
||||
|
@ -21,7 +21,7 @@ const CommonSettings = ( { ownBradOnly } ) => (
|
|||
<OrderIntent />
|
||||
<SavePaymentMethods ownBradOnly={ ownBradOnly } />
|
||||
<PayNowExperience />
|
||||
<KeepUpdated />
|
||||
<StayUpdated />
|
||||
</SettingsCard>
|
||||
);
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ const useHooks = () => {
|
|||
const [ payNowExperience, setPayNowExperience ] =
|
||||
usePersistent( 'enablePayNow' );
|
||||
const [ logging, setLogging ] = usePersistent( 'enableLogging' );
|
||||
const [ keepUpdated, setKeepUpdated ] = usePersistent( 'keepUpdated' );
|
||||
const [ stayUpdated, setStayUpdated ] = usePersistent( 'stayUpdated' );
|
||||
|
||||
const [ disabledCards, setDisabledCards ] =
|
||||
usePersistent( 'disabledCards' );
|
||||
|
@ -83,8 +83,8 @@ const useHooks = () => {
|
|||
setPayNowExperience,
|
||||
logging,
|
||||
setLogging,
|
||||
keepUpdated,
|
||||
setKeepUpdated,
|
||||
stayUpdated,
|
||||
setStayUpdated,
|
||||
subtotalAdjustment,
|
||||
setSubtotalAdjustment,
|
||||
brandName,
|
||||
|
@ -129,8 +129,8 @@ export const useSettings = () => {
|
|||
setPayNowExperience,
|
||||
logging,
|
||||
setLogging,
|
||||
keepUpdated,
|
||||
setKeepUpdated,
|
||||
stayUpdated,
|
||||
setStayUpdated,
|
||||
subtotalAdjustment,
|
||||
setSubtotalAdjustment,
|
||||
brandName,
|
||||
|
@ -160,8 +160,8 @@ export const useSettings = () => {
|
|||
setPayNowExperience,
|
||||
logging,
|
||||
setLogging,
|
||||
keepUpdated,
|
||||
setKeepUpdated,
|
||||
stayUpdated,
|
||||
setStayUpdated,
|
||||
subtotalAdjustment,
|
||||
setSubtotalAdjustment,
|
||||
brandName,
|
||||
|
|
|
@ -42,7 +42,7 @@ const defaultPersistent = Object.freeze( {
|
|||
saveCardDetails: false, // Enable card vaulting
|
||||
enablePayNow: false, // Enable Pay Now experience
|
||||
enableLogging: false, // Enable debug logging
|
||||
keepUpdated: false, // Enable to receive PayPal-related updates
|
||||
stayUpdated: false, // Enable to get the latest PayPal features
|
||||
|
||||
// String arrays.
|
||||
disabledCards: [], // Disabled credit card types
|
||||
|
|
|
@ -82,7 +82,7 @@ class SettingsModel extends AbstractDataModel {
|
|||
'save_card_details' => false,
|
||||
'enable_pay_now' => false,
|
||||
'enable_logging' => false,
|
||||
'keep_updated' => true,
|
||||
'stay_updated' => true,
|
||||
|
||||
// Array of string values.
|
||||
'disabled_cards' => array(),
|
||||
|
|
|
@ -86,8 +86,8 @@ class SettingsRestEndpoint extends RestEndpoint {
|
|||
'js_name' => 'enableLogging',
|
||||
'sanitize' => 'to_boolean',
|
||||
),
|
||||
'keep_updated' => array(
|
||||
'js_name' => 'keepUpdated',
|
||||
'stay_updated' => array(
|
||||
'js_name' => 'stayUpdated',
|
||||
'sanitize' => 'to_boolean',
|
||||
),
|
||||
'disabled_cards' => array(
|
||||
|
|
|
@ -539,12 +539,12 @@ return function ( ContainerInterface $container, array $fields ): array {
|
|||
'requirements' => array(),
|
||||
'gateway' => Settings::CONNECTION_TAB_ID,
|
||||
),
|
||||
'keep_updated' => array(
|
||||
'title' => __( 'Keep updated with PayPal', 'woocommerce-paypal-payments' ),
|
||||
'stay_updated' => array(
|
||||
'title' => __( 'Stay Updated', 'woocommerce-paypal-payments' ),
|
||||
'type' => 'checkbox',
|
||||
'desc_tip' => true,
|
||||
'label' => __( 'Keep updated with PayPal. ', 'woocommerce-paypal-payments' ),
|
||||
'description' => __( 'Receive updates on PayPal features, promotions, and news.', 'woocommerce-paypal-payments' ),
|
||||
'label' => __( 'Update to the latest features when available. ', 'woocommerce-paypal-payments' ),
|
||||
'description' => __( 'Get the latest PayPal features and capabilities as they are released. When the extension is updated, new features, payment methods, styling options, and more will automatically update.', 'woocommerce-paypal-payments' ),
|
||||
'default' => true,
|
||||
'screens' => array(
|
||||
State::STATE_START,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue