From 1ea577ef121f183c8fe7115e3a965e1f72b1fd06 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween <5454374+emcsween@users.noreply.github.com> Date: Mon, 10 Mar 2025 08:33:24 -0400 Subject: [PATCH] Merge pull request #24154 from overleaf/em-bs5-subscription-preview Migrate the subscription change preview page to BS5 GitOrigin-RevId: beb398ef3a81be1b8d35536c524af6c110ea1b3d --- .../views/subscriptions/preview-change.pug | 3 + .../preview-subscription-change/root.tsx | 83 ++++++++++--------- .../bootstrap-5/pages/subscription.scss | 12 +++ 3 files changed, 58 insertions(+), 40 deletions(-) diff --git a/services/web/app/views/subscriptions/preview-change.pug b/services/web/app/views/subscriptions/preview-change.pug index ab70d2d6b6..320d4d7bdc 100644 --- a/services/web/app/views/subscriptions/preview-change.pug +++ b/services/web/app/views/subscriptions/preview-change.pug @@ -1,5 +1,8 @@ extends ../layout-marketing +block vars + - bootstrap5PageStatus = 'enabled' + block entrypointVar - entrypoint = 'pages/user/subscription/preview-change' diff --git a/services/web/frontend/js/features/subscription/components/preview-subscription-change/root.tsx b/services/web/frontend/js/features/subscription/components/preview-subscription-change/root.tsx index 404a733adf..41a544b93c 100644 --- a/services/web/frontend/js/features/subscription/components/preview-subscription-change/root.tsx +++ b/services/web/frontend/js/features/subscription/components/preview-subscription-change/root.tsx @@ -1,5 +1,5 @@ import { useCallback } from 'react' -import { Grid, Row, Col, Button } from 'react-bootstrap' +import { Grid, Row } from 'react-bootstrap' import moment from 'moment' import { useTranslation, Trans } from 'react-i18next' import { @@ -14,6 +14,9 @@ import { useLocation } from '@/shared/hooks/use-location' import { debugConsole } from '@/utils/debugging' import { postJSON } from '@/infrastructure/fetch-json' import Notification from '@/shared/components/notification' +import OLCard from '@/features/ui/components/ol/ol-card' +import OLCol from '@/features/ui/components/ol/ol-col' +import OLButton from '@/features/ui/components/ol/ol-button' import { subscriptionUpdateUrl } from '@/features/subscription/data/subscription-url' import * as eventTracking from '@/infrastructure/event-tracking' import sparkleText from '@/shared/svgs/ai-sparkle-text.svg' @@ -49,8 +52,8 @@ function PreviewSubscriptionChange() { return ( - -
+ + {preview.change.type === 'add-on-purchase' ? (

{t('add_add_on_to_your_plan', { @@ -77,7 +80,7 @@ function PreviewSubscriptionChange() { )} {aiAddOnChange && ( -
+
)} -
+

{t('due_today')}:

- {changeName} - + {changeName} + {formatCurrency( preview.immediateCharge.subtotal, preview.currency )} - + {preview.immediateCharge.tax > 0 && ( - + {t('vat')} {preview.nextInvoice.tax.rate * 100}% - - + + {formatCurrency( preview.immediateCharge.tax, preview.currency )} - + )} - - {t('total_today')} - + + {t('total_today')} + {formatCurrency( preview.immediateCharge.total, preview.currency )} - + -
+
- +
-
+

{t('future_payments')}:

- {preview.nextInvoice.plan.name} - + {preview.nextInvoice.plan.name} + {formatCurrency( preview.nextInvoice.plan.amount, preview.currency )} - + {preview.nextInvoice.addOns.map(addOn => ( - + {addOn.name} {addOn.quantity > 1 ? ` ×${addOn.quantity}` : ''} - - + + {formatCurrency(addOn.amount, preview.currency)} - + ))} {preview.nextInvoice.tax.rate > 0 && ( - + {t('vat')} {preview.nextInvoice.tax.rate * 100}% - - + + {formatCurrency( preview.nextInvoice.tax.amount, preview.currency )} - + )} - + {preview.nextPlan.annual ? t('total_per_year') : t('total_per_month')} - - + + {formatCurrency(preview.nextInvoice.total, preview.currency)} - + -
+
-
- + + ) diff --git a/services/web/frontend/stylesheets/bootstrap-5/pages/subscription.scss b/services/web/frontend/stylesheets/bootstrap-5/pages/subscription.scss index 34ec1135a0..7387402868 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/pages/subscription.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/pages/subscription.scss @@ -499,3 +499,15 @@ } } } + +.payment-summary-card { + @extend .card-gray; + + border-radius: var(--border-radius-large); + + h3 { + margin-top: 0; + margin-bottom: var(--spacing-08); + font-weight: 600; + } +}