mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
39 lines
944 B
JavaScript
39 lines
944 B
JavaScript
import ConnectionStatus from './TabSettingsElements/ConnectionStatus';
|
|
import CommonSettings from './TabSettingsElements/CommonSettings';
|
|
import ExpertSettings from './TabSettingsElements/ExpertSettings';
|
|
import { SettingsHooks } from '../../../data';
|
|
import SpinnerOverlay from '../../ReusableComponents/SpinnerOverlay';
|
|
|
|
const TabSettings = () => {
|
|
const { isReady } = SettingsHooks.useStore();
|
|
const { settings, setSettings } = SettingsHooks.useSettings();
|
|
|
|
const updateFormValue = ( key, value ) => {
|
|
setSettings( {
|
|
...settings,
|
|
[ key ]: value,
|
|
} );
|
|
};
|
|
|
|
if ( ! isReady ) {
|
|
return <SpinnerOverlay />;
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<div className="ppcp-r-settings">
|
|
<ConnectionStatus />
|
|
<CommonSettings
|
|
settings={ settings }
|
|
updateFormValue={ updateFormValue }
|
|
/>
|
|
<ExpertSettings
|
|
settings={ settings }
|
|
updateFormValue={ updateFormValue }
|
|
/>
|
|
</div>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default TabSettings;
|