-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dn-fix/error-clustering-fixes
- Loading branch information
Showing
104 changed files
with
9,945 additions
and
2,747 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-2.33 KB
(100%)
frontend/__snapshots__/components-cards-insight-card--insight-card--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
frontend/src/lib/components/PayGateMini/PayGateMiniButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { LemonButton } from '@posthog/lemon-ui' | ||
import { useActions, useValues } from 'kea' | ||
import { billingProductLogic } from 'scenes/billing/billingProductLogic' | ||
import { PlanComparisonModal } from 'scenes/billing/PlanComparison' | ||
import { urls } from 'scenes/urls' | ||
|
||
import { BillingProductV2Type, BillingV2FeatureType } from '~/types' | ||
|
||
export const PayGateMiniButton = ({ | ||
product, | ||
gateVariant, | ||
featureInfo, | ||
onClick, | ||
}: { | ||
product: BillingProductV2Type | ||
featureInfo: BillingV2FeatureType | ||
gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | ||
onClick?: () => void | ||
}): JSX.Element => { | ||
const { isPlanComparisonModalOpen } = useValues(billingProductLogic({ product })) | ||
const { toggleIsPlanComparisonModalOpen } = useActions(billingProductLogic({ product })) | ||
|
||
return ( | ||
<> | ||
<LemonButton | ||
to={ | ||
gateVariant === 'contact-sales' | ||
? `mailto:[email protected]?subject=Inquiring about ${featureInfo.name}` | ||
: gateVariant === 'move-to-cloud' | ||
? urls.moveToPostHogCloud() | ||
: undefined | ||
} | ||
type="primary" | ||
center | ||
onClick={() => { | ||
if (gateVariant === 'add-card') { | ||
toggleIsPlanComparisonModalOpen(featureInfo.key) | ||
} | ||
onClick?.() | ||
}} | ||
> | ||
{gateVariant === 'add-card' | ||
? `Compare plans` | ||
: gateVariant === 'contact-sales' | ||
? 'Contact sales' | ||
: 'Move to PostHog Cloud'} | ||
</LemonButton> | ||
<PlanComparisonModal | ||
key={`modal-${featureInfo.key}`} | ||
product={product} | ||
modalOpen={isPlanComparisonModalOpen} | ||
onClose={() => toggleIsPlanComparisonModalOpen()} | ||
/> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.