diff --git a/client/my-sites/plans/current-plan/current-plan-thank-you/search-thank-you.js b/client/my-sites/plans/current-plan/current-plan-thank-you/search-thank-you.js index e7999f5e0c062..7f56bc3299d2a 100644 --- a/client/my-sites/plans/current-plan/current-plan-thank-you/search-thank-you.js +++ b/client/my-sites/plans/current-plan/current-plan-thank-you/search-thank-you.js @@ -2,27 +2,37 @@ * External dependencies */ import React from 'react'; -import { localize } from 'i18n-calypso'; +import { useTranslate } from 'i18n-calypso'; /** * Internal dependencies */ import ThankYou from './thank-you'; +import versionCompare from 'lib/version-compare'; -const SearchProductThankYou = ( { translate } ) => ( - -

{ translate( 'We are currently indexing your site.' ) }

-

- { translate( - 'In the meantime, we have configured Jetpack Search on your site — ' + - 'you should try customizing it in your traditional WordPress dashboard.' - ) } -

-
-); +function SearchProductThankYou( { jetpackVersion } ) { + const translate = useTranslate(); + return ( + +

{ translate( 'We are currently indexing your site.' ) }

+

+ { jetpackVersion && versionCompare( jetpackVersion, '8.4', '<' ) + ? translate( + "In the meantime you'll need to update Jetpack to version 8.4 or higher in order " + + "to get the most out of Jetpack Search. Once you've updated Jetpack, " + + "we'll configure Search for you. You can try search and customize it to your liking." + ) + : translate( + 'In the meantime, we have configured Jetpack Search on your site — ' + + 'you should try customizing it in your traditional WordPress dashboard.' + ) } +

+
+ ); +} -export default localize( SearchProductThankYou ); +export default SearchProductThankYou; diff --git a/client/my-sites/plans/current-plan/current-plan-thank-you/thank-you.js b/client/my-sites/plans/current-plan/current-plan-thank-you/thank-you.js index c61a3eea372f9..74aed9820684e 100644 --- a/client/my-sites/plans/current-plan/current-plan-thank-you/thank-you.js +++ b/client/my-sites/plans/current-plan/current-plan-thank-you/thank-you.js @@ -4,6 +4,7 @@ import { isDesktop } from '@automattic/viewport'; import { connect } from 'react-redux'; import { localize } from 'i18n-calypso'; +import { get } from 'lodash'; import React, { Component } from 'react'; /** @@ -15,11 +16,12 @@ import { Button } from '@automattic/components'; import getCurrentQueryArguments from 'state/selectors/get-current-query-arguments'; import getCurrentRoute from 'state/selectors/get-current-route'; import { addQueryArgs } from 'lib/url'; -import { getSelectedSiteId } from 'state/ui/selectors'; +import { getSelectedSite, getSelectedSiteId } from 'state/ui/selectors'; import { getSiteAdminUrl, getSiteSlug } from 'state/sites/selectors'; import getPrimarySiteId from 'state/selectors/get-primary-site-id'; import { getCurrentUser } from 'state/current-user/selectors'; import { recordTracksEvent } from 'state/analytics/actions'; +import versionCompare from 'lib/version-compare'; import './style.scss'; @@ -41,6 +43,7 @@ export class ThankYouCard extends Component { showSearchRedirects, showScanCTAs, siteAdminUrl, + selectedSite, selectedSiteSlug, title, translate, @@ -62,6 +65,8 @@ export class ThankYouCard extends Component { } ); }; + const jetpackVersion = get( selectedSite, 'options.jetpack_version', 0 ); + return (
{ illustration && ( @@ -106,10 +111,16 @@ export class ThankYouCard extends Component {

) } @@ -132,6 +143,7 @@ export class ThankYouCard extends Component { export default connect( ( state ) => { const currentUser = getCurrentUser( state ); + const selectedSite = getSelectedSite( state ); const selectedSiteId = getSelectedSiteId( state ); const selectedSiteSlug = getSiteSlug( state, selectedSiteId ); const isSingleSite = !! selectedSiteId || currentUser.site_count === 1; @@ -139,6 +151,7 @@ export default connect( const siteAdminUrl = getSiteAdminUrl( state, siteId ); return { siteAdminUrl, + selectedSite, selectedSiteSlug, currentRoute: getCurrentRoute( state ), queryArgs: getCurrentQueryArguments( state ), diff --git a/client/my-sites/plans/current-plan/index.jsx b/client/my-sites/plans/current-plan/index.jsx index 44dc6565954e0..c1c3880279b36 100644 --- a/client/my-sites/plans/current-plan/index.jsx +++ b/client/my-sites/plans/current-plan/index.jsx @@ -2,7 +2,7 @@ * External dependencies */ import React, { Component, Fragment } from 'react'; -import { startsWith } from 'lodash'; +import { get, startsWith } from 'lodash'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { connect } from 'react-redux'; @@ -78,7 +78,7 @@ class CurrentPlan extends Component { } renderThankYou() { - const { currentPlan, product } = this.props; + const { currentPlan, product, selectedSite } = this.props; if ( startsWith( product, 'jetpack_backup' ) ) { return ; @@ -89,7 +89,9 @@ class CurrentPlan extends Component { } if ( startsWith( product, 'jetpack_search' ) ) { - return ; + const jetpackVersion = get( selectedSite, 'options.jetpack_version', 0 ); + + return ; } if ( ! currentPlan || isFreePlan( currentPlan ) || isFreeJetpackPlan( currentPlan ) ) {