-
Notifications
You must be signed in to change notification settings - Fork 800
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
Add value to inactive state of VideoPress #38748
Changes from 30 commits
de372d3
2547376
69645be
da7d827
6c4d3f7
e339c8c
998122f
90ce328
38cdfad
939db2c
bb9b9b5
26f8d35
c4223dc
9896c0c
b8b6ff2
8e79bdb
866075e
f6f1056
4dd7d3e
c2d5208
ee0ce3e
023ec96
07c1aae
83a13dc
8c96cdb
24e5b5b
db9e4c3
680a968
983ba18
978528e
a6a16fa
64a0ec0
3838a41
80cffa0
d889837
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fixed | ||
|
||
Fix type for tracking product string |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,21 +15,23 @@ import useProduct from '../../data/products/use-product'; | |
import useAnalytics from '../../hooks/use-analytics'; | ||
import useMyJetpackConnection from '../../hooks/use-my-jetpack-connection'; | ||
import useMyJetpackNavigate from '../../hooks/use-my-jetpack-navigate'; | ||
import preventWidows from '../../utils/prevent-widows'; | ||
import ProductCard from '../product-card'; | ||
import type { AdditionalAction, SecondaryAction } from '../product-card/types'; | ||
import type { FC, ReactNode } from 'react'; | ||
|
||
interface ConnectedProductCardProps { | ||
admin: boolean; | ||
recommendation: boolean; | ||
recommendation?: boolean; | ||
showMenu?: boolean; | ||
slug: JetpackModule; | ||
children: ReactNode; | ||
children?: ReactNode; | ||
isDataLoading?: boolean; | ||
Description?: FC; | ||
additionalActions?: AdditionalAction[]; | ||
secondaryAction?: SecondaryAction; | ||
upgradeInInterstitial?: boolean; | ||
primaryActionOverride?: AdditionalAction; | ||
primaryActionOverride?: { [ key: string ]: AdditionalAction }; | ||
onMouseEnter?: () => void; | ||
onMouseLeave?: () => void; | ||
} | ||
|
@@ -85,7 +87,7 @@ const ConnectedProductCard: FC< ConnectedProductCardProps > = ( { | |
|
||
const DefaultDescription = () => { | ||
// Replace the last space with a non-breaking space to prevent widows | ||
const cardDescription = defaultDescription.replace( /\s(?=[^\s]*$)/, '\u00A0' ); | ||
const cardDescription = preventWidows( defaultDescription ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reducing technical debt 💪 great! |
||
|
||
return ( | ||
<Text variant="body-small" style={ { flexGrow: 1, marginBottom: '1rem' } }> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import { PRODUCT_SLUGS } from '../../data/constants'; | ||
import ProductCard from '../connected-product-card'; | ||
|
||
const AiCard = props => { | ||
return <ProductCard slug="jetpack-ai" upgradeInInterstitial { ...props } />; | ||
return <ProductCard slug={ PRODUCT_SLUGS.JETPACK_AI } upgradeInInterstitial { ...props } />; | ||
}; | ||
|
||
export default AiCard; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { Container, Col, Text, AdminSectionHero } from '@automattic/jetpack-components'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { useMemo } from 'react'; | ||
import { PRODUCT_SLUGS } from '../../data/constants'; | ||
import { getMyJetpackWindowInitialState } from '../../data/utils/get-my-jetpack-window-state'; | ||
import StatsSection from '../stats-section'; | ||
import AiCard from './ai-card'; | ||
|
@@ -23,7 +24,7 @@ type DisplayItemsProps = { | |
|
||
type DisplayItemType = Record< | ||
// We don't have a card for Security or Extras, and scan is displayed as protect. | ||
Exclude< JetpackModule, 'extras' | 'scan' | 'security' >, | ||
Exclude< JetpackModule, 'extras' | 'scan' | 'security' | 'ai' >, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's update the comment above as well. Currently it's a bit confusing because in a way "ai" card is displayed (I'm aware it's about reducing redundancy of "jetpack-ai" and "ai" - but I might forget it in ~3 months 😅) |
||
FC< { admin: boolean } > | ||
>; | ||
|
||
|
@@ -46,7 +47,7 @@ const DisplayItems: FC< DisplayItemsProps > = ( { slugs } ) => { | |
}; | ||
|
||
const filteredSlugs = slugs.filter( slug => { | ||
if ( slug === 'stats' && showFullJetpackStatsCard ) { | ||
if ( slug === PRODUCT_SLUGS.STATS && showFullJetpackStatsCard ) { | ||
return false; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,15 +1,12 @@ | ||||||
import { type FC } from 'react'; | ||||||
import { PRODUCT_SLUGS } from '../../../data/constants'; | ||||||
import ProductCard from '../../connected-product-card'; | ||||||
import ProtectValueSection from './protect-value-section'; | ||||||
import type { ProductCardComponent } from '../types'; | ||||||
|
||||||
const ProtectCard: FC< { admin: boolean; recommendation?: boolean } > = props => { | ||||||
const slug = 'protect'; | ||||||
|
||||||
return ( | ||||||
<ProductCard { ...props } slug={ slug } upgradeInInterstitial={ true }> | ||||||
<ProtectValueSection /> | ||||||
</ProductCard> | ||||||
); | ||||||
}; | ||||||
const ProtectCard: ProductCardComponent = props => ( | ||||||
<ProductCard { ...props } slug={ PRODUCT_SLUGS.PROTECT } upgradeInInterstitial={ true }> | ||||||
<ProtectValueSection /> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</ProductCard> | ||||||
); | ||||||
|
||||||
export default ProtectCard; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { FC } from 'react'; | ||
|
||
export type ProductCardComponent = FC< { | ||
admin: boolean; | ||
recommendation?: boolean; | ||
} >; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.