-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: show alert when we automatically apply billing limit upon subsc…
…ribe (#18668) * show alert when we automatically apply billing limit upon subscribe * Update to use billingAlert banner * typing * change banner to warning type * address pr feedback * add conditional for initial_billing_limit * only show billing product alert on organization/billing page --------- Co-authored-by: Bianca Yang <[email protected]>
- Loading branch information
Showing
4 changed files
with
98 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,18 +12,26 @@ export function BillingAlertsV2(): JSX.Element | null { | |
const [alertHidden, setAlertHidden] = useState(false) | ||
|
||
useEffect(() => { | ||
if (billingAlert?.pathName && currentLocation.pathname !== billingAlert?.pathName) { | ||
setAlertHidden(true) | ||
} else { | ||
setAlertHidden(false) | ||
} | ||
if (billingAlert) { | ||
reportBillingAlertShown(billingAlert) | ||
} | ||
}, [billingAlert]) | ||
}, [billingAlert, currentLocation]) | ||
|
||
if (!billingAlert || alertHidden) { | ||
return null | ||
} | ||
|
||
const showButton = billingAlert.contactSupport || currentLocation.pathname !== urls.organizationBilling() | ||
const showButton = | ||
billingAlert.action || billingAlert.contactSupport || currentLocation.pathname !== urls.organizationBilling() | ||
|
||
const buttonProps = billingAlert.contactSupport | ||
const buttonProps = billingAlert.action | ||
? billingAlert.action | ||
: billingAlert.contactSupport | ||
? { | ||
to: 'mailto:[email protected]', | ||
children: billingAlert.buttonCTA || 'Contact support', | ||
|
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