Update option name and labels

This commit is contained in:
Himad M 2025-05-30 15:23:03 -04:00
parent b540db4954
commit 55c4a214f5
No known key found for this signature in database
GPG key ID: 5FC769E9888A7B98
7 changed files with 24 additions and 27 deletions

View file

@ -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;

View file

@ -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>
);

View file

@ -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,

View file

@ -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

View file

@ -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(),

View file

@ -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(

View file

@ -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,