mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Merge pull request #3090 from woocommerce/PCP-4205-things-to-do-add-a-temporary-spinner-to-prevent-content-jumping
Settings UI: Add spinner when waiting for all components to be ready (4205)
This commit is contained in:
commit
fc76706777
1 changed files with 9 additions and 0 deletions
|
@ -16,6 +16,7 @@ import { useTodos } from '../../../../data/todos/hooks';
|
|||
import { useMerchantInfo } from '../../../../data/common/hooks';
|
||||
import { STORE_NAME as COMMON_STORE_NAME } from '../../../../data/common';
|
||||
import { STORE_NAME as TODOS_STORE_NAME } from '../../../../data/todos';
|
||||
import { CommonHooks, TodosHooks } from '../../../../data';
|
||||
|
||||
import { getFeatures } from '../Components/Overview/features-config';
|
||||
|
||||
|
@ -23,8 +24,16 @@ import {
|
|||
NOTIFICATION_ERROR,
|
||||
NOTIFICATION_SUCCESS,
|
||||
} from '../../../ReusableComponents/Icons';
|
||||
import SpinnerOverlay from '../../../ReusableComponents/SpinnerOverlay';
|
||||
|
||||
const TabOverview = () => {
|
||||
const { isReady: areTodosReady } = TodosHooks.useTodos();
|
||||
const { isReady: merchantIsReady } = CommonHooks.useMerchantInfo();
|
||||
|
||||
if ( ! areTodosReady || ! merchantIsReady ) {
|
||||
return <SpinnerOverlay asModal={ true } />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="ppcp-r-tab-overview">
|
||||
<OverviewTodos />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue