Add copy that WCS TOS will be accepted upon install. (https://github.com/woocommerce/woocommerce-admin/pull/4799)

* Add copy that WCS TOS will be accepted upon install.

* Remove unused getAdminLink import.

Co-authored-by: Timmy Crawford <timmydcrawford@gmail.com>
This commit is contained in:
Chris Shultz 2020-07-21 17:11:11 -07:00 committed by GitHub
parent a82d359a5e
commit 795c6ca585
1 changed files with 37 additions and 14 deletions

View File

@ -7,11 +7,12 @@ import { Component } from '@wordpress/element';
import { compose } from '@wordpress/compose';
import { withDispatch, withSelect } from '@wordpress/data';
import { filter } from 'lodash';
import interpolateComponents from 'interpolate-components';
/**
* WooCommerce dependencies
*/
import { Card, H } from '@woocommerce/components';
import { Card, H, Link } from '@woocommerce/components';
import {
pluginNames,
ONBOARDING_STORE_NAME,
@ -212,6 +213,13 @@ class Benefits extends Component {
);
const isInstallAction =
isInstallingActivating || ! pluginsRemaining.length;
const isAcceptingTos = ! this.isWcsActive;
const pluralizedPlugins = _n(
'plugin',
'plugins',
this.pluginsToInstall.length,
'woocommerce-admin'
);
return (
<Card className="woocommerce-profile-wizard__benefits-card">
@ -246,18 +254,33 @@ class Benefits extends Component {
</div>
<p className="woocommerce-profile-wizard__benefits-install-notice">
{ sprintf(
{ isAcceptingTos
? interpolateComponents( {
mixedString: sprintf(
__(
'%s %s will be installed & activated for free, and you agree to our {{link}}Terms of Service{{/link}}.',
'woocommerce-admin'
),
pluginNamesString,
pluralizedPlugins
),
components: {
link: (
<Link
href="https://wordpress.com/tos/"
target="_blank"
type="external"
/>
),
},
} )
: sprintf(
__(
'%s %s will be installed & activated for free.',
'woocommerce-admin'
),
pluginNamesString,
_n(
'plugin',
'plugins',
this.pluginsToInstall.length,
'woocommerce-admin'
)
pluralizedPlugins
) }
</p>
</Card>