-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Business Tools: Refactor to extract component logic to a data component
- Loading branch information
Showing
3 changed files
with
144 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
client/sites/marketing/tools/marketing-features-data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import page from '@automattic/calypso-router'; | ||
import { localizeUrl } from '@automattic/i18n-utils'; | ||
import { translate } from 'i18n-calypso'; | ||
import fiverrLogo from 'calypso/assets/images/customer-home/fiverr-logo.svg'; | ||
import rocket from 'calypso/assets/images/customer-home/illustration--rocket.svg'; | ||
import earnIllustration from 'calypso/assets/images/customer-home/illustration--task-earn.svg'; | ||
import wordPressLogo from 'calypso/assets/images/icons/wordpress-logo.svg'; | ||
import { marketingConnections } from 'calypso/my-sites/marketing/paths'; | ||
import * as T from 'calypso/types'; | ||
import { MarketingToolsFeatureData } from './types'; | ||
|
||
export const getMarketingFeaturesData = ( | ||
selectedSiteSlug: T.SiteSlug | null, | ||
recordTracksEvent: ( event: string ) => void | ||
): MarketingToolsFeatureData[] => [ | ||
{ | ||
title: translate( 'Let our WordPress.com experts build your site!' ), | ||
description: translate( | ||
"Hire our dedicated experts to build a handcrafted, personalized website. Share some details about what you're looking for, and we'll make it happen." | ||
), | ||
imagePath: wordPressLogo, | ||
buttonText: translate( 'Get started' ), | ||
buttonHref: localizeUrl( 'https://wordpress.com/website-design-service/?ref=tools-banner' ), | ||
buttonTarget: '_blank', | ||
onClick: () => { | ||
recordTracksEvent( 'calypso_marketing_tools_built_by_wp_button_click' ); | ||
}, | ||
}, | ||
{ | ||
title: translate( 'Monetize your site' ), | ||
description: translate( | ||
'Accept payments or donations with our native payment blocks, limit content to paid subscribers only, opt into our ad network to earn revenue, and refer friends to WordPress.com for credits.' | ||
), | ||
imagePath: earnIllustration, | ||
imageAlt: translate( 'A stack of coins' ), | ||
buttonText: translate( 'Start earning' ), | ||
onClick: () => { | ||
recordTracksEvent( 'calypso_marketing_tools_earn_button_click' ); | ||
|
||
page( `/earn/${ selectedSiteSlug }` ); | ||
}, | ||
}, | ||
{ | ||
title: translate( 'Fiverr logo maker' ), | ||
description: translate( | ||
'Create a standout brand with a custom logo. Our partner makes it easy and quick to design a professional logo that leaves a lasting impression.' | ||
), | ||
imagePath: fiverrLogo, | ||
imageAlt: translate( 'Fiverr logo' ), | ||
buttonText: translate( 'Make your brand' ), | ||
buttonHref: 'https://wp.me/logo-maker/?utm_campaign=marketing_tab', | ||
buttonTarget: '_blank', | ||
onClick: () => { | ||
recordTracksEvent( 'calypso_marketing_tools_create_a_logo_button_click' ); | ||
}, | ||
}, | ||
{ | ||
title: translate( 'Hire an SEO expert' ), | ||
description: translate( | ||
'In today‘s digital age, visibility is key. Hire an SEO expert to boost your online presence and capture valuable opportunities.' | ||
), | ||
imagePath: fiverrLogo, | ||
imageAlt: translate( 'Fiverr logo' ), | ||
buttonText: translate( 'Talk to an SEO expert today' ), | ||
buttonHref: 'https://wp.me/hire-seo-expert/?utm_source=marketing_tab', | ||
buttonTarget: '_blank', | ||
onClick: () => { | ||
recordTracksEvent( 'calypso_marketing_tools_hire_an_seo_expert_button_click' ); | ||
}, | ||
}, | ||
{ | ||
title: translate( 'Get social, and share your blog posts where the people are' ), | ||
description: translate( | ||
"Use your site's Jetpack Social tools to connect your site and your social media accounts, and share your new posts automatically. Connect to Facebook, LinkedIn, and more." | ||
), | ||
imagePath: '/calypso/images/marketing/social-media-logos.svg', | ||
imageAlt: translate( 'Logos for Facebook, Twitter, LinkedIn, and Tumblr' ), | ||
buttonText: translate( 'Start sharing' ), | ||
onClick: () => { | ||
recordTracksEvent( 'calypso_marketing_tools_start_sharing_button_click' ); | ||
|
||
page( marketingConnections( selectedSiteSlug ) ); | ||
}, | ||
}, | ||
{ | ||
title: translate( 'Increase traffic to your WordPress.com site' ), | ||
description: translate( | ||
'Take our free introductory course about search engine optimization (SEO) and learn how to improve your site or blog for both search engines and humans.' | ||
), | ||
imagePath: rocket, | ||
imageAlt: translate( 'A rocketship' ), | ||
buttonText: translate( 'Register now' ), | ||
buttonHref: 'https://wordpress.com/learn/courses/intro-to-seo/', | ||
buttonTarget: '_blank', | ||
onClick: () => { | ||
recordTracksEvent( 'calypso_marketing_tools_seo_course_button_click' ); | ||
}, | ||
showOnlyInEnglish: true, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export interface MarketingToolsFeatureData { | ||
title: string; | ||
description: string; | ||
imagePath: string; | ||
imageAlt?: string; | ||
buttonText: string; | ||
buttonHref?: string; | ||
buttonTarget?: '_blank' | '_self'; | ||
onClick?: () => void; | ||
showOnlyInEnglish?: boolean; | ||
} |