mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Redirect users without an active subscription to the subscription page instead of the error page (#34637)
* Redirect freemium users from billing portal routes to subscription page with banner * Handle null management link and unknown service in subscription redirects * Move deleted-subscription invoices link inside `getCustomerManagementLink` instead GitOrigin-RevId: 7122f69e9b8bda6238111f76c15a35135ce5f0ac
This commit is contained in:
+12
-1
@@ -1,5 +1,6 @@
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import OLNotification from '@/shared/components/ol/ol-notification'
|
||||
import OLButton from '@/shared/components/ol/ol-button'
|
||||
|
||||
function RedirectAlerts() {
|
||||
const queryParams = new URLSearchParams(window.location.search)
|
||||
@@ -11,6 +12,7 @@ function RedirectAlerts() {
|
||||
}
|
||||
|
||||
let warning
|
||||
let action
|
||||
if (redirectReason === 'writefull-entitled') {
|
||||
warning = t('good_news_you_are_already_receiving_this_add_on_via_writefull')
|
||||
} else if (redirectReason === 'double-buy') {
|
||||
@@ -27,10 +29,19 @@ function RedirectAlerts() {
|
||||
)
|
||||
} else if (redirectReason === 'subscription-paused') {
|
||||
warning = t('no_add_on_purchase_while_paused')
|
||||
} else if (redirectReason === 'no-active-subscription') {
|
||||
warning = t('your_subscription_has_expired')
|
||||
action = (
|
||||
<OLButton href="/user/subscription/payment/invoices" variant="secondary">
|
||||
{t('view_your_invoices')}
|
||||
</OLButton>
|
||||
)
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
|
||||
return <OLNotification type="warning" content={<>{warning}</>} />
|
||||
return (
|
||||
<OLNotification type="warning" content={<>{warning}</>} action={action} />
|
||||
)
|
||||
}
|
||||
export default RedirectAlerts
|
||||
|
||||
Reference in New Issue
Block a user