mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Merge pull request #3029 from woocommerce/PCP-4135-fix-js-error-button-is-not-defined
Fix JS error "Button is not defined" (4135)
This commit is contained in:
commit
5b212879d5
4 changed files with 16 additions and 13 deletions
|
@ -5,7 +5,7 @@ const ControlToggleButton = ( { label, description, value, onChange } ) => (
|
||||||
<Action>
|
<Action>
|
||||||
<ToggleControl
|
<ToggleControl
|
||||||
className="ppcp--control-toggle"
|
className="ppcp--control-toggle"
|
||||||
__nextHasNoMarginBottom={ true }
|
__nextHasNoMarginBottom
|
||||||
checked={ value }
|
checked={ value }
|
||||||
onChange={ onChange }
|
onChange={ onChange }
|
||||||
label={ label }
|
label={ label }
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { ToggleControl } from '@wordpress/components';
|
import { ToggleControl, Icon, Button } from '@wordpress/components';
|
||||||
|
import { cog } from '@wordpress/icons';
|
||||||
|
|
||||||
import SettingsBlock from '../SettingsBlock';
|
import SettingsBlock from '../SettingsBlock';
|
||||||
import PaymentMethodIcon from '../PaymentMethodIcon';
|
import PaymentMethodIcon from '../PaymentMethodIcon';
|
||||||
|
@ -13,12 +14,12 @@ const PaymentMethodItemBlock = ( {
|
||||||
<SettingsBlock className="ppcp--method-item" separatorAndGap={ false }>
|
<SettingsBlock className="ppcp--method-item" separatorAndGap={ false }>
|
||||||
<div className="ppcp--method-inner">
|
<div className="ppcp--method-inner">
|
||||||
<div className="ppcp--method-title-wrapper">
|
<div className="ppcp--method-title-wrapper">
|
||||||
{ paymentMethod?.icon && (
|
{ paymentMethod?.icon && (
|
||||||
<PaymentMethodIcon
|
<PaymentMethodIcon
|
||||||
icons={ [ paymentMethod.icon ] }
|
icons={ [ paymentMethod.icon ] }
|
||||||
type={ paymentMethod.icon }
|
type={ paymentMethod.icon }
|
||||||
/>
|
/>
|
||||||
) }
|
) }
|
||||||
<span className="ppcp--method-title">
|
<span className="ppcp--method-title">
|
||||||
{ paymentMethod.itemTitle }
|
{ paymentMethod.itemTitle }
|
||||||
</span>
|
</span>
|
||||||
|
@ -28,7 +29,7 @@ const PaymentMethodItemBlock = ( {
|
||||||
</p>
|
</p>
|
||||||
<div className="ppcp--method-footer">
|
<div className="ppcp--method-footer">
|
||||||
<ToggleControl
|
<ToggleControl
|
||||||
__nextHasNoMarginBottom={ true }
|
__nextHasNoMarginBottom
|
||||||
checked={ isSelected }
|
checked={ isSelected }
|
||||||
onChange={ onSelect }
|
onChange={ onSelect }
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -43,6 +43,7 @@ const SettingsToggleBlock = ( {
|
||||||
</div>
|
</div>
|
||||||
<div className="ppcp-r-toggle-block__switch">
|
<div className="ppcp-r-toggle-block__switch">
|
||||||
<ToggleControl
|
<ToggleControl
|
||||||
|
__nextHasNoMarginBottom
|
||||||
ref={ toggleRef }
|
ref={ toggleRef }
|
||||||
checked={ isToggled }
|
checked={ isToggled }
|
||||||
onChange={ ( newState ) => setToggled( newState ) }
|
onChange={ ( newState ) => setToggled( newState ) }
|
||||||
|
|
|
@ -11,7 +11,7 @@ import PaymentMethodModal from '../../../../ReusableComponents/PaymentMethodModa
|
||||||
import { PaymentHooks } from '../../../../../data';
|
import { PaymentHooks } from '../../../../../data';
|
||||||
|
|
||||||
const Modal = ( { method, setModalIsVisible, onSave } ) => {
|
const Modal = ( { method, setModalIsVisible, onSave } ) => {
|
||||||
const { paymentMethods } = PaymentHooks.usePaymentMethods();
|
const { all: paymentMethods } = PaymentHooks.usePaymentMethods();
|
||||||
const {
|
const {
|
||||||
paypalShowLogo,
|
paypalShowLogo,
|
||||||
threeDSecure,
|
threeDSecure,
|
||||||
|
@ -64,9 +64,9 @@ const Modal = ( { method, setModalIsVisible, onSave } ) => {
|
||||||
switch ( field.type ) {
|
switch ( field.type ) {
|
||||||
case 'text':
|
case 'text':
|
||||||
return (
|
return (
|
||||||
<div className="ppcp-r-modal__field-row">
|
<div key={ key } className="ppcp-r-modal__field-row">
|
||||||
<TextControl
|
<TextControl
|
||||||
__nextHasNoMarginBottom={ true }
|
__nextHasNoMarginBottom
|
||||||
className="ppcp-r-vertical-text-control"
|
className="ppcp-r-vertical-text-control"
|
||||||
label={ field.label }
|
label={ field.label }
|
||||||
value={ settings[ key ] }
|
value={ settings[ key ] }
|
||||||
|
@ -82,8 +82,9 @@ const Modal = ( { method, setModalIsVisible, onSave } ) => {
|
||||||
|
|
||||||
case 'toggle':
|
case 'toggle':
|
||||||
return (
|
return (
|
||||||
<div className="ppcp-r-modal__field-row">
|
<div key={ key } className="ppcp-r-modal__field-row">
|
||||||
<ToggleControl
|
<ToggleControl
|
||||||
|
__nextHasNoMarginBottom
|
||||||
label={ field.label }
|
label={ field.label }
|
||||||
checked={ settings[ key ] }
|
checked={ settings[ key ] }
|
||||||
onChange={ ( value ) =>
|
onChange={ ( value ) =>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue