Skip to content

Commit ecc79c3

Browse files
frossortio
andauthored
update: deactivation survey to use unbundled WP components (#10902)
Co-authored-by: Rafael Meneses <meneses.tio@gmail.com>
1 parent 0fe7774 commit ecc79c3

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: update
3+
4+
update: deactivation survey to use WP components bundled within the WP installation

client/plugins-page/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import ReactDOM from 'react-dom';
99
*/
1010
import PluginDisableSurvey from './deactivation-survey';
1111
import { saveOption } from 'wcpay/data/settings/actions';
12+
import { WordPressComponentsContext } from 'wcpay/wordpress-components-context/context';
1213

1314
const PluginsPage = () => {
1415
const [ modalOpen, setModalOpen ] = useState( false );
@@ -99,6 +100,8 @@ const PluginsPage = () => {
99100
};
100101

101102
ReactDOM.render(
102-
<PluginsPage />,
103+
<WordPressComponentsContext.Provider value={ wp.components }>
104+
<PluginsPage />
105+
</WordPressComponentsContext.Provider>,
103106
document.querySelector( '#woopayments-plugins-page-app' )
104107
);

includes/admin/class-wc-payments-admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ public function register_payments_scripts() {
672672
'all'
673673
);
674674

675-
WC_Payments::register_script_with_dependencies( 'WCPAY_PLUGINS_PAGE', 'dist/plugins-page', [ 'wp-api-request' ] );
675+
WC_Payments::register_script_with_dependencies( 'WCPAY_PLUGINS_PAGE', 'dist/plugins-page', [ 'wp-api-request', 'wp-components' ] );
676676
wp_set_script_translations( 'WCPAY_PLUGINS_PAGE', 'woocommerce-payments' );
677677

678678
WC_Payments_Utils::register_style(

0 commit comments

Comments
 (0)