-
-
+
+
+
-
- { props.description && (
+
+ { description && (
) }
- { props?.toggleAdditionalContent &&
- props.children &&
- props.value === props.currentValue && (
-
- { props.children }
-
- ) }
+ { toggleAdditionalContent && children && value === currentValue && (
+
+ { children }
+
+ ) }
);
};
-
-export const handleCheckboxState = ( checked, props ) => {
- let newValue = null;
- if ( ! Array.isArray( props.currentValue ) ) {
- newValue = checked;
- } else if ( checked ) {
- newValue = [ ...props.currentValue, props.value ];
- } else {
- newValue = props.currentValue.filter(
- ( value ) => value !== props.value
- );
- }
- props.changeCallback( newValue );
-};
diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/HStack.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/HStack.js
new file mode 100644
index 000000000..2c54ac7da
--- /dev/null
+++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/HStack.js
@@ -0,0 +1,26 @@
+/**
+ * Temporary component, until the experimental HStack block editor component is stable.
+ *
+ * @see https://wordpress.github.io/gutenberg/?path=/docs/components-experimental-hstack--docs
+ * @file
+ */
+import classNames from 'classnames';
+
+const HStack = ( { className, spacing = 3, children } ) => {
+ const wrapperClass = classNames(
+ 'components-flex components-h-stack',
+ className
+ );
+
+ const styles = {
+ gap: `calc(${ 4 * spacing }px)`,
+ };
+
+ return (
+
+ { children }
+
+ );
+};
+
+export default HStack;
diff --git a/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Styling/SettingsPanel.js b/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Styling/SettingsPanel.js
index e739ab629..f357bb287 100644
--- a/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Styling/SettingsPanel.js
+++ b/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Styling/SettingsPanel.js
@@ -4,7 +4,8 @@ import { RadioControl, SelectControl } from '@wordpress/components';
// Dummy hook.
import { useStylingLocation, useStylingProps } from '../../Tabs/TabStyling';
-import { PayPalCheckboxGroup } from '../../../../ReusableComponents/Fields';
+import { CheckboxGroup } from '../../../../ReusableComponents/Fields';
+import HStack from '../../../../ReusableComponents/HStack';
import LocationSelector from './LocationSelector';
import StylingSection from './StylingSection';
@@ -30,6 +31,7 @@ const SettingsPanel = () => {
export default SettingsPanel;
// -----
+
const SectionPaymentMethods = ( { location } ) => {
const { paymentMethods, setPaymentMethods, paymentMethodChoices } =
useStylingProps( location );
@@ -39,11 +41,13 @@ const SectionPaymentMethods = ( { location } ) => {
title={ __( 'Payment Methods', 'woocommerce-paypal-payments' ) }
className="payment-methods"
>
-
+
+
+
);
};
@@ -61,12 +65,13 @@ const SectionButtonLayout = ( { location } ) => {
className="button-layout"
title={ __( 'Button Layout', 'woocommerce-paypal-payments' ) }
>
-
+
+
+
);
};
@@ -79,12 +84,13 @@ const SectionButtonShape = ( { location } ) => {
title={ __( 'Shape', 'woocommerce-paypal-payments' ) }
className="button-shape"
>
-
+
+
+
);
};
@@ -93,10 +99,11 @@ const SectionButtonLabel = ( { location } ) => {
const { label, setLabel, labelChoices } = useStylingProps( location );
return (
-
+
{
const { color, setColor, colorChoices } = useStylingProps( location );
return (
-
+
{
title={ __( 'Tagline', 'woocommerce-paypal-payments' ) }
className="tagline"
>
-
+
+
+
);
};
diff --git a/modules/ppcp-settings/resources/js/data/styling/constants.js b/modules/ppcp-settings/resources/js/data/styling/constants.js
index 395d80cdb..f21ac7adf 100644
--- a/modules/ppcp-settings/resources/js/data/styling/constants.js
+++ b/modules/ppcp-settings/resources/js/data/styling/constants.js
@@ -147,6 +147,12 @@ export const STYLING_SHAPES = {
};
export const STYLING_PAYMENT_METHODS = {
+ paypal: {
+ value: '',
+ label: __( 'PayPal', 'woocommerce-paypal-payments' ),
+ checked: true,
+ disabled: true,
+ },
venmo: {
value: 'venmo',
label: __( 'Venmo', 'woocommerce-paypal-payments' ),