mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Merge pull request #2945 from woocommerce/PCP-4020-review-and-fix-the-sandbox-login
Review and fix the login logic - Frontend changes (4020)
This commit is contained in:
commit
689463e243
46 changed files with 1750 additions and 1023 deletions
|
@ -24,6 +24,7 @@ const BusyContext = createContext( false );
|
|||
* @param {boolean} props.busySpinner - Allows disabling the spinner in busy-state.
|
||||
* @param {string} props.className - Additional class names for the wrapper.
|
||||
* @param {Function} props.onBusy - Callback to process child props when busy.
|
||||
* @param {boolean} props.isBusy - Optional. Additional condition to determine if the component is busy.
|
||||
*/
|
||||
const BusyStateWrapper = ( {
|
||||
children,
|
||||
|
@ -31,11 +32,12 @@ const BusyStateWrapper = ( {
|
|||
busySpinner = true,
|
||||
className = '',
|
||||
onBusy = () => ( { disabled: true } ),
|
||||
isBusy = false,
|
||||
} ) => {
|
||||
const { isBusy } = CommonHooks.useBusyState();
|
||||
const { isBusy: globalIsBusy } = CommonHooks.useBusyState();
|
||||
const hasBusyParent = useContext( BusyContext );
|
||||
|
||||
const isBusyComponent = isBusy && enabled;
|
||||
const isBusyComponent = ( isBusy || globalIsBusy ) && enabled;
|
||||
const showSpinner = busySpinner && isBusyComponent && ! hasBusyParent;
|
||||
|
||||
const wrapperClassName = classNames( 'ppcp-r-busy-wrapper', className, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue