mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
🔥 Remove unused code
This commit is contained in:
parent
1c44a8105b
commit
2848347537
3 changed files with 0 additions and 47 deletions
|
@ -7,18 +7,15 @@ import {
|
||||||
useMemo,
|
useMemo,
|
||||||
useCallback,
|
useCallback,
|
||||||
} from '@wordpress/element';
|
} from '@wordpress/element';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import SettingsToggleBlock from '../../../ReusableComponents/SettingsToggleBlock';
|
import SettingsToggleBlock from '../../../ReusableComponents/SettingsToggleBlock';
|
||||||
import Separator from '../../../ReusableComponents/Separator';
|
import Separator from '../../../ReusableComponents/Separator';
|
||||||
import DataStoreControl from '../../../ReusableComponents/DataStoreControl';
|
import DataStoreControl from '../../../ReusableComponents/DataStoreControl';
|
||||||
import { CommonHooks } from '../../../../data';
|
|
||||||
import {
|
import {
|
||||||
useSandboxConnection,
|
useSandboxConnection,
|
||||||
useManualConnection,
|
useManualConnection,
|
||||||
} from '../../../../hooks/useHandleConnections';
|
} from '../../../../hooks/useHandleConnections';
|
||||||
|
|
||||||
import ConnectionButton from './ConnectionButton';
|
import ConnectionButton from './ConnectionButton';
|
||||||
import BusyStateWrapper from '../../../ReusableComponents/BusyStateWrapper';
|
import BusyStateWrapper from '../../../ReusableComponents/BusyStateWrapper';
|
||||||
|
|
||||||
|
@ -41,7 +38,6 @@ const AdvancedOptionsForm = () => {
|
||||||
const [ clientValid, setClientValid ] = useState( false );
|
const [ clientValid, setClientValid ] = useState( false );
|
||||||
const [ secretValid, setSecretValid ] = useState( false );
|
const [ secretValid, setSecretValid ] = useState( false );
|
||||||
|
|
||||||
const { isBusy } = CommonHooks.useBusyState();
|
|
||||||
const { isSandboxMode, setSandboxMode } = useSandboxConnection();
|
const { isSandboxMode, setSandboxMode } = useSandboxConnection();
|
||||||
const {
|
const {
|
||||||
handleConnectViaIdAndSecret,
|
handleConnectViaIdAndSecret,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { Button, Icon } from '@wordpress/components';
|
import { Button, Icon } from '@wordpress/components';
|
||||||
import { chevronLeft } from '@wordpress/icons';
|
import { chevronLeft } from '@wordpress/icons';
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { OnboardingHooks } from '../../../../data';
|
import { OnboardingHooks } from '../../../../data';
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
/**
|
|
||||||
* Opens the provided URL, preferably in a popup window.
|
|
||||||
*
|
|
||||||
* Popups are usually only supported on desktop devices, when the browser is not in fullscreen mode.
|
|
||||||
*
|
|
||||||
* @param {string} url
|
|
||||||
* @param {Object} options
|
|
||||||
* @param {string} options.name
|
|
||||||
* @param {number} options.width
|
|
||||||
* @param {number} options.height
|
|
||||||
* @param {boolean} options.resizeable
|
|
||||||
* @return {null|Window} Popup window instance, or null.
|
|
||||||
*/
|
|
||||||
export const openPopup = (
|
|
||||||
url,
|
|
||||||
{ name = '_blank', width = 450, height = 720, resizeable = false } = {}
|
|
||||||
) => {
|
|
||||||
width = Math.max( 100, Math.min( window.screen.width - 40, width ) );
|
|
||||||
height = Math.max( 100, Math.min( window.screen.height - 40, height ) );
|
|
||||||
|
|
||||||
const left = ( window.screen.width - width ) / 2;
|
|
||||||
const top = ( window.screen.height - height ) / 2;
|
|
||||||
|
|
||||||
const features = [
|
|
||||||
`width=${ width }`,
|
|
||||||
`height=${ height }`,
|
|
||||||
`left=${ left }`,
|
|
||||||
`top=${ top }`,
|
|
||||||
`resizable=${ resizeable ? 'yes' : 'no' }`,
|
|
||||||
`scrollbars=yes`,
|
|
||||||
`status=no`,
|
|
||||||
];
|
|
||||||
|
|
||||||
const popup = window.open( url, name, features.join( ',' ) );
|
|
||||||
|
|
||||||
if ( popup && ! popup.closed ) {
|
|
||||||
popup.focus();
|
|
||||||
return popup;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
};
|
|
Loading…
Add table
Add a link
Reference in a new issue