diff --git a/projects/packages/jetpack-mu-wpcom/changelog/remove-global-styles-modal b/projects/packages/jetpack-mu-wpcom/changelog/remove-global-styles-modal new file mode 100644 index 0000000000000..4806bb21dc750 --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/remove-global-styles-modal @@ -0,0 +1,4 @@ +Significance: minor +Type: deprecated + +Remove global styles modal diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/image.svg b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/image.svg deleted file mode 100644 index 741a14bd9bfd9..0000000000000 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/image.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/index.js b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/index.js index 6b09e813b7067..82e80995e306e 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/index.js +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/index.js @@ -1,7 +1,6 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import domReady from '@wordpress/dom-ready'; import { registerPlugin } from '@wordpress/plugins'; -import GlobalStylesModal from './modal'; import GlobalStylesNotices from './notices'; import './store'; @@ -9,7 +8,6 @@ const showGlobalStylesComponents = () => { registerPlugin( 'wpcom-global-styles', { render: () => ( - ), diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/index.php b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/index.php index c4ab88901c5b8..7ad3474998821 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/index.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/index.php @@ -200,7 +200,6 @@ function wpcom_global_styles_enqueue_block_editor_assets() { 'upgradeUrl' => $upgrade_url, 'wpcomBlogId' => wpcom_global_styles_get_wpcom_current_blog_id(), 'planName' => $plan_name, - 'modalImage' => plugins_url( 'image.svg', __FILE__ ), 'learnMoreAboutStylesUrl' => $learn_more_about_styles_support_url, 'learnMoreAboutStylesPostId' => $learn_more_about_styles_post_id, ) diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/modal.js b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/modal.js deleted file mode 100644 index 478d7f927b7a7..0000000000000 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/modal.js +++ /dev/null @@ -1,112 +0,0 @@ -/* global wpcomGlobalStyles */ - -import { Button, Modal } from '@wordpress/components'; -import { useDispatch, useSelect } from '@wordpress/data'; -import { useEffect } from '@wordpress/element'; -import { __, sprintf } from '@wordpress/i18n'; -import React from 'react'; -import { wpcomTrackEvent } from '../../common/tracks'; -import { useCanvas } from './use-canvas'; - -import './modal.scss'; - -const GlobalStylesModal = () => { - const isSiteEditor = useSelect( select => !! select( 'core/edit-site' ), [] ); - const { viewCanvasPath } = useCanvas(); - - const isVisible = useSelect( - select => { - if ( ! isSiteEditor ) { - return false; - } - - const currentSidebar = - select( 'core/interface' ).getActiveComplementaryArea( 'core/edit-site' ); - - return select( 'automattic/wpcom-global-styles' ).isModalVisible( - currentSidebar, - viewCanvasPath - ); - }, - [ viewCanvasPath, isSiteEditor ] - ); - - const { dismissModal } = useDispatch( 'automattic/wpcom-global-styles' ); - const { set: setPreference } = useDispatch( 'core/preferences' ); - - // Hide the welcome guide modal, so it doesn't conflict with our modal. - useEffect( () => { - if ( isSiteEditor ) { - setPreference( 'core/edit-site', 'welcomeGuideStyles', false ); - } - }, [ setPreference, isSiteEditor ] ); - - useEffect( () => { - if ( isVisible ) { - wpcomTrackEvent( 'calypso_global_styles_gating_modal_show', { - context: 'site-editor', - } ); - } - }, [ isVisible ] ); - - const closeModal = () => { - dismissModal(); - wpcomTrackEvent( 'calypso_global_styles_gating_modal_dismiss', { - context: 'site-editor', - } ); - }; - - if ( ! isSiteEditor || ! isVisible ) { - return null; - } - - const planName = wpcomGlobalStyles.planName; - const description = sprintf( - /* translators: %s is the short-form Premium plan name */ - __( - "Change all of your site's fonts, colors and more. Available on the %s plan.", - 'jetpack-mu-wpcom' - ), - planName - ); - - return ( - -
-
-

- { __( 'A powerful new way to style your site', 'jetpack-mu-wpcom' ) } -

-

{ description }

-
- - -
-
-
- -
-
-
- ); -}; - -export default GlobalStylesModal;