Merge pull request #3071 from woocommerce/PCP-4151-better-style-for-the-loader-esp-during-onboarding

Better style for the loader (4151)
This commit is contained in:
Philipp Stracker 2025-02-07 17:02:16 +01:00 committed by GitHub
commit ab363b9619
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 28 additions and 13 deletions

View file

@ -38,7 +38,7 @@ const SettingsApp = () => {
const Content = useMemo( () => {
if ( ! onboardingIsReady || ! merchantIsReady ) {
return <SpinnerOverlay />;
return <SpinnerOverlay asModal={ true } />;
}
if ( isSendOnlyCountry ) {

View file

@ -60,7 +60,9 @@ const BusyStateWrapper = ( {
return (
<BusyContext.Provider value={ isBusyComponent }>
<div className={ wrapperClassName }>
{ showSpinner && <SpinnerOverlay /> }
{ showSpinner && (
<SpinnerOverlay asModal={ false } message="" />
) }
{ memoizedChildren }
</div>
</BusyContext.Provider>

View file

@ -1,13 +1,18 @@
import { __ } from '@wordpress/i18n';
import { Spinner } from '@wordpress/components';
import classnames from 'classnames';
const SpinnerOverlay = ( { asModal = false, message = null } ) => {
const className = classnames( 'ppcp-r-spinner-overlay', {
'ppcp--is-modal': asModal,
} );
const SpinnerOverlay = ( { message = null } ) => {
if ( null === message ) {
message = __( 'Loading…', 'woocommerce-paypal-payments' );
}
return (
<div className="ppcp-r-spinner-overlay">
<div className={ className }>
{ message && (
<span className="ppcp--spinner-message">{ message }</span>
) }

View file

@ -8,7 +8,7 @@ const TabSettings = () => {
const { isReady } = SettingsHooks.useStore();
if ( ! isReady ) {
return <SpinnerOverlay />;
return <SpinnerOverlay asModal={ true } />;
}
return (

View file

@ -8,7 +8,7 @@ const TabStyling = () => {
const { location, setLocation } = StylingHooks.useStylingLocation();
if ( ! isReady ) {
return <SpinnerOverlay />;
return <SpinnerOverlay asModal={ true } />;
}
return (