mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Remove the Firefox onboarding notice
This commit is contained in:
parent
8e1307cae6
commit
0d1fdb11e4
1 changed files with 0 additions and 23 deletions
|
@ -8,13 +8,6 @@ import { OnboardingHooks } from '../../../../data/onboarding/hooks';
|
||||||
import BusyStateWrapper from '../../../ReusableComponents/BusyStateWrapper';
|
import BusyStateWrapper from '../../../ReusableComponents/BusyStateWrapper';
|
||||||
import { Notice } from '../../../ReusableComponents/Elements';
|
import { Notice } from '../../../ReusableComponents/Elements';
|
||||||
|
|
||||||
const useIsFirefox = () => {
|
|
||||||
if ( typeof window === 'undefined' ) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return window.navigator.userAgent.toLowerCase().indexOf( 'firefox' ) > -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Button component that outputs a placeholder button when no onboardingUrl is present yet - the
|
* Button component that outputs a placeholder button when no onboardingUrl is present yet - the
|
||||||
* placeholder button looks identical to the working button, but has no href, target, or
|
* placeholder button looks identical to the working button, but has no href, target, or
|
||||||
|
@ -36,8 +29,6 @@ const ButtonOrPlaceholder = ( {
|
||||||
children,
|
children,
|
||||||
onClick,
|
onClick,
|
||||||
} ) => {
|
} ) => {
|
||||||
const isFirefox = useIsFirefox();
|
|
||||||
|
|
||||||
const buttonProps = {
|
const buttonProps = {
|
||||||
className,
|
className,
|
||||||
variant,
|
variant,
|
||||||
|
@ -51,20 +42,6 @@ const ButtonOrPlaceholder = ( {
|
||||||
buttonProps[ 'data-paypal-onboard-button' ] = 'true';
|
buttonProps[ 'data-paypal-onboard-button' ] = 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isFirefox ) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Button { ...buttonProps }>{ children }</Button>
|
|
||||||
<Notice type={ 'error' }>
|
|
||||||
{ __(
|
|
||||||
'This button may not work in Firefox. Please use another browser, like Chrome, to complete this step.',
|
|
||||||
'woocommerce-paypal-payments'
|
|
||||||
) }
|
|
||||||
</Notice>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return <Button { ...buttonProps }>{ children }</Button>;
|
return <Button { ...buttonProps }>{ children }</Button>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue