|
@@ -7,6 +7,12 @@ import OLRow from '@/features/ui/components/ol/ol-row'
|
|
|
import OLCol from '@/features/ui/components/ol/ol-col'
|
|
import OLCol from '@/features/ui/components/ol/ol-col'
|
|
|
import OLPageContentCard from '@/features/ui/components/ol/ol-page-content-card'
|
|
import OLPageContentCard from '@/features/ui/components/ol/ol-page-content-card'
|
|
|
import OLNotification from '@/features/ui/components/ol/ol-notification'
|
|
import OLNotification from '@/features/ui/components/ol/ol-notification'
|
|
|
|
|
+import {
|
|
|
|
|
+ AI_ADD_ON_CODE,
|
|
|
|
|
+ ADD_ON_NAME,
|
|
|
|
|
+ isStandaloneAiPlanCode,
|
|
|
|
|
+} from '../../data/add-on-codes'
|
|
|
|
|
+import { RecurlySubscription } from '../../../../../../types/subscription/dashboard/subscription'
|
|
|
|
|
|
|
|
function SuccessfulSubscription() {
|
|
function SuccessfulSubscription() {
|
|
|
const { t } = useTranslation()
|
|
const { t } = useTranslation()
|
|
@@ -17,6 +23,8 @@ function SuccessfulSubscription() {
|
|
|
|
|
|
|
|
if (!subscription || !('recurly' in subscription)) return null
|
|
if (!subscription || !('recurly' in subscription)) return null
|
|
|
|
|
|
|
|
|
|
+ const onAiStandalonePlan = isStandaloneAiPlanCode(subscription.planCode)
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<div className="container">
|
|
<div className="container">
|
|
|
<OLRow>
|
|
<OLRow>
|
|
@@ -66,12 +74,11 @@ function SuccessfulSubscription() {
|
|
|
</a>
|
|
</a>
|
|
|
</p>
|
|
</p>
|
|
|
)}
|
|
)}
|
|
|
- <p>
|
|
|
|
|
- {t('thanks_for_subscribing_you_help_sl', {
|
|
|
|
|
- planName: subscription.plan.name,
|
|
|
|
|
- })}
|
|
|
|
|
- </p>
|
|
|
|
|
- <PremiumFeaturesLink />
|
|
|
|
|
|
|
+ <ThankYouSection
|
|
|
|
|
+ subscription={subscription}
|
|
|
|
|
+ onAiStandalonePlan={onAiStandalonePlan}
|
|
|
|
|
+ />
|
|
|
|
|
+ {!onAiStandalonePlan && <PremiumFeaturesLink />}
|
|
|
<p>
|
|
<p>
|
|
|
{t('need_anything_contact_us_at')}
|
|
{t('need_anything_contact_us_at')}
|
|
|
<a href={`mailto:${adminEmail}`} rel="noopener noreferrer">
|
|
<a href={`mailto:${adminEmail}`} rel="noopener noreferrer">
|
|
@@ -79,19 +86,21 @@ function SuccessfulSubscription() {
|
|
|
</a>
|
|
</a>
|
|
|
.
|
|
.
|
|
|
</p>
|
|
</p>
|
|
|
- <p>
|
|
|
|
|
- <Trans
|
|
|
|
|
- i18nKey="help_improve_overleaf_fill_out_this_survey"
|
|
|
|
|
- components={[
|
|
|
|
|
- // eslint-disable-next-line react/jsx-key, jsx-a11y/anchor-has-content
|
|
|
|
|
- <a
|
|
|
|
|
- href="https://forms.gle/CdLNX9m6NLxkv1yr5"
|
|
|
|
|
- target="_blank"
|
|
|
|
|
- rel="noopener noreferrer"
|
|
|
|
|
- />,
|
|
|
|
|
- ]}
|
|
|
|
|
- />
|
|
|
|
|
- </p>
|
|
|
|
|
|
|
+ {!onAiStandalonePlan && (
|
|
|
|
|
+ <p>
|
|
|
|
|
+ <Trans
|
|
|
|
|
+ i18nKey="help_improve_overleaf_fill_out_this_survey"
|
|
|
|
|
+ components={[
|
|
|
|
|
+ // eslint-disable-next-line react/jsx-key, jsx-a11y/anchor-has-content
|
|
|
|
|
+ <a
|
|
|
|
|
+ href="https://forms.gle/CdLNX9m6NLxkv1yr5"
|
|
|
|
|
+ target="_blank"
|
|
|
|
|
+ rel="noopener noreferrer"
|
|
|
|
|
+ />,
|
|
|
|
|
+ ]}
|
|
|
|
|
+ />
|
|
|
|
|
+ </p>
|
|
|
|
|
+ )}
|
|
|
<p>
|
|
<p>
|
|
|
{t('regards')},
|
|
{t('regards')},
|
|
|
<br />
|
|
<br />
|
|
@@ -113,4 +122,45 @@ function SuccessfulSubscription() {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function ThankYouSection({
|
|
|
|
|
+ subscription,
|
|
|
|
|
+ onAiStandalonePlan,
|
|
|
|
|
+}: {
|
|
|
|
|
+ subscription: RecurlySubscription
|
|
|
|
|
+ onAiStandalonePlan: boolean
|
|
|
|
|
+}) {
|
|
|
|
|
+ const { t } = useTranslation()
|
|
|
|
|
+ const hasAiAddon = subscription?.addOns?.some(
|
|
|
|
|
+ addOn => addOn.addOnCode === AI_ADD_ON_CODE
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ if (onAiStandalonePlan) {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <p>
|
|
|
|
|
+ {t('thanks_for_subscribing_to_the_add_on', {
|
|
|
|
|
+ addOnName: ADD_ON_NAME,
|
|
|
|
|
+ })}
|
|
|
|
|
+ </p>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ if (hasAiAddon) {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <p>
|
|
|
|
|
+ {t('thanks_for_subscribing_to_plan_with_add_on', {
|
|
|
|
|
+ planName: subscription.plan.name,
|
|
|
|
|
+ addOnName: ADD_ON_NAME,
|
|
|
|
|
+ })}
|
|
|
|
|
+ </p>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return (
|
|
|
|
|
+ <p>
|
|
|
|
|
+ {t('thanks_for_subscribing_you_help_sl', {
|
|
|
|
|
+ planName: subscription.plan.name,
|
|
|
|
|
+ })}
|
|
|
|
|
+ </p>
|
|
|
|
|
+ )
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
export default SuccessfulSubscription
|
|
export default SuccessfulSubscription
|