mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
✨ React-side implementation of the save logic
This commit is contained in:
parent
5c371d928e
commit
e00b95fd1d
1 changed files with 13 additions and 1 deletions
|
@ -2,13 +2,25 @@ import { Button } from '@wordpress/components';
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
import TopNavigation from '../../../ReusableComponents/TopNavigation';
|
import TopNavigation from '../../../ReusableComponents/TopNavigation';
|
||||||
|
import { StylingHooks } from '../../../../data';
|
||||||
|
|
||||||
const SettingsNavigation = () => {
|
const SettingsNavigation = () => {
|
||||||
|
const { persist: persistStyling } = StylingHooks.useStore();
|
||||||
|
const isBusy = false; // TODO: Implement loading state.
|
||||||
|
|
||||||
|
const handleSaveClick = () => {
|
||||||
|
persistStyling();
|
||||||
|
};
|
||||||
|
|
||||||
const title = __( 'PayPal Payments', 'woocommerce-paypal-payments' );
|
const title = __( 'PayPal Payments', 'woocommerce-paypal-payments' );
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TopNavigation title={ title } exitOnTitleClick={ true }>
|
<TopNavigation title={ title } exitOnTitleClick={ true }>
|
||||||
<Button variant="primary" disabled={ false }>
|
<Button
|
||||||
|
variant="primary"
|
||||||
|
disabled={ isBusy }
|
||||||
|
onClick={ handleSaveClick }
|
||||||
|
>
|
||||||
{ __( 'Save', 'woocommerce-paypal-payments' ) }
|
{ __( 'Save', 'woocommerce-paypal-payments' ) }
|
||||||
</Button>
|
</Button>
|
||||||
</TopNavigation>
|
</TopNavigation>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue