woocommerce-paypal-payments/modules/ppcp-settings/resources/js/Components/Screens/Settings.js
Philipp Stracker 3d05c65f50
New “isReady” flag to avoid invalid page content
Before this change, the onboarding wizard was briefly displayed on every page load
2024-10-28 18:57:39 +01:00

23 lines
611 B
JavaScript

import TabNavigation from '../ReusableComponents/TabNavigation';
import { getSettingsTabs } from './tabs';
import { useOnboardingStep } from '../../data';
import Onboarding from './Onboarding/Onboarding';
const Settings = () => {
const onboardingProgress = useOnboardingStep();
if ( ! onboardingProgress.isReady ) {
// TODO: Use better loading state indicator.
return <div>Loading...</div>;
}
if ( ! onboardingProgress.completed ) {
return <Onboarding />;
}
const tabs = getSettingsTabs( onboardingProgress );
return <TabNavigation tabs={ tabs }></TabNavigation>;
};
export default Settings;