Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update copy of Security Real-time upgrade nudge #45081

Merged
merged 1 commit into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions client/components/jetpack/card/jetpack-product-card/fixtures.ts

This file was deleted.

32 changes: 32 additions & 0 deletions client/components/jetpack/card/jetpack-product-card/fixtures.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* External dependencies
*/
import { translate } from 'i18n-calypso';
import React from 'react';

// TODO: replace this hardcoded data with real data when we have an endpoint for it or
// a more definitive place in our own codebase.
export const DEFAULT_UPGRADE_NUDGE_FEATURES = [
{
text: translate(
'{{strong}}Backup {{em}}Real-time{{/em}}{{/strong}} Backs up your site as you edit',
{
components: {
strong: <strong />,
em: <em />,
},
}
),
},
{
text: translate( '{{strong}}Scan {{em}}Real-time{{/em}}{{/strong}} Always-on site protection', {
components: {
strong: <strong />,
em: <em />,
},
} ),
},
{
text: translate( 'All Jetpack security features for comprehensive protection' ),
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ type OwnProps = {
features?: ProductCardFeaturesItem[];
onUpgradeClick: () => void;
originalPrice: number;
productType?: TranslateResult;
selectorProduct: SelectorProduct;
};

Expand All @@ -46,7 +45,6 @@ const UpgradeNudge = ( {
onUpgradeClick,
originalPrice,
selectorProduct,
productType = 'Real-time',
}: OwnProps ) => {
const translate = useTranslate();
const isDiscounted = isFinite( discountedPrice );
Expand All @@ -55,7 +53,7 @@ const UpgradeNudge = ( {
getPreference( state, JETPACK_OFFER_RESET_UPGRADE_NUDGE_DISMISS )
);

const { description, productSlug } = selectorProduct;
const { description, productSlug, displayName } = selectorProduct;

// Save dismiss to never show up the nudge again for this specific plan/product.
const dispatch = useDispatch();
Expand All @@ -82,7 +80,7 @@ const UpgradeNudge = ( {
comment: 'to be accompanied with a product subtype such as "Real-time"',
} ) }
<br />
<span className="jetpack-product-card__nudge-product-type">{ productType }</span>
<span className="jetpack-product-card__nudge-product-type">{ displayName }</span>
</h3>
</div>
<div className="jetpack-product-card__price">
Expand All @@ -109,11 +107,7 @@ const UpgradeNudge = ( {
{ features.map( ( feature, index ) => (
<li className="jetpack-product-card__nudge-feature" key={ index }>
<Gridicon icon="checkmark" />
<div className="jetpack-product-card__nudge-feature-desc">
<strong>{ feature.text }</strong>
<br />
{ feature.description }
</div>
<div className="jetpack-product-card__nudge-feature-desc">{ feature.text }</div>
</li>
) ) }
</ul>
Expand Down