Skip to content

Commit

Permalink
update paygate page
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelmsmith committed Jan 26, 2024
1 parent aced9f9 commit 590842d
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions frontend/src/lib/components/PayGatePage/PayGatePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { useValues } from 'kea'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { identifierToHuman } from 'lib/utils'
import { billingLogic } from 'scenes/billing/billingLogic'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { urls } from 'scenes/urls'

import { AvailableFeature } from '~/types'

Expand All @@ -26,19 +28,34 @@ export function PayGatePage({
featureName,
}: PayGatePageInterface): JSX.Element {
const { upgradeLink } = useValues(billingLogic)
const { isCloudOrDev } = useValues(preflightLogic)
featureName = featureName || identifierToHuman(featureKey, 'title')

return (
<div className="pay-gate-page">
<h2>{header}</h2>
<div className="pay-caption">{caption}</div>
<div className="pay-buttons space-y-4">
{!isCloudOrDev && <p>This feature is available on PostHog Cloud.</p>}
{!hideUpgradeButton && (
<LemonButton to={upgradeLink} type="primary" data-attr={`${featureKey}-upgrade`} center>
Upgrade now to get {featureName}
</LemonButton>
<>
{isCloudOrDev ? (
<LemonButton to={upgradeLink} type="primary" data-attr={`${featureKey}-upgrade`} center>
Upgrade now to get {featureName}
</LemonButton>
) : (
<LemonButton
to={urls.upgradeToPostHogCloud()}
type="primary"
data-attr={`${featureKey}-upgrade`}
center
>
Learn more about PostHog cloud
</LemonButton>
)}
</>
)}
{docsLink && (
{docsLink && isCloudOrDev && (
<LemonButton
type={hideUpgradeButton ? 'primary' : 'secondary'}
to={`${docsLink}?utm_medium=in-product&utm_campaign=${featureKey}-upgrade-learn-more`}
Expand Down

0 comments on commit 590842d

Please sign in to comment.