Merge pull request #3584 from woocommerce/PCP-4995-remove-firefox-onboarding-notice

Remove the Firefox onboarding notice (4995)
This commit is contained in:
Emili Castells 2025-08-08 09:03:23 +02:00 committed by GitHub
commit b8a979fc5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,13 +8,6 @@ import { OnboardingHooks } from '../../../../data/onboarding/hooks';
import BusyStateWrapper from '../../../ReusableComponents/BusyStateWrapper';
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
* placeholder button looks identical to the working button, but has no href, target, or
@ -36,8 +29,6 @@ const ButtonOrPlaceholder = ( {
children,
onClick,
} ) => {
const isFirefox = useIsFirefox();
const buttonProps = {
className,
variant,
@ -51,20 +42,6 @@ const ButtonOrPlaceholder = ( {
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>;
};