Skip to content

Commit

Permalink
fix support links
Browse files Browse the repository at this point in the history
  • Loading branch information
kangzj committed Dec 10, 2024
1 parent 3ce0245 commit 527c471
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
3 changes: 3 additions & 0 deletions client/my-sites/stats/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ export const JETPACK_SUPPORT_VIDEOPRESS_URL = 'https://jetpack.com/support/jetpa
export const JETPACK_SUPPORT_VIDEOPRESS_URL_STATS =
'https://jetpack.com/support/jetpack-videopress/add-video-block-editor/video-stats/';
export const JETPACK_VIDEOPRESS_LANDING_PAGE_URL = 'https://jetpack.com/videopress/';
export const WPCOM_PERSONAL_PLAN_SUPPORT =
// eslint-disable-next-line wpcalypso/i18n-unlocalized-url
'https://wordpress.com/support/plan-features/personal-plan/';
14 changes: 13 additions & 1 deletion client/my-sites/stats/stats-upsell/insights-upsell.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { isEnabled } from '@automattic/calypso-config';
import { localizeUrl } from '@automattic/i18n-utils';
import { Button } from '@wordpress/components';
import { useTranslate } from 'i18n-calypso';
import statsFeaturesPNG from 'calypso/assets/images/stats/paid-features-2.png';
import InlineSupportLink from 'calypso/components/inline-support-link';
import { WPCOM_PERSONAL_PLAN_SUPPORT } from '../const';
import { STATS_FEATURE_PAGE_INSIGHTS } from '../constants';
import StatsUpsell from './index';

const InsightsUpsell: React.FC = () => {
const translate = useTranslate();
const isOdysseyStats = isEnabled( 'is_odyssey' );

return (
<StatsUpsell
Expand All @@ -14,8 +19,15 @@ const InsightsUpsell: React.FC = () => {
features={ [
translate( '{{personalFeaturesLink}}All personal plan features{{/personalFeaturesLink}}', {
components: {
personalFeaturesLink: (
personalFeaturesLink: ! isOdysseyStats ? (
<InlineSupportLink supportContext="personal_plan" showIcon={ false } />
) : (
<Button
href={ localizeUrl( WPCOM_PERSONAL_PLAN_SUPPORT ) }
target="_blank"
rel="norefferer nooppener"
variant="link"
/>
),
},
} ),
Expand Down
14 changes: 13 additions & 1 deletion client/my-sites/stats/stats-upsell/traffic-upsell.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { isEnabled } from '@automattic/calypso-config';
import { localizeUrl } from '@automattic/i18n-utils';
import { Button } from '@wordpress/components';
import { useTranslate } from 'i18n-calypso';
import statsFeaturesPNG from 'calypso/assets/images/stats/paid-features.png';
import InlineSupportLink from 'calypso/components/inline-support-link';
import { WPCOM_PERSONAL_PLAN_SUPPORT } from '../const';
import { STATS_FEATURE_PAGE_TRAFFIC } from '../constants';
import StatsUpsell from './index';

const TrafficUpsell: React.FC = () => {
const translate = useTranslate();
const isOdysseyStats = isEnabled( 'is_odyssey' );

return (
<StatsUpsell
Expand All @@ -14,8 +19,15 @@ const TrafficUpsell: React.FC = () => {
features={ [
translate( '{{personalFeaturesLink}}All personal plan features{{/personalFeaturesLink}}', {
components: {
personalFeaturesLink: (
personalFeaturesLink: ! isOdysseyStats ? (
<InlineSupportLink supportContext="personal_plan" showIcon={ false } />
) : (
<Button
href={ localizeUrl( WPCOM_PERSONAL_PLAN_SUPPORT ) }
target="_blank"
rel="norefferer"
variant="link"
/>
),
},
} ),
Expand Down

0 comments on commit 527c471

Please sign in to comment.