forked from PostHog/posthog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: show CTA for annual plan if over $1k/mo (PostHog#18049)
* show CTA for annual plan if over $1k/mo * let it be dismissed * Update UI snapshots for `chromium` (1) * up front * send event whn clicked --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5e4da88
commit cf97074
Showing
5 changed files
with
51 additions
and
10 deletions.
There are no files selected for viewing
Binary file modified
BIN
+17.1 KB
(140%)
frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-discount.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
+14.5 KB
(140%)
frontend/__snapshots__/scenes-other-billing-v2--billing-v-2.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ import { LemonBanner } from 'lib/lemon-ui/LemonBanner' | |
|
||
export function BillingAlertsV2(): JSX.Element | null { | ||
const { billingAlert } = useValues(billingLogic) | ||
const { reportBillingAlertShown } = useActions(billingLogic) | ||
const { reportBillingAlertShown, reportBillingAlertActionClicked } = useActions(billingLogic) | ||
const { currentLocation } = useValues(router) | ||
const [alertHidden, setAlertHidden] = useState(false) | ||
|
||
|
@@ -21,21 +21,27 @@ export function BillingAlertsV2(): JSX.Element | null { | |
return null | ||
} | ||
|
||
const showButton = currentLocation.pathname !== urls.organizationBilling() | ||
const showButton = billingAlert.contactSupport || currentLocation.pathname !== urls.organizationBilling() | ||
|
||
const buttonProps = billingAlert.contactSupport | ||
? { | ||
to: 'mailto:[email protected]', | ||
children: 'Contact support', | ||
children: billingAlert.buttonCTA || 'Contact support', | ||
onClick: () => reportBillingAlertActionClicked(billingAlert), | ||
} | ||
: { | ||
to: urls.organizationBilling(), | ||
children: 'Manage billing', | ||
onClick: () => reportBillingAlertActionClicked(billingAlert), | ||
} | ||
: { to: urls.organizationBilling(), children: 'Manage billing' } | ||
|
||
return ( | ||
<div className="my-4"> | ||
<LemonBanner | ||
type={billingAlert.status} | ||
action={showButton ? buttonProps : undefined} | ||
onClose={billingAlert.status !== 'error' ? () => setAlertHidden(true) : undefined} | ||
dismissKey={billingAlert.dismissKey} | ||
> | ||
<b>{billingAlert.title}</b> | ||
<br /> | ||
|
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