mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +08:00
🚚 Move AccordionSettingsBlock up one level
This commit is contained in:
parent
cc6b62ce7f
commit
837656eaf6
6 changed files with 25 additions and 25 deletions
|
@ -1,14 +1,19 @@
|
||||||
import Accordion from '../AccordionSection';
|
import Accordion from './AccordionSection';
|
||||||
import SettingsBlock from '../SettingsBlock';
|
import SettingsBlock from './SettingsBlock';
|
||||||
import { Header, Title, Action, Description, TitleWrapper } from '../Elements';
|
import { Header, Title, Action, Description, TitleWrapper } from './Elements';
|
||||||
|
|
||||||
const SettingsAccordion = ( { title, description, children, ...props } ) => (
|
const SettingsBlockAccordion = ( {
|
||||||
|
title,
|
||||||
|
description,
|
||||||
|
children,
|
||||||
|
...props
|
||||||
|
} ) => (
|
||||||
<SettingsBlock { ...props } className="ppcp-r-settings-block__accordion">
|
<SettingsBlock { ...props } className="ppcp-r-settings-block__accordion">
|
||||||
<Accordion
|
<Accordion
|
||||||
title={ title }
|
title={ title }
|
||||||
description={ description }
|
description={ description }
|
||||||
Header={ Header }
|
Header={ Header }
|
||||||
TitleWrapper={ TitleWrapper }
|
TitleWrapper={ TitleWrapper SettingsBlockAccordion}
|
||||||
Title={ Title }
|
Title={ Title }
|
||||||
Action={ Action }
|
Action={ Action }
|
||||||
Description={ Description }
|
Description={ Description }
|
||||||
|
@ -18,4 +23,4 @@ const SettingsAccordion = ( { title, description, children, ...props } ) => (
|
||||||
</SettingsBlock>
|
</SettingsBlock>
|
||||||
);
|
);
|
||||||
|
|
||||||
export default SettingsAccordion;
|
export default SettingsBlockAccordion;
|
|
@ -1,6 +1,5 @@
|
||||||
export { default as ButtonSettingsBlock } from './ButtonSettingsBlock';
|
export { default as ButtonSettingsBlock } from './ButtonSettingsBlock';
|
||||||
export { default as SelectSettingsBlock } from './SelectSettingsBlock';
|
export { default as SelectSettingsBlock } from './SelectSettingsBlock';
|
||||||
export { default as AccordionSettingsBlock } from './AccordionSettingsBlock';
|
|
||||||
export { default as RadioSettingsBlock } from './RadioSettingsBlock';
|
export { default as RadioSettingsBlock } from './RadioSettingsBlock';
|
||||||
export { default as PaymentMethodsBlock } from './PaymentMethodsBlock';
|
export { default as PaymentMethodsBlock } from './PaymentMethodsBlock';
|
||||||
export { default as PaymentMethodItemBlock } from './PaymentMethodItemBlock';
|
export { default as PaymentMethodItemBlock } from './PaymentMethodItemBlock';
|
||||||
|
|
|
@ -2,10 +2,10 @@ import { __, sprintf } from '@wordpress/i18n';
|
||||||
import { Button } from '@wordpress/components';
|
import { Button } from '@wordpress/components';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AccordionSettingsBlock,
|
|
||||||
ControlTextInput,
|
ControlTextInput,
|
||||||
RadioSettingsBlock,
|
RadioSettingsBlock,
|
||||||
} from '../../../../ReusableComponents/SettingsBlocks';
|
} from '../../../../ReusableComponents/SettingsBlocks';
|
||||||
|
import SettingsBlockAccordion from '../../../../ReusableComponents/SettingsBlockAccordion';
|
||||||
|
|
||||||
const ConnectionDetails = ( { settings, updateFormValue } ) => {
|
const ConnectionDetails = ( { settings, updateFormValue } ) => {
|
||||||
const isSandbox = settings.sandboxConnected;
|
const isSandbox = settings.sandboxConnected;
|
||||||
|
@ -17,7 +17,7 @@ const ConnectionDetails = ( { settings, updateFormValue } ) => {
|
||||||
const modeKey = isSandbox ? 'productionMode' : 'sandboxMode';
|
const modeKey = isSandbox ? 'productionMode' : 'sandboxMode';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AccordionSettingsBlock
|
<SettingsBlockAccordion
|
||||||
title={ modeConfig.title }
|
title={ modeConfig.title }
|
||||||
description={ modeConfig.description }
|
description={ modeConfig.description }
|
||||||
>
|
>
|
||||||
|
@ -31,7 +31,7 @@ const ConnectionDetails = ( { settings, updateFormValue } ) => {
|
||||||
callback: updateFormValue,
|
callback: updateFormValue,
|
||||||
} }
|
} }
|
||||||
/>
|
/>
|
||||||
</AccordionSettingsBlock>
|
</SettingsBlockAccordion>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import {
|
import { SelectSettingsBlock } from '../../../../ReusableComponents/SettingsBlocks';
|
||||||
AccordionSettingsBlock,
|
import SettingsBlockAccordion from '../../../../ReusableComponents/SettingsBlockAccordion';
|
||||||
SelectSettingsBlock,
|
|
||||||
} from '../../../../ReusableComponents/SettingsBlocks';
|
|
||||||
|
|
||||||
const creditCardExamples = [
|
const creditCardExamples = [
|
||||||
{ value: '', label: __( 'Select', 'woocommerce-paypal-payments' ) },
|
{ value: '', label: __( 'Select', 'woocommerce-paypal-payments' ) },
|
||||||
|
@ -24,7 +22,7 @@ const creditCardExamples = [
|
||||||
|
|
||||||
const OtherSettings = ( { settings, updateFormValue } ) => {
|
const OtherSettings = ( { settings, updateFormValue } ) => {
|
||||||
return (
|
return (
|
||||||
<AccordionSettingsBlock
|
<SettingsBlockAccordion
|
||||||
title={ __(
|
title={ __(
|
||||||
'Other payment method settings',
|
'Other payment method settings',
|
||||||
'woocommerce-paypal-payments'
|
'woocommerce-paypal-payments'
|
||||||
|
@ -52,7 +50,7 @@ const OtherSettings = ( { settings, updateFormValue } ) => {
|
||||||
} }
|
} }
|
||||||
order={ [ 'title', 'description', 'action' ] }
|
order={ [ 'title', 'description', 'action' ] }
|
||||||
/>
|
/>
|
||||||
</AccordionSettingsBlock>
|
</SettingsBlockAccordion>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import {
|
import {
|
||||||
AccordionSettingsBlock,
|
|
||||||
RadioSettingsBlock,
|
RadioSettingsBlock,
|
||||||
ControlToggleButton,
|
ControlToggleButton,
|
||||||
ControlTextInput,
|
ControlTextInput,
|
||||||
SelectSettingsBlock,
|
SelectSettingsBlock,
|
||||||
} from '../../../../ReusableComponents/SettingsBlocks';
|
} from '../../../../ReusableComponents/SettingsBlocks';
|
||||||
import SettingsBlock from '../../../../ReusableComponents/SettingsBlock';
|
import SettingsBlock from '../../../../ReusableComponents/SettingsBlock';
|
||||||
|
import SettingsBlockAccordion from '../../../../ReusableComponents/SettingsBlockAccordion';
|
||||||
|
|
||||||
const PaypalSettings = ( { updateFormValue, settings } ) => {
|
const PaypalSettings = ( { updateFormValue, settings } ) => {
|
||||||
return (
|
return (
|
||||||
<AccordionSettingsBlock
|
<SettingsBlockAccordion
|
||||||
className="ppcp-r-settings-block--settings"
|
className="ppcp-r-settings-block--settings"
|
||||||
title={ __( 'PayPal Settings', 'woocommerce-paypal-payments' ) }
|
title={ __( 'PayPal Settings', 'woocommerce-paypal-payments' ) }
|
||||||
description={ __(
|
description={ __(
|
||||||
|
@ -189,7 +189,7 @@ const PaypalSettings = ( { updateFormValue, settings } ) => {
|
||||||
} }
|
} }
|
||||||
order={ [ 'title', 'description', 'action' ] }
|
order={ [ 'title', 'description', 'action' ] }
|
||||||
/>
|
/>
|
||||||
</AccordionSettingsBlock>
|
</SettingsBlockAccordion>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,19 +5,17 @@ import {
|
||||||
Header,
|
Header,
|
||||||
Title,
|
Title,
|
||||||
} from '../../../../../ReusableComponents/Elements';
|
} from '../../../../../ReusableComponents/Elements';
|
||||||
import {
|
import { ControlToggleButton } from '../../../../../ReusableComponents/SettingsBlocks';
|
||||||
AccordionSettingsBlock,
|
|
||||||
ControlToggleButton,
|
|
||||||
} from '../../../../../ReusableComponents/SettingsBlocks';
|
|
||||||
import SettingsBlock from '../../../../../ReusableComponents/SettingsBlock';
|
import SettingsBlock from '../../../../../ReusableComponents/SettingsBlock';
|
||||||
|
|
||||||
import SimulationBlock from './SimulationBlock';
|
import SimulationBlock from './SimulationBlock';
|
||||||
import ResubscribeBlock from './ResubscribeBlock';
|
import ResubscribeBlock from './ResubscribeBlock';
|
||||||
import HooksTableBlock from './HooksTableBlock';
|
import HooksTableBlock from './HooksTableBlock';
|
||||||
|
import SettingsBlockAccordion from '../../../../../ReusableComponents/SettingsBlockAccordion';
|
||||||
|
|
||||||
const Troubleshooting = ( { updateFormValue, settings } ) => {
|
const Troubleshooting = ( { updateFormValue, settings } ) => {
|
||||||
return (
|
return (
|
||||||
<AccordionSettingsBlock
|
<SettingsBlockAccordion
|
||||||
className="ppcp-r-settings-block--troubleshooting"
|
className="ppcp-r-settings-block--troubleshooting"
|
||||||
title={ __( 'Troubleshooting', 'woocommerce-paypal-payments' ) }
|
title={ __( 'Troubleshooting', 'woocommerce-paypal-payments' ) }
|
||||||
description={ __(
|
description={ __(
|
||||||
|
@ -65,7 +63,7 @@ const Troubleshooting = ( { updateFormValue, settings } ) => {
|
||||||
<ResubscribeBlock />
|
<ResubscribeBlock />
|
||||||
<SimulationBlock />
|
<SimulationBlock />
|
||||||
</SettingsBlock>
|
</SettingsBlock>
|
||||||
</AccordionSettingsBlock>
|
</SettingsBlockAccordion>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue