diff --git a/client/blocks/product-purchase-features/product-purchase-features-list/custom-domain.jsx b/client/blocks/product-purchase-features/product-purchase-features-list/custom-domain.jsx index 89268475258c5c..0bcdbc808b51e3 100644 --- a/client/blocks/product-purchase-features/product-purchase-features-list/custom-domain.jsx +++ b/client/blocks/product-purchase-features/product-purchase-features-list/custom-domain.jsx @@ -2,19 +2,17 @@ * External dependencies */ import React from 'react'; +import pick from 'lodash/pick'; /** * Internal dependencies */ import CustomDomainPurchaseDetail from 'my-sites/upgrades/checkout-thank-you/custom-domain-purchase-detail'; -export default ( { selectedSite, hasDomainCredit } ) => { +export default ( props ) => { return (
- +
); }; diff --git a/client/blocks/product-purchase-features/product-purchase-features-list/index.jsx b/client/blocks/product-purchase-features/product-purchase-features-list/index.jsx index 9fc7068a9000b9..8f7777a584a8ed 100644 --- a/client/blocks/product-purchase-features/product-purchase-features-list/index.jsx +++ b/client/blocks/product-purchase-features/product-purchase-features-list/index.jsx @@ -34,6 +34,7 @@ import JetpackSurveysPolls from './jetpack-surveys-polls'; import JetpackWordPressCom from './jetpack-wordpress-com'; import { isWordadsInstantActivationEligible } from 'lib/ads/utils'; import { hasDomainCredit } from 'state/sites/plans/selectors'; +import { isPressableSite } from 'state/sites/selectors'; import { getSelectedSite, getSelectedSiteId } from 'state/ui/selectors'; class ProductPurchaseFeaturesList extends Component { @@ -51,13 +52,15 @@ class ProductPurchaseFeaturesList extends Component { getBusinessFeatures() { const { selectedSite, - planHasDomainCredit + planHasDomainCredit, + isPressableSite } = this.props; return [ , { - const renderClaimCustomDomain = () => - selectedSite.plan.user_is_owner - ? { + if ( hasDomainCredit && selectedSite.plan.user_is_owner && ! isPressableSite ) { + return ( - : null; - - const renderHasCustomDomain = () => - } } ) } - buttonText={ translate( 'Manage my domains' ) } - href={ `/domains/manage/${ selectedSite.slug }` } - />; - - const renderCustomDomainDetail = () => { - if ( hasCustomDomain( selectedSite ) ) { - return renderHasCustomDomain(); - } - + { ...actionButton } + /> ); + } else { return null; - }; - - return ( - hasDomainCredit - ? renderClaimCustomDomain() - : renderCustomDomainDetail() - ); + } }; CustomDomainPurchaseDetail.propTypes = { @@ -65,7 +56,8 @@ CustomDomainPurchaseDetail.propTypes = { React.PropTypes.bool, React.PropTypes.object ] ).isRequired, - hasDomainCredit: React.PropTypes.bool + hasDomainCredit: React.PropTypes.bool, + isPressableSite: React.PropTypes.bool }; export default localize( CustomDomainPurchaseDetail ); diff --git a/client/state/sites/reducer.js b/client/state/sites/reducer.js index 60cf61179992fc..0e593ed2908185 100644 --- a/client/state/sites/reducer.js +++ b/client/state/sites/reducer.js @@ -75,11 +75,11 @@ export function items( state = {}, action ) { } return state; - case 'PRESSABLE_ACTIVATE': + case 'PRESSABLE_TEST': const originalSite = state[ action.siteId ]; if ( originalSite ) { return Object.assign( {}, state, { - [ action.siteId ]: merge( {}, originalSite, { options: { pressable: true } } ) + [ action.siteId ]: merge( {}, originalSite, { jetpack: true, options: { pressable: true } } ) } ); } return state;