mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-28 23:23:38 -05:00
[web] Migrate /user/subscription/thank-you
to BS5 (#20588)
* [web] Initialize BS5 in subscription page * [web] Backend wiring for `user/subscription/thank-you` to BS5 * [web] Update `SuccessfulSubscription` to BS5 GitOrigin-RevId: 45162664c116eb04b73e16443c84fa24ea8b220c
This commit is contained in:
parent
d480faf60b
commit
6b4c483269
3 changed files with 47 additions and 28 deletions
|
@ -422,6 +422,12 @@ async function successfulSubscription(req, res) {
|
||||||
if (!personalSubscription) {
|
if (!personalSubscription) {
|
||||||
res.redirect('/user/subscription/plans')
|
res.redirect('/user/subscription/plans')
|
||||||
} else {
|
} else {
|
||||||
|
await SplitTestHandler.promises.getAssignment(
|
||||||
|
req,
|
||||||
|
res,
|
||||||
|
'bootstrap-5-subscription'
|
||||||
|
)
|
||||||
|
|
||||||
res.render('subscriptions/successful-subscription-react', {
|
res.render('subscriptions/successful-subscription-react', {
|
||||||
title: 'thank_you',
|
title: 'thank_you',
|
||||||
personalSubscription,
|
personalSubscription,
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
extends ../layout-marketing
|
extends ../layout-marketing
|
||||||
|
|
||||||
|
block vars
|
||||||
|
- bootstrap5PageStatus = 'enabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
|
||||||
|
- bootstrap5PageSplitTest = 'bootstrap-5-subscription'
|
||||||
|
|
||||||
block entrypointVar
|
block entrypointVar
|
||||||
- entrypoint = 'pages/user/subscription/successful-subscription'
|
- entrypoint = 'pages/user/subscription/successful-subscription'
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
import { useTranslation, Trans } from 'react-i18next'
|
import { useTranslation, Trans } from 'react-i18next'
|
||||||
import { Col, Row } from 'react-bootstrap'
|
|
||||||
import { PriceExceptions } from '../shared/price-exceptions'
|
import { PriceExceptions } from '../shared/price-exceptions'
|
||||||
import PremiumFeaturesLink from '../dashboard/premium-features-link'
|
import PremiumFeaturesLink from '../dashboard/premium-features-link'
|
||||||
import getMeta from '../../../../utils/meta'
|
import getMeta from '../../../../utils/meta'
|
||||||
import { useSubscriptionDashboardContext } from '../../context/subscription-dashboard-context'
|
import { useSubscriptionDashboardContext } from '../../context/subscription-dashboard-context'
|
||||||
|
import OLRow from '@/features/ui/components/ol/ol-row'
|
||||||
|
import OLCol from '@/features/ui/components/ol/ol-col'
|
||||||
|
import OLCard from '@/features/ui/components/ol/ol-card'
|
||||||
|
import OLNotification from '@/features/ui/components/ol/ol-notification'
|
||||||
|
|
||||||
function SuccessfulSubscription() {
|
function SuccessfulSubscription() {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
@ -16,37 +19,43 @@ function SuccessfulSubscription() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<Row>
|
<OLRow>
|
||||||
<Col md={8} mdOffset={2}>
|
<OLCol lg={{ span: 8, offset: 2 }}>
|
||||||
<div className="card">
|
<OLCard>
|
||||||
<div className="page-header">
|
<div className="page-header">
|
||||||
<h2>{t('thanks_for_subscribing')}</h2>
|
<h2>{t('thanks_for_subscribing')}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div role="alert" className="alert alert-success">
|
<OLNotification
|
||||||
{subscription.recurly.trial_ends_at && (
|
type="success"
|
||||||
|
content={
|
||||||
<>
|
<>
|
||||||
|
{subscription.recurly.trial_ends_at && (
|
||||||
|
<>
|
||||||
|
<p>
|
||||||
|
<Trans
|
||||||
|
i18nKey="next_payment_of_x_collectected_on_y"
|
||||||
|
values={{
|
||||||
|
paymentAmmount: subscription.recurly.displayPrice,
|
||||||
|
collectionDate:
|
||||||
|
subscription.recurly.nextPaymentDueAt,
|
||||||
|
}}
|
||||||
|
shouldUnescape
|
||||||
|
tOptions={{ interpolation: { escapeValue: true } }}
|
||||||
|
components={[<strong />, <strong />]} // eslint-disable-line react/jsx-key
|
||||||
|
/>
|
||||||
|
</p>
|
||||||
|
<PriceExceptions subscription={subscription} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<p>
|
<p>
|
||||||
<Trans
|
{t('to_modify_your_subscription_go_to')}
|
||||||
i18nKey="next_payment_of_x_collectected_on_y"
|
<a href="/user/subscription" rel="noopener noreferrer">
|
||||||
values={{
|
{t('manage_subscription')}.
|
||||||
paymentAmmount: subscription.recurly.displayPrice,
|
</a>
|
||||||
collectionDate: subscription.recurly.nextPaymentDueAt,
|
|
||||||
}}
|
|
||||||
shouldUnescape
|
|
||||||
tOptions={{ interpolation: { escapeValue: true } }}
|
|
||||||
components={[<strong />, <strong />]} // eslint-disable-line react/jsx-key
|
|
||||||
/>
|
|
||||||
</p>
|
</p>
|
||||||
<PriceExceptions subscription={subscription} />
|
|
||||||
</>
|
</>
|
||||||
)}
|
}
|
||||||
<p>
|
/>
|
||||||
{t('to_modify_your_subscription_go_to')}
|
|
||||||
<a href="/user/subscription" rel="noopener noreferrer">
|
|
||||||
{t('manage_subscription')}.
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
{subscription.groupPlan && (
|
{subscription.groupPlan && (
|
||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
|
@ -97,9 +106,9 @@ function SuccessfulSubscription() {
|
||||||
< {t('back_to_your_projects')}
|
< {t('back_to_your_projects')}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</OLCard>
|
||||||
</Col>
|
</OLCol>
|
||||||
</Row>
|
</OLRow>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue