Skip to content

Commit

Permalink
Small refactor to make changes more easy in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
lhkowalski committed May 2, 2024
1 parent 27494b6 commit 01c49fd
Showing 1 changed file with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ export default function () {
const [ showNotice, setShowNotice ] = useState( false );
const { isRegistered } = useConnection();

const videoTitle1 = __(
const videoTitleContentGeneration = __(
'Generate and edit content faster with Jetpack AI Assistant',
'jetpack-my-jetpack'
);
const videoTitle2 = __( 'Build forms using prompts', 'jetpack-my-jetpack' );
const videoTitle3 = __( 'Get feedback on posts', 'jetpack-my-jetpack' );
const videoTitle4 = __( 'Create featured images with one click', 'jetpack-my-jetpack' );
const featuredImageLink = getRedirectUrl( 'jetpack-ai-product-page-featured-image-link' );
const videoTitleFeaturedImages = __(
'Create featured images with one click',
'jetpack-my-jetpack'
);
const videoTitleForms = __( 'Build forms using prompts', 'jetpack-my-jetpack' );
const videoTitleContentFeedback = __( 'Get feedback on posts', 'jetpack-my-jetpack' );

debug( aiAssistantFeature );
const {
Expand All @@ -67,6 +69,7 @@ export default function () {
const showAllTimeUsage = hasPaidTier || hasUnlimited;
const contactHref = getRedirectUrl( 'jetpack-ai-tiers-more-requests-contact' );
const feedbackURL = getRedirectUrl( 'jetpack-ai-feedback' );
const videoLinkFeaturedImages = getRedirectUrl( 'jetpack-ai-product-page-featured-image-link' );

// isRegistered works as a flag to know if the page can link to a post creation or not
const ctaURL = isRegistered
Expand Down Expand Up @@ -266,13 +269,13 @@ export default function () {
src="https://videopress.com/embed/GdXmtVtW?posterUrl=https%3A%2F%2Fjetpackme.files.wordpress.com%2F2024%2F02%2Fimage-37.png%3Fw%3D560"
allowFullScreen
allow="clipboard-write"
title={ videoTitle1 }
title={ videoTitleContentGeneration }
></iframe>
<script src="https://videopress.com/videopress-iframe.js"></script>
</div>
<div className={ styles[ 'product-interstitial__usage-videos-content' ] }>
<div className={ styles[ 'product-interstitial__usage-videos-heading' ] }>
{ videoTitle1 }
{ videoTitleContentGeneration }
</div>
<div className={ styles[ 'product-interstitial__usage-videos-text' ] }>
{ __(
Expand All @@ -298,13 +301,13 @@ export default function () {
src="https://videopress.com/embed/HJCf8cXc?posterUrl=https%3A%2F%2Fjetpackme.files.wordpress.com%2F2024%2F02%2Fone-click-featured-images.png%3Fw%3D560"
allowFullScreen
allow="clipboard-write"
title={ videoTitle4 }
title={ videoTitleFeaturedImages }
></iframe>
<script src="https://videopress.com/videopress-iframe.js"></script>
</div>
<div className={ styles[ 'product-interstitial__usage-videos-content' ] }>
<div className={ styles[ 'product-interstitial__usage-videos-heading' ] }>
{ videoTitle4 }
{ videoTitleFeaturedImages }
</div>
<div className={ styles[ 'product-interstitial__usage-videos-text' ] }>
{ __(
Expand All @@ -316,7 +319,7 @@ export default function () {
className={ styles[ 'product-interstitial__usage-videos-link' ] }
icon={ help }
target="_blank"
href={ featuredImageLink }
href={ videoLinkFeaturedImages }
>
{ __( 'Learn about featured images', 'jetpack-my-jetpack' ) }
</Button>
Expand All @@ -331,13 +334,13 @@ export default function () {
src="https://videopress.com/embed/OMI3zqid?posterUrl=https%3A%2F%2Fjetpackme.files.wordpress.com%2F2024%2F02%2Fimage-38.png%3Fw%3D560"
allowFullScreen
allow="clipboard-write"
title={ videoTitle2 }
title={ videoTitleForms }
></iframe>
<script src="https://videopress.com/videopress-iframe.js"></script>
</div>
<div className={ styles[ 'product-interstitial__usage-videos-content' ] }>
<div className={ styles[ 'product-interstitial__usage-videos-heading' ] }>
{ videoTitle2 }
{ videoTitleForms }
</div>
<div className={ styles[ 'product-interstitial__usage-videos-text' ] }>
{ __(
Expand All @@ -355,6 +358,7 @@ export default function () {
</Button>
</div>
</div>

<div className={ styles[ 'product-interstitial__usage-videos-item' ] }>
<div className={ styles[ 'product-interstitial__usage-videos-video' ] }>
<iframe
Expand All @@ -363,13 +367,13 @@ export default function () {
src="https://videopress.com/embed/0vb0OJm7?posterUrl=https%3A%2F%2Fjetpackme.files.wordpress.com%2F2024%2F02%2Fimage-39.png%3Fw%3D560"
allowFullScreen
allow="clipboard-write"
title={ videoTitle3 }
title={ videoTitleContentFeedback }
></iframe>
<script src="https://videopress.com/videopress-iframe.js"></script>
</div>
<div className={ styles[ 'product-interstitial__usage-videos-content' ] }>
<div className={ styles[ 'product-interstitial__usage-videos-heading' ] }>
{ videoTitle3 }
{ videoTitleContentFeedback }
</div>
<div className={ styles[ 'product-interstitial__usage-videos-text' ] }>
{ __(
Expand Down

0 comments on commit 01c49fd

Please sign in to comment.