Skip to content

Commit

Permalink
chore: remove subscribe from paygate experiment (#22956)
Browse files Browse the repository at this point in the history
* Remove subscribe from paygate experiment

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
zlwaterfield and github-actions[bot] authored Jun 13, 2024
1 parent 7be03a7 commit bd6f570
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 93 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { LemonButton } from '@posthog/lemon-ui'

import { BillingProductV2AddonType, BillingProductV2Type, BillingV2FeatureType, BillingV2Type } from '~/types'

interface PayGateMiniButtonVariantProps {
interface PayGateButtonProps {
gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null
productWithFeature: BillingProductV2AddonType | BillingProductV2Type
featureInfo: BillingV2FeatureType
Expand All @@ -11,14 +11,14 @@ interface PayGateMiniButtonVariantProps {
scrollToProduct: boolean
}

export const PayGateMiniButtonVariant = ({
export const PayGateButton = ({
gateVariant,
productWithFeature,
featureInfo,
onCtaClick,
billing,
scrollToProduct = true,
}: PayGateMiniButtonVariantProps): JSX.Element => {
}: PayGateButtonProps): JSX.Element => {
return (
<LemonButton
to={getCtaLink(gateVariant, productWithFeature, featureInfo, scrollToProduct)}
Expand Down
31 changes: 9 additions & 22 deletions frontend/src/lib/components/PayGateMini/PayGateMini.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { IconInfo, IconOpenSidebar } from '@posthog/icons'
import { LemonButton, Link, Tooltip } from '@posthog/lemon-ui'
import clsx from 'clsx'
import { useActions, useValues } from 'kea'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import posthog from 'posthog-js'
import { useEffect } from 'react'
import { billingLogic } from 'scenes/billing/billingLogic'
Expand All @@ -13,8 +11,7 @@ import { getProductIcon } from 'scenes/products/Products'
import { AvailableFeature, BillingProductV2AddonType, BillingProductV2Type, BillingV2FeatureType } from '~/types'

import { upgradeModalLogic } from '../UpgradeModal/upgradeModalLogic'
import { PayGateMiniButton } from './PayGateMiniButton'
import { PayGateMiniButtonVariant } from './PayGateMiniButtonVariant'
import { PayGateButton } from './PayGateButton'
import { payGateMiniLogic } from './payGateMiniLogic'

export interface PayGateMiniProps {
Expand Down Expand Up @@ -56,7 +53,6 @@ export function PayGateMini({
} = useValues(payGateMiniLogic({ featureKey: feature, currentUsage }))
const { preflight, isCloudOrDev } = useValues(preflightLogic)
const { billing, billingLoading } = useValues(billingLogic)
const { featureFlags } = useValues(featureFlagLogic)
const { hideUpgradeModal } = useActions(upgradeModalLogic)

const scrollToProduct = !(featureInfo?.key === AvailableFeature.ORGANIZATIONS_PROJECTS && !isAddonProduct)
Expand Down Expand Up @@ -103,23 +99,14 @@ export function PayGateMini({
handleCtaClick={handleCtaClick}
>
<div className="flex items-center justify-center space-x-3">
{/* we don't support plan comparisons for addons yet, so we'll use the variant that just sends them to the billing page */}
{featureFlags[FEATURE_FLAGS.SUBSCRIBE_FROM_PAYGATE] === 'test' && !isAddonProduct ? (
<PayGateMiniButton
product={productWithFeature}
featureInfo={featureInfo}
gateVariant={gateVariant}
/>
) : (
<PayGateMiniButtonVariant
gateVariant={gateVariant}
productWithFeature={productWithFeature}
featureInfo={featureInfo}
onCtaClick={handleCtaClick}
billing={billing}
scrollToProduct={scrollToProduct}
/>
)}
<PayGateButton
gateVariant={gateVariant}
productWithFeature={productWithFeature}
featureInfo={featureInfo}
onCtaClick={handleCtaClick}
billing={billing}
scrollToProduct={scrollToProduct}
/>
{docsLink && isCloudOrDev && (
<LemonButton
type="secondary"
Expand Down
68 changes: 0 additions & 68 deletions frontend/src/lib/components/PayGateMini/PayGateMiniButton.tsx

This file was deleted.

0 comments on commit bd6f570

Please sign in to comment.