mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
🔀 Merge branch 'temp/settings-ui'
# Conflicts: # modules/ppcp-settings/resources/js/Components/Screens/Overview/TabOverview.js # modules/ppcp-settings/resources/js/data/common/hooks.js
This commit is contained in:
commit
4180556ecd
15 changed files with 622 additions and 246 deletions
|
@ -32,12 +32,14 @@ const useHooks = () => {
|
|||
productionOnboardingUrl,
|
||||
authenticateWithCredentials,
|
||||
authenticateWithOAuth,
|
||||
setActiveModal,
|
||||
startWebhookSimulation,
|
||||
checkWebhookSimulationState,
|
||||
} = useDispatch( STORE_NAME );
|
||||
|
||||
// Transient accessors.
|
||||
const isReady = useTransient( 'isReady' );
|
||||
const activeModal = useTransient( 'activeModal' );
|
||||
|
||||
// Persistent accessors.
|
||||
const isSandboxMode = usePersistent( 'useSandbox' );
|
||||
|
@ -68,6 +70,8 @@ const useHooks = () => {
|
|||
|
||||
return {
|
||||
isReady,
|
||||
activeModal,
|
||||
setActiveModal,
|
||||
isSandboxMode,
|
||||
setSandboxMode: ( state ) => {
|
||||
return savePersistent( setSandboxMode, state );
|
||||
|
@ -161,6 +165,11 @@ export const useMerchantInfo = () => {
|
|||
};
|
||||
};
|
||||
|
||||
export const useActiveModal = () => {
|
||||
const { activeModal, setActiveModal } = useHooks();
|
||||
return { activeModal, setActiveModal };
|
||||
};
|
||||
|
||||
// -- Not using the `useHooks()` data provider --
|
||||
|
||||
export const useBusyState = () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue