Skip to content

Commit d88f389

Browse files
authored
Jetpack Backup: Cleanup all <p>s from descriptions (#37203)
* Jetpack Backup: Cleanup all <p>s from descriptions * Fix proptypes
1 parent ac415d0 commit d88f389

File tree

3 files changed

+26
-38
lines changed

3 files changed

+26
-38
lines changed

client/blocks/product-selector/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ ProductSelector.propTypes = {
283283
PropTypes.shape( {
284284
title: PropTypes.string,
285285
id: PropTypes.string,
286-
description: PropTypes.oneOfType( [ PropTypes.string, PropTypes.element ] ),
286+
description: PropTypes.oneOfType( [ PropTypes.string, PropTypes.element, PropTypes.node ] ),
287287
options: PropTypes.objectOf( PropTypes.arrayOf( PropTypes.string ) ).isRequired,
288288
optionDescriptions: PropTypes.objectOf(
289-
PropTypes.oneOfType( [ PropTypes.string, PropTypes.element ] )
289+
PropTypes.oneOfType( [ PropTypes.string, PropTypes.element, PropTypes.node ] )
290290
),
291291
optionDisplayNames: PropTypes.objectOf(
292292
PropTypes.oneOfType( [ PropTypes.string, PropTypes.element ] )

client/components/product-card/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const ProductCard = ( {
6666
</a>
6767
</p>
6868
) }
69-
{ description }
69+
{ description && <p>{ description }</p> }
7070
</div>
7171
{ children }
7272
</Card>
@@ -76,7 +76,7 @@ const ProductCard = ( {
7676
ProductCard.propTypes = {
7777
billingTimeFrame: PropTypes.string,
7878
currencyCode: PropTypes.string,
79-
description: PropTypes.oneOfType( [ PropTypes.string, PropTypes.element ] ),
79+
description: PropTypes.oneOfType( [ PropTypes.string, PropTypes.element, PropTypes.node ] ),
8080
discountedPrice: PropTypes.oneOfType( [
8181
PropTypes.number,
8282
PropTypes.arrayOf( PropTypes.number ),

client/lib/products-values/constants.js

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -55,42 +55,30 @@ export const JETPACK_BACKUP_PRODUCT_DISPLAY_NAMES = {
5555
[ PRODUCT_JETPACK_BACKUP_REALTIME_MONTHLY ]: JETPACK_BACKUP_PRODUCT_REALTIME_DISPLAY_NAME,
5656
};
5757

58-
export const PRODUCT_JETPACK_BACKUP_DESCRIPTION = (
59-
<p>
60-
{ translate(
61-
'Always-on backups ensure you never lose your site. Choose from real-time or daily backups. {{a}}Which one do I need?{{/a}}',
62-
{
63-
components: {
64-
a: (
65-
<a
66-
href="https://jetpack.com/upgrade/backup/"
67-
target="_blank"
68-
rel="noopener noreferrer"
69-
/>
70-
),
71-
},
72-
}
73-
) }
74-
</p>
58+
export const PRODUCT_JETPACK_BACKUP_DESCRIPTION = translate(
59+
'Always-on backups ensure you never lose your site. Choose from real-time or daily backups. {{a}}Which one do I need?{{/a}}',
60+
{
61+
components: {
62+
a: (
63+
<a
64+
href="https://jetpack.com/upgrade/backup/"
65+
target="_blank"
66+
rel="noopener noreferrer"
67+
/>
68+
),
69+
},
70+
}
7571
);
76-
export const PRODUCT_JETPACK_BACKUP_DAILY_DESCRIPTION = (
77-
<p>
78-
{ translate(
79-
'{{strong}}Looking for more?{{/strong}} With Real-time backups, we save as you edit and you’ll get unlimited backup archives.',
80-
{
81-
components: {
82-
strong: <strong />,
83-
},
84-
}
85-
) }
86-
</p>
72+
export const PRODUCT_JETPACK_BACKUP_DAILY_DESCRIPTION = translate(
73+
'{{strong}}Looking for more?{{/strong}} With Real-time backups, we save as you edit and you’ll get unlimited backup archives.',
74+
{
75+
components: {
76+
strong: <strong />,
77+
},
78+
}
8779
);
88-
export const PRODUCT_JETPACK_BACKUP_REALTIME_DESCRIPTION = (
89-
<p>
90-
{ translate(
91-
'Always-on backups ensure you never lose your site. Your changes are saved as you edit and you have unlimited backup archives.'
92-
) }
93-
</p>
80+
export const PRODUCT_JETPACK_BACKUP_REALTIME_DESCRIPTION = translate(
81+
'Always-on backups ensure you never lose your site. Your changes are saved as you edit and you have unlimited backup archives.'
9482
);
9583

9684
export const JETPACK_BACKUP_PRODUCT_DESCRIPTIONS = {

0 commit comments

Comments
 (0)