Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Experiment with language on billing pages in app #20567

Merged
merged 66 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
f96e4d8
toggle upgrade language depending on flag value
Feb 27, 2024
99653cc
forgot some local changes
Feb 27, 2024
8f4728c
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Feb 29, 2024
24472cf
update credit card case language
Feb 29, 2024
b126319
Update UI snapshots for `chromium` (1)
github-actions[bot] Feb 29, 2024
eab15c7
add event to record subscription status
Mar 1, 2024
756e0eb
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 1, 2024
060cab2
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 1, 2024
a36121c
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 1, 2024
c598759
add tests
Mar 1, 2024
bd3c9d4
remove length check
Mar 1, 2024
f156bd1
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 2, 2024
2020dd7
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 4, 2024
3b6537f
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 4, 2024
bdd10b4
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 4, 2024
809f967
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 4, 2024
86ea4b1
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 4, 2024
cae427d
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 4, 2024
e7be167
make common button component
Mar 4, 2024
7b398db
some more small changes
Mar 5, 2024
f7b0efa
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 5, 2024
0aa359c
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 5, 2024
f6c6dec
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 5, 2024
eebfea9
remove extraneous files
Mar 5, 2024
811bd28
remove optional chaining
Mar 5, 2024
3a60b37
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 5, 2024
37c8aba
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 5, 2024
c1053d7
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 5, 2024
eee2dbf
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 6, 2024
b05947d
remove test...rename event
Mar 6, 2024
e5f1928
Merge branch 'master' into by/billing-page-language
xrdt Mar 6, 2024
770e636
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 6, 2024
6872e41
didn't save before commiting
Mar 6, 2024
e750e0c
undo changes to billing cypress test
Mar 6, 2024
c94aa31
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 6, 2024
66db709
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 6, 2024
e3d8e41
finally get cypress to work!
Mar 7, 2024
578068f
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 7, 2024
f9de718
small fix to test
Mar 7, 2024
e89e47c
Merge remote-tracking branch 'origin' into by/billing-page-language
Mar 7, 2024
1bee5a0
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 7, 2024
15c0b1c
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 7, 2024
0c06558
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 13, 2024
74a0b70
remove from paygate mini
Mar 13, 2024
22fa7de
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 13, 2024
2859414
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 13, 2024
195b386
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 13, 2024
9e3d648
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 14, 2024
3dbfcbc
remove paygate test
Mar 14, 2024
4b63d15
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 14, 2024
8195a88
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 14, 2024
d9075e4
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 14, 2024
80d1bf7
remove extraneous files
Mar 14, 2024
1dd2cfd
remove files!
Mar 14, 2024
c78fbf5
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 14, 2024
2f726c2
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 14, 2024
4f9625d
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 14, 2024
b230f95
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 14, 2024
96e2d8d
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 14, 2024
58dff56
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 14, 2024
4adb470
Merge branch 'master' into by/billing-page-language
raquelmsmith Mar 14, 2024
fa83cfc
update tests
Mar 15, 2024
e4874b3
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 18, 2024
e82d259
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 18, 2024
88e10ac
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 18, 2024
518f7fd
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions cypress/e2e/billingUpgrade.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { decideResponse } from '../fixtures/api/decide'
import * as fflate from 'fflate'

// Mainly testing to make sure events are fired as expected

