mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Settings UI: Add Todos saving and dismissing
This commit is contained in:
parent
0daf56b2af
commit
f6717e2e66
16 changed files with 433 additions and 89 deletions
|
@ -5,6 +5,7 @@ import {
|
|||
PaymentHooks,
|
||||
SettingsHooks,
|
||||
StylingHooks,
|
||||
TodosHooks,
|
||||
} from '../data';
|
||||
|
||||
export const useSaveSettings = () => {
|
||||
|
@ -13,6 +14,7 @@ export const useSaveSettings = () => {
|
|||
const { persist: persistPayment } = PaymentHooks.useStore();
|
||||
const { persist: persistSettings } = SettingsHooks.useStore();
|
||||
const { persist: persistStyling } = StylingHooks.useStore();
|
||||
const { persist: persistTodos } = TodosHooks.useStore();
|
||||
|
||||
const persistAll = useCallback( () => {
|
||||
withActivity(
|
||||
|
@ -30,7 +32,14 @@ export const useSaveSettings = () => {
|
|||
'Save styling details',
|
||||
persistStyling
|
||||
);
|
||||
}, [ persistPayment, persistSettings, persistStyling, withActivity ] );
|
||||
withActivity( 'persist-todos', 'Save todos state', persistTodos );
|
||||
}, [
|
||||
persistPayment,
|
||||
persistSettings,
|
||||
persistStyling,
|
||||
persistTodos,
|
||||
withActivity,
|
||||
] );
|
||||
|
||||
return { persistAll };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue