mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Settings UI: Move Things To Do config data to a separate definition file. Add settings highlighting. Add todos dismissing.
This commit is contained in:
parent
51b2582589
commit
0daf56b2af
20 changed files with 612 additions and 300 deletions
|
@ -28,6 +28,8 @@ const useHooks = () => {
|
|||
// Transient accessors.
|
||||
const [ isReady ] = useTransient( 'isReady' );
|
||||
const [ activeModal, setActiveModal ] = useTransient( 'activeModal' );
|
||||
const [ activeHighlight, setActiveHighlight ] =
|
||||
useTransient( 'activeHighlight' );
|
||||
|
||||
// Persistent accessors.
|
||||
const [ isSandboxMode, setSandboxMode ] = usePersistent( 'useSandbox' );
|
||||
|
@ -62,6 +64,8 @@ const useHooks = () => {
|
|||
isReady,
|
||||
activeModal,
|
||||
setActiveModal,
|
||||
activeHighlight,
|
||||
setActiveHighlight,
|
||||
isSandboxMode,
|
||||
setSandboxMode: ( state ) => {
|
||||
return savePersistent( setSandboxMode, state );
|
||||
|
@ -162,6 +166,11 @@ export const useActiveModal = () => {
|
|||
return { activeModal, setActiveModal };
|
||||
};
|
||||
|
||||
export const useActiveHighlight = () => {
|
||||
const { activeHighlight, setActiveHighlight } = useHooks();
|
||||
return { activeHighlight, setActiveHighlight };
|
||||
};
|
||||
|
||||
// -- Not using the `useHooks()` data provider --
|
||||
|
||||
export const useBusyState = () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue