diff --git a/client/my-sites/theme/main.jsx b/client/my-sites/theme/main.jsx index 381a2b4106a6e..1bf7c76d7efe2 100644 --- a/client/my-sites/theme/main.jsx +++ b/client/my-sites/theme/main.jsx @@ -39,7 +39,6 @@ import BodySectionCssClass from 'calypso/layout/body-section-css-class'; import PageViewTracker from 'calypso/lib/analytics/page-view-tracker'; import { decodeEntities, preventWidows } from 'calypso/lib/formatting'; import { PerformanceTrackerStop } from 'calypso/lib/performance-tracking'; -import AutoLoadingHomepageModal from 'calypso/my-sites/themes/auto-loading-homepage-modal'; import { localizeThemesPath } from 'calypso/my-sites/themes/helpers'; import ThanksModal from 'calypso/my-sites/themes/thanks-modal'; import { connectOptions } from 'calypso/my-sites/themes/theme-options'; @@ -1212,7 +1211,6 @@ class ThemeSheet extends Component { { ! isNewDetailsAndPreview && this.renderBar() } - { ! isNewDetailsAndPreview && pageUpsellBanner } { ! isNewDetailsAndPreview && ( - this.setState( { isNarrow } ) - ); - } - - componentWillUnmount() { - if ( typeof this.unsubscribe === 'function' ) { - this.unsubscribe(); - } - } - - static getDerivedStateFromProps( nextProps, prevState ) { - // This component doesn't unmount when the dialog closes, so the state - // needs to be reset back to defaults each time it opens. - // Reseting `homepageAction` ensures the default option will be selected. - if ( nextProps.isVisible && ! prevState.wasVisible ) { - return { homepageAction: 'keep_current_homepage', wasVisible: true }; - } else if ( ! nextProps.isVisible && prevState.wasVisible ) { - return { wasVisible: false }; - } - return null; - } - - handleHomepageAction = ( event ) => { - this.setState( { homepageAction: event.currentTarget.value } ); - }; - - closeModalHandler = - ( action = 'dismiss' ) => - () => { - const { installingThemeId, siteId, source } = this.props; - if ( 'activeTheme' === action ) { - this.props.acceptAutoLoadingHomepageWarning( installingThemeId ); - const keepCurrentHomepage = this.state.homepageAction === 'keep_current_homepage'; - recordTracksEvent( 'calypso_theme_autoloading_homepage_modal_activate_click', { - theme: installingThemeId, - keep_current_homepage: keepCurrentHomepage, - } ); - return this.props.activateTheme( - installingThemeId, - siteId, - source, - false, - keepCurrentHomepage - ); - } else if ( 'keepCurrentTheme' === action ) { - recordTracksEvent( 'calypso_theme_autoloading_homepage_modal_dismiss', { - action: 'button', - theme: installingThemeId, - } ); - return this.props.hideAutoLoadingHomepageWarning(); - } else if ( 'dismiss' === action ) { - recordTracksEvent( 'calypso_theme_autoloading_homepage_modal_dismiss', { - action: 'escape', - theme: installingThemeId, - } ); - return this.props.hideAutoLoadingHomepageWarning(); - } - }; - - render() { - const { - theme, - hasActivated, - isActivating, - hasAutoLoadingHomepage, - isCurrentTheme, - isVisible = false, - } = this.props; - const { isNarrow } = this.state; - - // Nothing to do when it's the current theme. - if ( isCurrentTheme ) { - return null; - } - - // Nothing to show if the theme doesn't have auto loading homepage. - if ( ! hasAutoLoadingHomepage ) { - return null; - } - - // Hide while is activating or when it's activated. - if ( isActivating || hasActivated ) { - return null; - } - - if ( ! theme ) { - return null; - } - - const { - name: themeName, - id: themeId, - stylesheet, - screenshot: themeScreenshot, - } = this.props.theme; - - const iframeSrcKeepHomepage = `//${ this.props.siteDomain }?theme=${ encodeURIComponent( - stylesheet - ) }&hide_banners=true&preview_overlay=true`; - - return ( - - - -
-

- { translate( 'How would you like to use %(themeName)s?', { - args: { themeName }, - } ) } -

-
-
- -
- - { ! isNarrow && ( -