-
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.
- Loading branch information
Showing
111 changed files
with
1,910 additions
and
710 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
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
-91 Bytes
(100%)
frontend/__snapshots__/scenes-other-toolbar--actions--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-166 Bytes
(99%)
frontend/__snapshots__/scenes-other-toolbar--actions--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.01 KB
(96%)
frontend/__snapshots__/scenes-other-toolbar--actions-dark--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+217 Bytes
(100%)
frontend/__snapshots__/scenes-other-toolbar--actions-dark--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-375 Bytes
(97%)
frontend/__snapshots__/scenes-other-toolbar--default--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-494 Bytes
(96%)
frontend/__snapshots__/scenes-other-toolbar--default--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.35 KB
(90%)
frontend/__snapshots__/scenes-other-toolbar--default-dark--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+37 Bytes
(100%)
frontend/__snapshots__/scenes-other-toolbar--default-dark--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-162 Bytes
(99%)
frontend/__snapshots__/scenes-other-toolbar--events-debugger-empty--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-802 Bytes
(97%)
frontend/__snapshots__/scenes-other-toolbar--events-debugger-empty--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-856 Bytes
(97%)
frontend/__snapshots__/scenes-other-toolbar--events-debugger-empty-dark--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+37 Bytes
(100%)
frontend/__snapshots__/scenes-other-toolbar--events-debugger-empty-dark--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-686 Bytes
(97%)
frontend/__snapshots__/scenes-other-toolbar--experiments--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-841 Bytes
(97%)
frontend/__snapshots__/scenes-other-toolbar--experiments--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-174 Bytes
(100%)
frontend/__snapshots__/scenes-other-toolbar--feature-flags--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-144 Bytes
(100%)
frontend/__snapshots__/scenes-other-toolbar--feature-flags--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-992 Bytes
(98%)
frontend/__snapshots__/scenes-other-toolbar--feature-flags-dark--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+59 Bytes
(100%)
frontend/__snapshots__/scenes-other-toolbar--feature-flags-dark--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-588 Bytes
(99%)
frontend/__snapshots__/scenes-other-toolbar--heatmap--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-724 Bytes
(99%)
frontend/__snapshots__/scenes-other-toolbar--heatmap--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-939 Bytes
(98%)
frontend/__snapshots__/scenes-other-toolbar--heatmap-dark--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-449 Bytes
(99%)
frontend/__snapshots__/scenes-other-toolbar--heatmap-dark--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-504 Bytes
(96%)
frontend/__snapshots__/scenes-other-toolbar--inspect--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-726 Bytes
(95%)
frontend/__snapshots__/scenes-other-toolbar--inspect--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.38 KB
(90%)
frontend/__snapshots__/scenes-other-toolbar--inspect-dark--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-378 Bytes
(97%)
frontend/__snapshots__/scenes-other-toolbar--inspect-dark--light.png
Oops, something went wrong.
Binary file modified
BIN
+306 Bytes
(100%)
frontend/__snapshots__/scenes-other-toolbar--minimized--dark.png
Oops, something went wrong.
Binary file modified
BIN
-1.65 KB
(86%)
frontend/__snapshots__/scenes-other-toolbar--minimized--light.png
Oops, something went wrong.
Binary file modified
BIN
-1.29 KB
(88%)
frontend/__snapshots__/scenes-other-toolbar--minimized-dark--dark.png
Oops, something went wrong.
Binary file modified
BIN
-964 Bytes
(90%)
frontend/__snapshots__/scenes-other-toolbar--minimized-dark--light.png
Oops, something went wrong.
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
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,17 @@ | ||
import { SpinnerOverlay } from '@posthog/lemon-ui' | ||
import { useActions } from 'kea' | ||
import { useEffect } from 'react' | ||
|
||
import { paymentEntryLogic } from './paymentEntryLogic' | ||
|
||
// note(@zach): this page is only used when a payment method is entered into the payment entry modal | ||
// that requires the user to be redirect to another url, this is where they get redirected back to | ||
export const AuthorizationStatus = (): JSX.Element => { | ||
const { pollAuthorizationStatus } = useActions(paymentEntryLogic) | ||
|
||
useEffect(() => { | ||
pollAuthorizationStatus() | ||
}, []) | ||
|
||
return <SpinnerOverlay sceneLevel /> | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import { LemonButton, LemonModal, Spinner } from '@posthog/lemon-ui' | ||
import { Elements, PaymentElement, useElements, useStripe } from '@stripe/react-stripe-js' | ||
import { loadStripe } from '@stripe/stripe-js' | ||
import { useActions, useValues } from 'kea' | ||
import { useEffect } from 'react' | ||
|
||
import { paymentEntryLogic } from './paymentEntryLogic' | ||
|
||
const stripePromise = loadStripe(window.STRIPE_PUBLIC_KEY!) | ||
|
||
export const PaymentForm = (): JSX.Element => { | ||
const { error, isLoading } = useValues(paymentEntryLogic) | ||
const { setError, hidePaymentEntryModal, pollAuthorizationStatus, setLoading } = useActions(paymentEntryLogic) | ||
|
||
const stripe = useStripe() | ||
const elements = useElements() | ||
|
||
// @ts-expect-error | ||
const handleSubmit = async (event): Promise<void> => { | ||
event.preventDefault() | ||
if (!stripe || !elements) { | ||
return | ||
} | ||
setLoading(true) | ||
const result = await stripe.confirmPayment({ | ||
elements, | ||
confirmParams: { | ||
return_url: `${window.location.origin}/billing/authorization_status`, | ||
}, | ||
redirect: 'if_required', | ||
}) | ||
|
||
if (result.error) { | ||
setLoading(false) | ||
setError(result.error.message) | ||
} else { | ||
pollAuthorizationStatus() | ||
} | ||
} | ||
|
||
return ( | ||
<div> | ||
<PaymentElement /> | ||
{error && <div className="error">{error}</div>} | ||
<div className="flex justify-end space-x-2 mt-2"> | ||
<LemonButton disabled={isLoading} type="secondary" onClick={hidePaymentEntryModal}> | ||
Cancel | ||
</LemonButton> | ||
<LemonButton loading={isLoading} type="primary" onClick={(event) => void handleSubmit(event)}> | ||
Submit | ||
</LemonButton> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
interface PaymentEntryModalProps { | ||
redirectPath?: string | null | ||
} | ||
|
||
export const PaymentEntryModal = ({ redirectPath = null }: PaymentEntryModalProps): JSX.Element | null => { | ||
const { clientSecret, paymentEntryModalOpen } = useValues(paymentEntryLogic) | ||
const { hidePaymentEntryModal, initiateAuthorization } = useActions(paymentEntryLogic) | ||
|
||
useEffect(() => { | ||
initiateAuthorization(redirectPath) | ||
}, [redirectPath]) | ||
|
||
return ( | ||
<LemonModal | ||
onClose={hidePaymentEntryModal} | ||
width="max(44vw)" | ||
isOpen={paymentEntryModalOpen} | ||
title="Add your payment details" | ||
description="Your card will not be charged." | ||
> | ||
<div> | ||
{clientSecret ? ( | ||
<Elements stripe={stripePromise} options={{ clientSecret }}> | ||
<PaymentForm /> | ||
</Elements> | ||
) : ( | ||
<div className="min-h-40 flex justify-center items-center"> | ||
<div className="text-4xl"> | ||
<Spinner /> | ||
</div> | ||
</div> | ||
)} | ||
</div> | ||
</LemonModal> | ||
) | ||
} |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { LemonButton, Link } from '@posthog/lemon-ui' | ||
import { useActions } from 'kea' | ||
import { supportLogic } from 'lib/components/Support/supportLogic' | ||
import { UNSUBSCRIBE_SURVEY_ID } from 'lib/constants' | ||
|
||
import { BillingProductV2Type } from '~/types' | ||
|
@@ -8,6 +9,7 @@ import { billingProductLogic } from './billingProductLogic' | |
|
||
export const UnsubscribeCard = ({ product }: { product: BillingProductV2Type }): JSX.Element => { | ||
const { reportSurveyShown, setSurveyResponse } = useActions(billingProductLogic({ product })) | ||
const { openSupportForm } = useActions(supportLogic) | ||
|
||
return ( | ||
<div className="p-5 gap-4 flex"> | ||
|
@@ -26,7 +28,7 @@ export const UnsubscribeCard = ({ product }: { product: BillingProductV2Type }): | |
reduce your bill | ||
</Link>{' '} | ||
or{' '} | ||
<Link to="mailto:[email protected]?subject=Help%20reducing%20PostHog%20bill" target="_blank"> | ||
<Link to="" onClick={() => openSupportForm({ target_area: 'billing', isEmailFormOpen: true })}> | ||
chat with support. | ||
</Link>{' '} | ||
Check out more about our pricing on our{' '} | ||
|
Oops, something went wrong.