mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
2ca51e82cd
GitOrigin-RevId: 55c3d00e0e0fdeb5a63cefac3f1c1428ce01cc9a
57 lines
1.4 KiB
TypeScript
57 lines
1.4 KiB
TypeScript
import { Trans } from 'react-i18next'
|
|
import getMeta from '../../../../utils/meta'
|
|
import * as eventTracking from '../../../../infrastructure/event-tracking'
|
|
import { useSubscriptionDashboardContext } from '../../context/subscription-dashboard-context'
|
|
|
|
function PremiumFeaturesLink() {
|
|
const { hasValidActiveSubscription } = useSubscriptionDashboardContext()
|
|
|
|
if (!hasValidActiveSubscription) {
|
|
return null
|
|
}
|
|
|
|
const featuresPageVariant =
|
|
getMeta('ol-splitTestVariants')?.['features-page'] || 'default'
|
|
|
|
function handleLinkClick() {
|
|
eventTracking.sendMB('features-page-link', {
|
|
splitTest: 'features-page',
|
|
splitTestVariant: featuresPageVariant,
|
|
})
|
|
}
|
|
|
|
const featuresPageLink = (
|
|
// translation adds content
|
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
<a
|
|
href={
|
|
featuresPageVariant === 'new'
|
|
? '/about/features-overview'
|
|
: '/learn/how-to/Overleaf_premium_features'
|
|
}
|
|
onClick={handleLinkClick}
|
|
/>
|
|
)
|
|
|
|
if (featuresPageVariant === 'new') {
|
|
return (
|
|
<p>
|
|
<Trans
|
|
i18nKey="get_most_subscription_by_checking_features"
|
|
components={[featuresPageLink]}
|
|
/>
|
|
</p>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<p>
|
|
<Trans
|
|
i18nKey="get_most_subscription_by_checking_premium_features"
|
|
components={[featuresPageLink]}
|
|
/>
|
|
</p>
|
|
)
|
|
}
|
|
|
|
export default PremiumFeaturesLink
|