describe('Exporting Insights', () => {
beforeEach(() => {
cy.intercept('https://app.posthog.com/decide/*', (req) =>
req.reply(
decideResponse({
'billing-upgrade-language': 'credit_card',
})
)
)

cy.intercept('POST', '**/e/?compression=gzip-js*').as('capture')
})

it('Check that events are being sent on each page visit', () => {
// Navigate to any page
cy.visit('/insights')
// Try to create a new project
cy.get('[data-attr=breadcrumb-project').click()
cy.get('[data-attr=new-project-button').click()
cy.get('[data-attr=upgrade-modal]').should('be.visible')
cy.wait('@capture').then(({ request }) => {
const data = new Uint8Array(request.body)
const decoded = fflate.strFromU8(fflate.decompressSync(data))
const decodedJSON = JSON.parse(decoded)

const matchingEvents = decodedJSON.filter((event) => event.event === 'report subscription status')
expect(matchingEvents.length).to.equal(1)
expect(matchingEvents[0].properties.has_active_subscription).to.equal(false)
})

cy.visit('/organization/billing')
cy.wait('@capture').then(({ request }) => {
const data = new Uint8Array(request.body)
const decoded = fflate.strFromU8(fflate.decompressSync(data))
const decodedJSON = JSON.parse(decoded)

const matchingEvents = decodedJSON.filter((event) => event.event === 'report subscription status')
expect(matchingEvents.length).to.equal(1)
expect(matchingEvents[0].properties.has_active_subscription).to.equal(false)
})

// Mock billing response with subscription
cy.intercept('/api/billing-v2/', { fixture: 'api/billing-v2/billing-v2.json' })
cy.reload()
cy.wait('@capture').then(({ request }) => {
const data = new Uint8Array(request.body)
const decoded = fflate.strFromU8(fflate.decompressSync(data))
const decodedJSON = JSON.parse(decoded)

const matchingEvents = decodedJSON
.filter((event) => event.event === 'report subscription status')
.sort((eventA, eventB) => (new Date(eventA.timestamp) < new Date(eventB.timestamp) ? 1 : -1))
xrdt marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't need these sorts but will wait until the general event capture issue is resolved to remove.

expect(matchingEvents[0].properties.has_active_subscription).to.equal(true)
})

// Navigate to the onboarding billing step
cy.visit('/products')
cy.get('[data-attr=product_analytics-onboarding-card]').click()
cy.get('[data-attr=onboarding-breadcrumbs] > :nth-child(5)').click()
cy.wait('@capture').then(({ request }) => {
const data = new Uint8Array(request.body)
const decoded = fflate.strFromU8(fflate.decompressSync(data))
const decodedJSON = JSON.parse(decoded)

const matchingEvents = decodedJSON
.filter((event) => event.event === 'report subscription status')
.sort((eventA, eventB) => (new Date(eventA.timestamp) < new Date(eventB.timestamp) ? 1 : -1))
console.log(matchingEvents)
expect(matchingEvents[0].properties.has_active_subscription).to.equal(true)
})
})
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/src/layout/navigation/ProjectSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function ProjectSwitcherOverlay({ onClickInside }: { onClickInside?: () =
fullWidth
disabled={!!projectCreationForbiddenReason}
tooltip={projectCreationForbiddenReason}
data-attr="new-project-button"
onClick={() => {
onClickInside?.()
guardAvailableFeature(
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export const FEATURE_FLAGS = {
REPLAY_SIMILAR_RECORDINGS: 'session-replay-similar-recordings', // owner: #team-replay
SAVED_NOT_PINNED: 'saved-not-pinned', // owner: #team-replay
EXPORTS_SIDEPANEL: 'exports-sidepanel', // owner: #team-product-analytics
BILLING_UPGRADE_LANGUAGE: 'billing-upgrade-language', // owner: @biancayang
SESSION_REPLAY_V3_INGESTION_PLAYBACK: 'session-replay-v3-ingestion-playback', // owner: @benjackwhite
SESSION_REPLAY_FILTER_ORDERING: 'session-replay-filter-ordering', // owner: @team-replay
SESSION_REPLAY_LINKED_VARIANTS: 'session-replay-linked-variants', // owner: #team-replay
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/lib/lemon-ui/LemonModal/LemonModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface LemonModalProps {
forceAbovePopovers?: boolean
contentRef?: React.RefCallback<HTMLDivElement>
overlayRef?: React.RefCallback<HTMLDivElement>
'data-attr'?: string
}

export const LemonModalHeader = ({ children, className }: LemonModalInnerProps): JSX.Element => {
Expand Down Expand Up @@ -80,14 +81,15 @@ export function LemonModal({
contentRef,
overlayRef,
hideCloseButton = false,
'data-attr': dataAttr,
}: LemonModalProps): JSX.Element {
const nodeRef = useRef(null)
const [ignoredOverlayClickCount, setIgnoredOverlayClickCount] = useState(0)

useEffect(() => setIgnoredOverlayClickCount(0), [hasUnsavedInput]) // Reset when there no longer is unsaved input

const modalContent = (
<div ref={nodeRef} className="LemonModal__container">
<div ref={nodeRef} className="LemonModal__container" data-attr={dataAttr}>
{closable && !hideCloseButton && (
// The key causes the div to be re-rendered, which restarts the animation,
// providing immediate visual feedback on click
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/lib/utils/eventUsageLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,14 @@ export const eventUsageLogic = kea<eventUsageLogicType>([
reportCommandBarSearchResultOpened: (type: ResultType) => ({ type }),
reportCommandBarActionSearch: (query: string) => ({ query }),
reportCommandBarActionResultExecuted: (resultDisplay) => ({ resultDisplay }),
reportSubscriptionStatus: (hasActiveSubscription: boolean) => ({ hasActiveSubscription }),
}),
listeners(({ values }) => ({
reportSubscriptionStatus: ({ hasActiveSubscription }) => {
posthog.capture('report subscription status', {
has_active_subscription: hasActiveSubscription,
})
},
reportAxisUnitsChanged: (properties) => {
posthog.capture('axis units changed', properties)
},
Expand Down
38 changes: 36 additions & 2 deletions frontend/src/scenes/UpgradeModal.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { LemonButton, LemonModal } from '@posthog/lemon-ui'
import { useActions, useValues } from 'kea'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { capitalizeFirstLetter } from 'lib/utils'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import posthog from 'posthog-js'
import { useEffect } from 'react'

import { billingLogic } from './billing/billingLogic'
import { sceneLogic } from './sceneLogic'
import { urls } from './urls'

Expand All @@ -11,9 +16,18 @@ export function UpgradeModal(): JSX.Element {
const { hideUpgradeModal } = useActions(sceneLogic)

const [featureName, featureCaption] = upgradeModalFeatureNameAndCaption ?? []
const { featureFlags } = useValues(featureFlagLogic)
const { billing } = useValues(billingLogic)

const { reportSubscriptionStatus } = useActions(eventUsageLogic)

useEffect(() => {
xrdt marked this conversation as resolved.
Show resolved Hide resolved
reportSubscriptionStatus(billing?.has_active_subscription || false)
}, [])

return (
<LemonModal
data-attr="upgrade-modal"
title="Unleash PostHog's full power"
footer={
<>
Expand All @@ -28,7 +42,16 @@ export function UpgradeModal(): JSX.Element {
posthog.capture('upgrade modal pricing interaction')
}}
>
Upgrade now
{featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'subscribe'
? 'Subscribe'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
!billing?.has_active_subscription
? 'Add credit card'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
billing?.has_active_subscription
? 'Add paid plan'
: 'Upgrade'}{' '}
now
</LemonButton>
</>
}
Expand All @@ -39,7 +62,18 @@ export function UpgradeModal(): JSX.Element {
<b>{featureName && capitalizeFirstLetter(featureName)}</b> is an advanced PostHog feature.
</p>
{featureCaption && <p>{featureCaption}</p>}
<p className="mb-0">Upgrade and get access to this, as well as to other powerful enhancements.</p>
<p className="mb-0">
{featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'subscribe'
? 'Subscribe'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
!billing?.has_active_subscription
? 'Add a credit card'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
billing?.has_active_subscription
? 'Add paid plan'
: 'Upgrade'}{' '}
to get access to this and other powerful enhancements.
</p>
</LemonModal>
)
}
19 changes: 18 additions & 1 deletion frontend/src/scenes/billing/Billing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ import { router } from 'kea-router'
import { SurprisedHog } from 'lib/components/hedgehogs'
import { PageHeader } from 'lib/components/PageHeader'
import { supportLogic } from 'lib/components/Support/supportLogic'
import { FEATURE_FLAGS } from 'lib/constants'
import { dayjs } from 'lib/dayjs'
import { useResizeBreakpoints } from 'lib/hooks/useResizeObserver'
import { IconCheckCircleOutline } from 'lib/lemon-ui/icons'
import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { LemonLabel } from 'lib/lemon-ui/LemonLabel/LemonLabel'
import { SpinnerOverlay } from 'lib/lemon-ui/Spinner/Spinner'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { useEffect } from 'react'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { SceneExport } from 'scenes/sceneTypes'
Expand Down Expand Up @@ -49,6 +52,8 @@ export function Billing(): JSX.Element {
const { reportBillingV2Shown } = useActions(billingLogic)
const { preflight, isCloudOrDev } = useValues(preflightLogic)
const { openSupportForm } = useActions(supportLogic)
const { featureFlags } = useValues(featureFlagLogic)
const { reportSubscriptionStatus } = useActions(eventUsageLogic)

if (preflight && !isCloudOrDev) {
router.actions.push(urls.default())
Expand All @@ -60,6 +65,10 @@ export function Billing(): JSX.Element {
}
}, [!!billing])

useEffect(() => {
reportSubscriptionStatus(billing?.has_active_subscription || false)
}, [])

const { ref, size } = useResizeBreakpoints({
0: 'small',
1000: 'medium',
Expand Down Expand Up @@ -317,7 +326,15 @@ export function Billing(): JSX.Element {
to={upgradeAllProductsLink}
disableClientSideRouting
>
Upgrade all
{featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'subscribe'
? 'Subscribe to all'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
!billing?.has_active_subscription
? 'Add credit card to all products'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
billing?.has_active_subscription
? 'Add all products to plan'
: 'Upgrade to all'}{' '}
</LemonButton>
)}
</div>
Expand Down
20 changes: 18 additions & 2 deletions frontend/src/scenes/billing/BillingHero.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import './BillingHero.scss'

import { useValues } from 'kea'
import { BlushingHog } from 'lib/components/hedgehogs'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import useResizeObserver from 'use-resize-observer'

import { billingLogic } from './billingLogic'

export const BillingHero = (): JSX.Element => {
const { width, ref: billingHeroRef } = useResizeObserver()
const { featureFlags } = useValues(featureFlagLogic)
const { billing } = useValues(billingLogic)

return (
<div className="BillingHero" ref={billingHeroRef}>
Expand All @@ -13,8 +20,17 @@ export const BillingHero = (): JSX.Element => {
<h1 className="ingestion-title">Get the whole hog.</h1>
<h1 className="ingestion-title text-danger">Only pay for what you use.</h1>
<p className="mt-2 mb-0">
Add your credit card details to get access to premium product and platform features. Set billing
limits as low as $0 to control spend.
{featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'subscribe'
? 'Subscribe'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
!billing?.has_active_subscription
? 'Add your credit card'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
billing?.has_active_subscription
? 'Add the paid plan'
: 'Upgrade'}{' '}
to get access to premium product and platform features. Set billing limits as low as $0 to control
spend.
</p>
</div>
{width && width > 500 && (
Expand Down
26 changes: 24 additions & 2 deletions frontend/src/scenes/billing/BillingProduct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { IconCheckCircle, IconChevronDown, IconInfo, IconPlus } from '@posthog/i
import { LemonButton, LemonSelectOptions, LemonTable, LemonTag, Link } from '@posthog/lemon-ui'
import clsx from 'clsx'
import { useActions, useValues } from 'kea'
import { FEATURE_FLAGS } from 'lib/constants'
import { useResizeBreakpoints } from 'lib/hooks/useResizeObserver'
import { IconArticle, IconCheckCircleOutline, IconChevronRight } from 'lib/lemon-ui/icons'
import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
Expand Down Expand Up @@ -214,6 +215,7 @@ export const BillingProduct = ({ product }: { product: BillingProductV2Type }):
} = useActions(billingProductLogic({ product, productRef }))
const { reportBillingUpgradeClicked } = useActions(eventUsageLogic)

const { featureFlags } = useValues(featureFlagLogic)
const showUpgradeCTA = !product.subscribed && !product.contact_support && product.plans?.length
const upgradePlan = currentAndUpgradePlans?.upgradePlan
const currentPlan = currentAndUpgradePlans?.currentPlan
Expand Down Expand Up @@ -610,7 +612,18 @@ export const BillingProduct = ({ product }: { product: BillingProductV2Type }):
{additionalFeaturesOnUpgradedPlan?.length > 0 ? (
<>
<p className="ml-0 max-w-200">
{product.subscribed ? 'You now' : 'Upgrade to'} get sweet features such as:
{product.subscribed
? 'You now'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'subscribe'
? 'Subscribe to'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
!billing?.has_active_subscription
? 'Add a credit card to'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
billing?.has_active_subscription
? 'Add paid plan'
: 'Upgrade to'}{' '}
get sweet features such as:
</p>
<div>
{additionalFeaturesOnUpgradedPlan?.map((feature, i) => {
Expand Down Expand Up @@ -691,8 +704,17 @@ export const BillingProduct = ({ product }: { product: BillingProductV2Type }):
}}
className="grow"
center
data-attr={`upgrade-button-${product.type}`}
>
Upgrade
{featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'subscribe'
? 'Subscribe'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
!billing?.has_active_subscription
? 'Add credit card'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
billing?.has_active_subscription
? 'Add paid plan'
: 'Upgrade'}
</LemonButton>
</div>
</div>
Expand Down
Loading
Loading