@newskit-render/my-account 7.154.0 → 7.155.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Components/Elements/ForwardButton/ForwardButton.d.ts +1 -1
- package/dist/cjs/Components/Elements/ForwardButton/ForwardButton.js +1 -1
- package/dist/cjs/Components/Elements/ForwardButton/ForwardButton.js.map +1 -1
- package/dist/cjs/Components/Elements/TimesLoading/TimesLoading.d.ts +4 -1
- package/dist/cjs/Components/Elements/TimesLoading/TimesLoading.js +28 -3
- package/dist/cjs/Components/Elements/TimesLoading/TimesLoading.js.map +1 -1
- package/dist/cjs/Components/Sections/CancelSubscriptionDowngrade/CancelSubscriptionDowngrade.d.ts +2 -2
- package/dist/cjs/Components/Sections/CancellationDetails/types.d.ts +2 -2
- package/dist/cjs/Components/Sections/CancellationOffers/CancellationOffers.d.ts +1 -1
- package/dist/cjs/Components/Sections/CancellationOffers/CancellationOffers.js +54 -13
- package/dist/cjs/Components/Sections/CancellationOffers/CancellationOffers.js.map +1 -1
- package/dist/cjs/Components/Sections/CancellationOffers/types.d.ts +29 -4
- package/dist/cjs/Components/Sections/CancellationReview/types.d.ts +2 -2
- package/dist/cjs/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.d.ts +1 -1
- package/dist/cjs/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.js +6 -7
- package/dist/cjs/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.js.map +1 -1
- package/dist/cjs/Components/Sections/ConfirmSubscriptionOffer/index.d.ts +2 -0
- package/dist/cjs/Components/Sections/ConfirmSubscriptionOffer/index.js.map +1 -1
- package/dist/cjs/Components/Sections/ContactSupport/types.d.ts +2 -2
- package/dist/cjs/Components/Sections/OfferPreview/OfferPreview.d.ts +30 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferPreview.js +189 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferPreview.js.map +1 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferSummary.d.ts +21 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferSummary.js +95 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferSummary.js.map +1 -0
- package/dist/cjs/Components/Sections/OfferPreview/SummaryRow.d.ts +9 -0
- package/dist/cjs/Components/Sections/OfferPreview/SummaryRow.js +38 -0
- package/dist/cjs/Components/Sections/OfferPreview/SummaryRow.js.map +1 -0
- package/dist/cjs/Components/Sections/OfferPreview/index.d.ts +0 -0
- package/dist/cjs/Components/Sections/OfferPreview/index.js +2 -0
- package/dist/cjs/Components/Sections/OfferPreview/index.js.map +1 -0
- package/dist/cjs/Components/Sections/OfferPreview/types.d.ts +0 -0
- package/dist/cjs/Components/Sections/OfferPreview/types.js +2 -0
- package/dist/cjs/Components/Sections/OfferPreview/types.js.map +1 -0
- package/dist/cjs/Components/Sections/SectionContainer/types.d.ts +2 -2
- package/dist/cjs/Components/Templates/CancellationStepperRender.d.ts +4 -5
- package/dist/cjs/Components/Templates/CancellationStepperRender.js +6 -8
- package/dist/cjs/Components/Templates/CancellationStepperRender.js.map +1 -1
- package/dist/cjs/api/queryHandler.js +29 -14
- package/dist/cjs/api/queryHandler.js.map +1 -1
- package/dist/cjs/context/types.d.ts +9 -3
- package/dist/cjs/context/types.js.map +1 -1
- package/dist/cjs/helpers/apiHandlerUtils.js +1 -0
- package/dist/cjs/helpers/apiHandlerUtils.js.map +1 -1
- package/dist/cjs/helpers/cancellationUtils.d.ts +20 -0
- package/dist/cjs/helpers/cancellationUtils.js +110 -1
- package/dist/cjs/helpers/cancellationUtils.js.map +1 -1
- package/dist/cjs/helpers/index.d.ts +1 -0
- package/dist/cjs/helpers/index.js +1 -2
- package/dist/cjs/helpers/index.js.map +1 -1
- package/dist/cjs/helpers/stringUtils.d.ts +1 -0
- package/dist/cjs/helpers/stringUtils.js +9 -0
- package/dist/cjs/helpers/stringUtils.js.map +1 -0
- package/dist/cjs/helpers/subscriptionsUtils.d.ts +2 -1
- package/dist/cjs/helpers/subscriptionsUtils.js +2 -2
- package/dist/cjs/helpers/subscriptionsUtils.js.map +1 -1
- package/dist/cjs/pages/CancellationStepper/CancellationStepperContext.js +90 -18
- package/dist/cjs/pages/CancellationStepper/CancellationStepperContext.js.map +1 -1
- package/dist/cjs/queries/getIncentivePreview.d.ts +2 -0
- package/dist/cjs/queries/getIncentivePreview.js +11 -0
- package/dist/cjs/queries/getIncentivePreview.js.map +1 -0
- package/dist/cjs/queries/index.d.ts +2 -0
- package/dist/cjs/queries/index.js +2 -0
- package/dist/cjs/queries/index.js.map +1 -1
- package/dist/cjs/queries/mutateApplyIncentive.d.ts +2 -0
- package/dist/cjs/queries/mutateApplyIncentive.js +11 -0
- package/dist/cjs/queries/mutateApplyIncentive.js.map +1 -0
- package/dist/esm/Components/Elements/ForwardButton/ForwardButton.d.ts +1 -1
- package/dist/esm/Components/Elements/ForwardButton/ForwardButton.js +1 -1
- package/dist/esm/Components/Elements/ForwardButton/ForwardButton.js.map +1 -1
- package/dist/esm/Components/Elements/TimesLoading/TimesLoading.d.ts +4 -1
- package/dist/esm/Components/Elements/TimesLoading/TimesLoading.js +28 -3
- package/dist/esm/Components/Elements/TimesLoading/TimesLoading.js.map +1 -1
- package/dist/esm/Components/Sections/CancelSubscriptionDowngrade/CancelSubscriptionDowngrade.d.ts +2 -2
- package/dist/esm/Components/Sections/CancellationDetails/types.d.ts +2 -2
- package/dist/esm/Components/Sections/CancellationOffers/CancellationOffers.d.ts +1 -1
- package/dist/esm/Components/Sections/CancellationOffers/CancellationOffers.js +54 -13
- package/dist/esm/Components/Sections/CancellationOffers/CancellationOffers.js.map +1 -1
- package/dist/esm/Components/Sections/CancellationOffers/types.d.ts +29 -4
- package/dist/esm/Components/Sections/CancellationReview/types.d.ts +2 -2
- package/dist/esm/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.d.ts +1 -1
- package/dist/esm/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.js +6 -7
- package/dist/esm/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.js.map +1 -1
- package/dist/esm/Components/Sections/ConfirmSubscriptionOffer/index.d.ts +2 -0
- package/dist/esm/Components/Sections/ConfirmSubscriptionOffer/index.js.map +1 -1
- package/dist/esm/Components/Sections/ContactSupport/types.d.ts +2 -2
- package/dist/esm/Components/Sections/OfferPreview/OfferPreview.d.ts +30 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferPreview.js +159 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferPreview.js.map +1 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferSummary.d.ts +21 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferSummary.js +88 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferSummary.js.map +1 -0
- package/dist/esm/Components/Sections/OfferPreview/SummaryRow.d.ts +9 -0
- package/dist/esm/Components/Sections/OfferPreview/SummaryRow.js +31 -0
- package/dist/esm/Components/Sections/OfferPreview/SummaryRow.js.map +1 -0
- package/dist/esm/Components/Sections/OfferPreview/index.d.ts +0 -0
- package/dist/esm/Components/Sections/OfferPreview/index.js +2 -0
- package/dist/esm/Components/Sections/OfferPreview/index.js.map +1 -0
- package/dist/esm/Components/Sections/OfferPreview/types.d.ts +0 -0
- package/dist/esm/Components/Sections/OfferPreview/types.js +2 -0
- package/dist/esm/Components/Sections/OfferPreview/types.js.map +1 -0
- package/dist/esm/Components/Sections/SectionContainer/types.d.ts +2 -2
- package/dist/esm/Components/Templates/CancellationStepperRender.d.ts +4 -5
- package/dist/esm/Components/Templates/CancellationStepperRender.js +7 -9
- package/dist/esm/Components/Templates/CancellationStepperRender.js.map +1 -1
- package/dist/esm/api/queryHandler.js +29 -14
- package/dist/esm/api/queryHandler.js.map +1 -1
- package/dist/esm/context/types.d.ts +9 -3
- package/dist/esm/context/types.js.map +1 -1
- package/dist/esm/helpers/apiHandlerUtils.js +2 -1
- package/dist/esm/helpers/apiHandlerUtils.js.map +1 -1
- package/dist/esm/helpers/cancellationUtils.d.ts +20 -0
- package/dist/esm/helpers/cancellationUtils.js +106 -0
- package/dist/esm/helpers/cancellationUtils.js.map +1 -1
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -2
- package/dist/esm/helpers/index.js.map +1 -1
- package/dist/esm/helpers/stringUtils.d.ts +1 -0
- package/dist/esm/helpers/stringUtils.js +5 -0
- package/dist/esm/helpers/stringUtils.js.map +1 -0
- package/dist/esm/helpers/subscriptionsUtils.d.ts +2 -1
- package/dist/esm/helpers/subscriptionsUtils.js +2 -2
- package/dist/esm/helpers/subscriptionsUtils.js.map +1 -1
- package/dist/esm/pages/CancellationStepper/CancellationStepperContext.js +91 -19
- package/dist/esm/pages/CancellationStepper/CancellationStepperContext.js.map +1 -1
- package/dist/esm/queries/getIncentivePreview.d.ts +2 -0
- package/dist/esm/queries/getIncentivePreview.js +8 -0
- package/dist/esm/queries/getIncentivePreview.js.map +1 -0
- package/dist/esm/queries/index.d.ts +2 -0
- package/dist/esm/queries/index.js +2 -0
- package/dist/esm/queries/index.js.map +1 -1
- package/dist/esm/queries/mutateApplyIncentive.d.ts +2 -0
- package/dist/esm/queries/mutateApplyIncentive.js +8 -0
- package/dist/esm/queries/mutateApplyIncentive.js.map +1 -0
- package/package.json +4 -4
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { TextBlockProps, DividerProps, GridLayoutItem } from 'newskit';
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
3
|
import { TealiumEventContext, HeaderProps, ContentContainerProps as SharedContentContainerProps, BenefitsListItemContent } from '@newskit-render/shared-components';
|
|
4
|
-
import {
|
|
4
|
+
import { NextStepProps } from '../../Templates/CancellationStepperRender';
|
|
5
5
|
import { ForwardButtonProps } from '../../Elements/ForwardButton/ForwardButton';
|
|
6
6
|
import { OfferProps } from '../../Elements/OfferGroup';
|
|
7
|
+
import { UserData } from 'pages/types';
|
|
7
8
|
export interface CancellationOffersContextProps {
|
|
8
9
|
tealiumContext?: TealiumEventContext;
|
|
9
10
|
showBackButton?: boolean;
|
|
@@ -20,6 +21,29 @@ export interface OffersSection {
|
|
|
20
21
|
titleOverrides?: TextBlockProps;
|
|
21
22
|
items?: OfferProps[];
|
|
22
23
|
}
|
|
24
|
+
export interface CreditBalanceProps {
|
|
25
|
+
beforeApplyingSubscriptionCharges: string;
|
|
26
|
+
afterApplyingSubscriptionCharges: string;
|
|
27
|
+
}
|
|
28
|
+
export interface InvoiceMonthlySummaryBreakdownProps {
|
|
29
|
+
fromDate: string;
|
|
30
|
+
toDate: string;
|
|
31
|
+
creditBalance: CreditBalanceProps;
|
|
32
|
+
subscriptionCharges: string;
|
|
33
|
+
totalAmountToPay: string;
|
|
34
|
+
}
|
|
35
|
+
export interface OfferPreviewDataProps {
|
|
36
|
+
currentPropositionName: string;
|
|
37
|
+
incentiveName: string;
|
|
38
|
+
discountPercentage: number;
|
|
39
|
+
discountValue: string | null;
|
|
40
|
+
term: number;
|
|
41
|
+
billCycleDay: number;
|
|
42
|
+
serviceActivationDate: string;
|
|
43
|
+
invoiceSummary: {
|
|
44
|
+
invoiceMonthlySummaryBreakdown: InvoiceMonthlySummaryBreakdownProps[];
|
|
45
|
+
};
|
|
46
|
+
}
|
|
23
47
|
export interface Benefits {
|
|
24
48
|
showBenefits?: boolean;
|
|
25
49
|
title?: string;
|
|
@@ -28,7 +52,8 @@ export interface Benefits {
|
|
|
28
52
|
items: BenefitsListItemContent[];
|
|
29
53
|
}
|
|
30
54
|
export interface CancellationOffersProps extends CancellationOffersContextProps {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
55
|
+
user: UserData;
|
|
56
|
+
selectedOffer?: string;
|
|
57
|
+
setSelectedOffer: (offer: string) => void;
|
|
58
|
+
onNextStep?: NextStepProps;
|
|
34
59
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HeaderProps, TealiumEventContext, ContentContainerProps as SharedContentContainerProps, ListItemType, ButtonGroupProps } from '@newskit-render/shared-components';
|
|
2
2
|
import { UserData } from '../../../pages/types';
|
|
3
|
-
import {
|
|
3
|
+
import { NextStepProps, SelectionData } from '../../Templates/CancellationStepperRender';
|
|
4
4
|
import { GenericMessageMap } from '../../Elements/Toast';
|
|
5
5
|
import { BaseFormActions } from '../../../context/types';
|
|
6
6
|
export interface CancellationReviewContextProps {
|
|
@@ -17,7 +17,7 @@ export interface CancellationReviewProps extends CancellationReviewContextProps
|
|
|
17
17
|
baseUrl?: string;
|
|
18
18
|
user: UserData;
|
|
19
19
|
selectedReason?: SelectionData | null;
|
|
20
|
-
onNextStep?:
|
|
20
|
+
onNextStep?: NextStepProps;
|
|
21
21
|
setServiceCancellationDate: React.Dispatch<React.SetStateAction<string | null>>;
|
|
22
22
|
handleError?: BaseFormActions['handleError'];
|
|
23
23
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ConfirmSubscriptionOfferProps } from './index';
|
|
2
|
-
export declare const ConfirmSubscriptionOffer: ({ header, user, subscriptionDetails, buttonText, buttonEventContext, buttonUrl, baseUrl, buttonOverrides, }: ConfirmSubscriptionOfferProps) => JSX.Element | null;
|
|
2
|
+
export declare const ConfirmSubscriptionOffer: ({ header, user, subscriptionDetails, buttonText, buttonEventContext, buttonUrl, baseUrl, buttonOverrides, incentiveData, }: ConfirmSubscriptionOfferProps) => JSX.Element | null;
|
|
@@ -30,21 +30,20 @@ var ListItem = function (_a) {
|
|
|
30
30
|
};
|
|
31
31
|
export var ConfirmSubscriptionOffer = function (_a) {
|
|
32
32
|
var _b;
|
|
33
|
-
var header = _a.header, user = _a.user, subscriptionDetails = _a.subscriptionDetails, buttonText = _a.buttonText, buttonEventContext = _a.buttonEventContext, buttonUrl = _a.buttonUrl, _c = _a.baseUrl, baseUrl = _c === void 0 ? '' : _c, buttonOverrides = _a.buttonOverrides;
|
|
33
|
+
var header = _a.header, user = _a.user, subscriptionDetails = _a.subscriptionDetails, buttonText = _a.buttonText, buttonEventContext = _a.buttonEventContext, buttonUrl = _a.buttonUrl, _c = _a.baseUrl, baseUrl = _c === void 0 ? '' : _c, buttonOverrides = _a.buttonOverrides, incentiveData = _a.incentiveData;
|
|
34
34
|
var subscription = (_b = user === null || user === void 0 ? void 0 : user.subscriptions) === null || _b === void 0 ? void 0 : _b[0];
|
|
35
|
-
|
|
36
|
-
if (!subscription || !grantedIncentives)
|
|
35
|
+
if (!subscription || !incentiveData)
|
|
37
36
|
return null;
|
|
38
|
-
var latestIncentive = findLatestIncentiveStartDate(
|
|
37
|
+
var latestIncentive = findLatestIncentiveStartDate(incentiveData.invoiceSummary.invoiceMonthlySummaryBreakdown);
|
|
39
38
|
if (latestIncentive === null)
|
|
40
39
|
return null;
|
|
41
|
-
var discountPercentage =
|
|
40
|
+
var discountPercentage = incentiveData.discountPercentage;
|
|
42
41
|
var price = subscription === null || subscription === void 0 ? void 0 : subscription.price;
|
|
43
42
|
var currency = subscription === null || subscription === void 0 ? void 0 : subscription.currency;
|
|
44
43
|
var initPrice = calculateDiscountedPrice(price, discountPercentage);
|
|
45
44
|
var updates = {
|
|
46
45
|
subscriptionType: subscription.type || '',
|
|
47
|
-
offerStartDate: format(latestIncentive.
|
|
46
|
+
offerStartDate: format(latestIncentive.fromDate, 'dd MMM yyyy'),
|
|
48
47
|
initialPrice: "".concat(formatPrice(initPrice, currency), "/month"),
|
|
49
48
|
regularPrice: "".concat(formatPrice(price, currency), "/month"),
|
|
50
49
|
};
|
|
@@ -54,7 +53,7 @@ export var ConfirmSubscriptionOffer = function (_a) {
|
|
|
54
53
|
return __assign(__assign({}, item), { key: key, description: update !== null && update !== void 0 ? update : item.description });
|
|
55
54
|
});
|
|
56
55
|
var headerTitle = (header === null || header === void 0 ? void 0 : header.title)
|
|
57
|
-
? replaceDate(header.title, latestIncentive.
|
|
56
|
+
? replaceDate(header.title, latestIncentive.fromDate)
|
|
58
57
|
: '';
|
|
59
58
|
return (React.createElement(Stack, { flow: "vertical-center" },
|
|
60
59
|
header && (React.createElement(GridLayoutItem, null,
|
package/dist/esm/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmSubscriptionOffer.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC1D,OAAO,EACL,KAAK,EACL,MAAM,EACN,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,KAAK,EACL,UAAU,EACV,cAAc,EACd,MAAM,EACN,SAAS,GACV,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,qCAAqC,CAAA;AAK5C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAE9D,IAAM,oBAAoB,GAAG,MAAM,CAAC,cAAc,CAAC,qGAAA,4BAE/C,EAAiD,IACpD,KADG,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CACpD,CAAA;AAED,IAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,qJAAA,2EAIjC,EAAyC,KAC5C,KADG,sBAAsB,CAAC,KAAK,EAAE,UAAU,CAAC,CAC5C,CAAA;AAED,IAAM,QAAQ,GAAG,UAAC,EAMU;QAL1B,KAAK,WAAA,EACL,WAAW,iBAAA,EACX,aAAa,mBAAA,EACb,cAAc,oBAAA,EACd,oBAAoB,0BAAA;IACW,OAAA,CAC/B,oBAAC,eAAe,aACd,aAAa,EAAC,UAAU,EACxB,YAAY,EAAC,UAAU,IACnB,aAAa;QAEjB,oBAAC,SAAS,aAAC,gBAAgB,EAAC,mBAAmB,IAAK,cAAc,GAC/D,KAAK,CACI;QACZ,oBAAC,SAAS,aACR,WAAW,EAAC,SAAS,EACrB,gBAAgB,EAAC,gBAAgB,IAC7B,oBAAoB,GAEvB,WAAW,CACF,CACI,CACnB;AAjBgC,CAiBhC,CAAA;AAED,MAAM,CAAC,IAAM,wBAAwB,GAAG,UAAC,
|
|
1
|
+
{"version":3,"file":"ConfirmSubscriptionOffer.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/ConfirmSubscriptionOffer/ConfirmSubscriptionOffer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC1D,OAAO,EACL,KAAK,EACL,MAAM,EACN,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,KAAK,EACL,UAAU,EACV,cAAc,EACd,MAAM,EACN,SAAS,GACV,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,qCAAqC,CAAA;AAK5C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAE9D,IAAM,oBAAoB,GAAG,MAAM,CAAC,cAAc,CAAC,qGAAA,4BAE/C,EAAiD,IACpD,KADG,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CACpD,CAAA;AAED,IAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,qJAAA,2EAIjC,EAAyC,KAC5C,KADG,sBAAsB,CAAC,KAAK,EAAE,UAAU,CAAC,CAC5C,CAAA;AAED,IAAM,QAAQ,GAAG,UAAC,EAMU;QAL1B,KAAK,WAAA,EACL,WAA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C,UAAC,IAAI,IAAK,OAAA,CAC1B,oBAAC,QAAQ,aAAC,GAAG,EAAE,IAAI,CAAC,GAAG,IAAM,IAAI,EAAI,CACtC,EAF2B,CAE3B,CAAC,CACmB;QACvB,oBAAC,UAAU,IACT,SAAS,EAAE;gBACT,EAAE,EAAE,SAAS;gBACb,EAAE,EAAE,UAAU;aACf,EACD,WAAW,EAAE;gBACX,EAAE,EAAE,UAAU;gBACd,EAAE,EAAE,UAAU;aACf;YAED,oBAAC,MAAM,aACL,YAAY,EAAE,kBAAkB,EAChC,SAAS,EAAE;oBACT,KAAK,EAAE;wBACL,EAAE,EAAE,MAAM;wBACV,EAAE,EAAE,MAAM;qBACX;iBACF,IACG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC/D,eAAe,GAElB,UAAU,CACJ,CACE,CACP,CACT,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EventContext, HeaderProps } from '@newskit-render/shared-components';
|
|
2
2
|
import { UserData } from '../../../pages/types';
|
|
3
3
|
import { BlockProps, ButtonProps, TextBlockProps } from 'newskit';
|
|
4
|
+
import { PreviewIncentiveProps } from '../../../helpers';
|
|
4
5
|
export * from './ConfirmSubscriptionOffer';
|
|
5
6
|
export interface ConfirmSubscriptionOfferProps {
|
|
6
7
|
header: HeaderProps;
|
|
@@ -16,6 +17,7 @@ export interface ConfirmSubscriptionOfferProps {
|
|
|
16
17
|
buttonUrl?: string;
|
|
17
18
|
baseUrl?: string;
|
|
18
19
|
buttonOverrides?: ButtonProps;
|
|
20
|
+
incentiveData: PreviewIncentiveProps | null;
|
|
19
21
|
}
|
|
20
22
|
export interface SubscriptionOfferListItem {
|
|
21
23
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/ConfirmSubscriptionOffer/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/ConfirmSubscriptionOffer/index.ts"],"names":[],"mappings":"AAKA,cAAc,4BAA4B,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { GridLayoutItem, ButtonProps } from 'newskit';
|
|
3
3
|
import { TealiumEventContext, HeaderProps, ContentContainerProps as SharedContentContainerProps, ListItemType } from '@newskit-render/shared-components';
|
|
4
|
-
import {
|
|
4
|
+
import { NextStepProps } from 'Components/Templates/CancellationStepperRender';
|
|
5
5
|
export interface ContactMethodListItem extends Omit<ListItemType, 'default'> {
|
|
6
6
|
default: string | string[] | JSX.Element;
|
|
7
7
|
}
|
|
@@ -17,5 +17,5 @@ export interface ContactSupportContextProps {
|
|
|
17
17
|
continueButtonContainerOverrides?: ComponentProps<typeof GridLayoutItem>;
|
|
18
18
|
}
|
|
19
19
|
export interface ContactSupportProps extends ContactSupportContextProps {
|
|
20
|
-
onNextStep?:
|
|
20
|
+
onNextStep?: NextStepProps;
|
|
21
21
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { HeaderProps } from '@newskit-render/shared-components';
|
|
3
|
+
import { PreviewIncentiveProps } from '../../../helpers';
|
|
4
|
+
import { UserData } from '../../../pages/types';
|
|
5
|
+
import { ForwardButtonProps } from '../../../Components/Elements/ForwardButton/ForwardButton';
|
|
6
|
+
import { OfferSummaryProps } from './OfferSummary';
|
|
7
|
+
import { NextStepProps } from '../../../Components/Templates/CancellationStepperRender';
|
|
8
|
+
export interface OfferPreviewContextProps {
|
|
9
|
+
header?: HeaderProps;
|
|
10
|
+
subscriptionSummary: OfferSummaryProps;
|
|
11
|
+
paymentSummary: {
|
|
12
|
+
sectionTitle: string;
|
|
13
|
+
};
|
|
14
|
+
note: {
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
continueButton: ForwardButtonProps & {
|
|
19
|
+
nextStep: string;
|
|
20
|
+
};
|
|
21
|
+
user: UserData;
|
|
22
|
+
}
|
|
23
|
+
export interface OfferPreviewPops extends OfferPreviewContextProps {
|
|
24
|
+
selectedOffer?: string;
|
|
25
|
+
baseUrl?: string;
|
|
26
|
+
onNextStep: NextStepProps;
|
|
27
|
+
setIncentiveData: React.Dispatch<React.SetStateAction<PreviewIncentiveProps | null>>;
|
|
28
|
+
incentiveData?: PreviewIncentiveProps | null;
|
|
29
|
+
}
|
|
30
|
+
export declare const OfferPreview: FC<OfferPreviewPops>;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
53
|
+
import { Header } from '@newskit-render/shared-components';
|
|
54
|
+
import { Block, Button, getColorCssFromTheme, GridLayout, GridLayoutItem, Stack, styled, TextBlock, } from 'newskit';
|
|
55
|
+
import { applyIncentive, getDefaultItemValue, getOfferPreviewData, getValueDescription, populateSubscriptionSummaryData, } from '../../../helpers';
|
|
56
|
+
import { OfferSummary } from './OfferSummary';
|
|
57
|
+
import { TimesLoading } from '../../../Components/Elements/TimesLoading';
|
|
58
|
+
import sendToast from '../../../Components/Elements/Toast/sendToast';
|
|
59
|
+
var StyledStack = styled(Stack)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: 1px solid;\n height: auto;\n ", ";\n"], ["\n border: 1px solid;\n height: auto;\n ", ";\n"])), getColorCssFromTheme('borderColor', 'neutral030'));
|
|
60
|
+
var StyledLoading = styled(Stack)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border: 1px solid;\n height: auto;\n ", ";\n"], ["\n border: 1px solid;\n height: auto;\n ", ";\n"])), getColorCssFromTheme('borderColor', 'neutral040'));
|
|
61
|
+
export var OfferPreview = function (_a) {
|
|
62
|
+
var _b;
|
|
63
|
+
var header = _a.header, subscriptionSummary = _a.subscriptionSummary, note = _a.note, paymentSummary = _a.paymentSummary, continueButton = _a.continueButton, user = _a.user, selectedOffer = _a.selectedOffer, onNextStep = _a.onNextStep, setIncentiveData = _a.setIncentiveData, incentiveData = _a.incentiveData;
|
|
64
|
+
var _c = useState(true), loading = _c[0], setLoading = _c[1];
|
|
65
|
+
var _d = useState(selectedOffer || ''), offerCode = _d[0], setOfferCode = _d[1];
|
|
66
|
+
var enrichedSubscriptionSummary = useMemo(function () {
|
|
67
|
+
if (incentiveData && user) {
|
|
68
|
+
var components2 = populateSubscriptionSummaryData(incentiveData, subscriptionSummary, user);
|
|
69
|
+
return components2;
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}, [subscriptionSummary, incentiveData, user]);
|
|
73
|
+
var handleError = function (message) {
|
|
74
|
+
sendToast('', 'error', undefined, undefined, message);
|
|
75
|
+
};
|
|
76
|
+
useEffect(function () {
|
|
77
|
+
var fetchOfferPreviewData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
78
|
+
var incentiveCode, response, error_1;
|
|
79
|
+
var _a, _b;
|
|
80
|
+
return __generator(this, function (_c) {
|
|
81
|
+
switch (_c.label) {
|
|
82
|
+
case 0:
|
|
83
|
+
_c.trys.push([0, 2, 3, 4]);
|
|
84
|
+
incentiveCode = offerCode || sessionStorage.getItem('selectedOfferId') || '';
|
|
85
|
+
setOfferCode(incentiveCode);
|
|
86
|
+
if (!incentiveCode)
|
|
87
|
+
throw new Error('No selected offer ID found');
|
|
88
|
+
return [4 /*yield*/, getOfferPreviewData({
|
|
89
|
+
subscriptionCode: (_b = (_a = user.subscriptions) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id,
|
|
90
|
+
incentiveCode: incentiveCode,
|
|
91
|
+
})];
|
|
92
|
+
case 1:
|
|
93
|
+
response = _c.sent();
|
|
94
|
+
setIncentiveData(response.previewIncentive);
|
|
95
|
+
return [3 /*break*/, 4];
|
|
96
|
+
case 2:
|
|
97
|
+
error_1 = _c.sent();
|
|
98
|
+
handleError('There was an error loading the data. Please try again later.');
|
|
99
|
+
return [3 /*break*/, 4];
|
|
100
|
+
case 3:
|
|
101
|
+
setLoading(false);
|
|
102
|
+
return [7 /*endfinally*/];
|
|
103
|
+
case 4: return [2 /*return*/];
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}); };
|
|
107
|
+
fetchOfferPreviewData();
|
|
108
|
+
}, []);
|
|
109
|
+
var paymentExpDate = getValueDescription(user, 'payment', 'expiry date');
|
|
110
|
+
var handleContinue = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
111
|
+
var error_2;
|
|
112
|
+
var _a, _b;
|
|
113
|
+
return __generator(this, function (_c) {
|
|
114
|
+
switch (_c.label) {
|
|
115
|
+
case 0:
|
|
116
|
+
_c.trys.push([0, 2, 3, 4]);
|
|
117
|
+
setLoading(true);
|
|
118
|
+
return [4 /*yield*/, applyIncentive(offerCode, ((_b = (_a = user.subscriptions) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id) || '')];
|
|
119
|
+
case 1:
|
|
120
|
+
_c.sent();
|
|
121
|
+
onNextStep(event, continueButton.nextStep);
|
|
122
|
+
return [3 /*break*/, 4];
|
|
123
|
+
case 2:
|
|
124
|
+
error_2 = _c.sent();
|
|
125
|
+
handleError('There was an error applying the offer. Please try again later.');
|
|
126
|
+
return [3 /*break*/, 4];
|
|
127
|
+
case 3:
|
|
128
|
+
setLoading(false);
|
|
129
|
+
return [7 /*endfinally*/];
|
|
130
|
+
case 4: return [2 /*return*/];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}); };
|
|
134
|
+
return (React.createElement(Block, null,
|
|
135
|
+
header && React.createElement(Header, __assign({}, header)),
|
|
136
|
+
React.createElement(GridLayout, { rowGap: "space070", columns: "12fr", "data-testid": "offer-preview" },
|
|
137
|
+
React.createElement(GridLayoutItem, null, enrichedSubscriptionSummary ? (React.createElement(React.Fragment, null,
|
|
138
|
+
React.createElement(TextBlock, { "data-testid": "offer-summary-title", paddingBlockEnd: "space030", typographyPreset: "utilitySubheading020" }, enrichedSubscriptionSummary.sectionTitle),
|
|
139
|
+
React.createElement(OfferSummary, __assign({}, enrichedSubscriptionSummary)))) : (React.createElement(StyledLoading, { flow: "horizontal-center", stackDistribution: "center", "data-testid": "loading-offer", paddingBlock: "space080" },
|
|
140
|
+
React.createElement(TimesLoading, { height: "auto", loadingText: "Loading payment information" })))),
|
|
141
|
+
React.createElement(GridLayoutItem, null,
|
|
142
|
+
React.createElement(TextBlock, { "data-testid": "payment-summary-title", paddingBlockEnd: "space030", typographyPreset: "utilitySubheading020" }, paymentSummary.sectionTitle),
|
|
143
|
+
React.createElement(StyledStack, { paddingBlock: "space040", paddingInline: "space040", flow: "horizontal-center", stackDistribution: "space-between" },
|
|
144
|
+
getDefaultItemValue(user, 'payment', ''),
|
|
145
|
+
React.createElement(TextBlock, { stylePreset: "inkSubtle", typographyPreset: "utilityBody010" }, paymentExpDate))),
|
|
146
|
+
React.createElement(GridLayoutItem, null,
|
|
147
|
+
React.createElement(TextBlock, { "data-testid": "note-title", typographyPreset: "utilitySubheading020", paddingBlockEnd: "space030" }, note.title),
|
|
148
|
+
React.createElement(TextBlock, { typographyPreset: "utilityBody010", stylePreset: "inkSubtle" }, note.description)),
|
|
149
|
+
React.createElement(Stack, { flow: { md: 'horizontal-center', xs: 'vertical-center' }, stackDistribution: "flex-end", flowReverse: { xs: true, md: false } },
|
|
150
|
+
continueButton.label,
|
|
151
|
+
React.createElement(Button, { disabled: loading, onClick: handleContinue, eventContext: continueButton === null || continueButton === void 0 ? void 0 : continueButton.eventContext, overrides: __assign({ width: {
|
|
152
|
+
xs: '100%',
|
|
153
|
+
md: 'auto',
|
|
154
|
+
}, marginInlineStart: {
|
|
155
|
+
md: 'space050',
|
|
156
|
+
}, marginBlockEnd: { xs: 'space040', md: 'space000' } }, continueButton === null || continueButton === void 0 ? void 0 : continueButton.buttonOverrides) }, (_b = continueButton === null || continueButton === void 0 ? void 0 : continueButton.button) === null || _b === void 0 ? void 0 : _b.text)))));
|
|
157
|
+
};
|
|
158
|
+
var templateObject_1, templateObject_2;
|
|
159
|
+
//# sourceMappingURL=OfferPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OfferPreview.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/OfferPreview/OfferPreview.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;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ymentBreakdownProps {
|
|
4
|
+
title: string;
|
|
5
|
+
accountCreditRow: SummaryRowProps;
|
|
6
|
+
discountedSubscriptionRow?: SummaryRowProps;
|
|
7
|
+
offerSubscriptionRow?: SummaryRowProps;
|
|
8
|
+
}
|
|
9
|
+
export interface OfferSummaryProps {
|
|
10
|
+
sectionTitle: string;
|
|
11
|
+
offerTitle: string;
|
|
12
|
+
discountName: string;
|
|
13
|
+
discountPercentage: number;
|
|
14
|
+
discountStartDate: string;
|
|
15
|
+
fullPriceSubscriptionPrice: string;
|
|
16
|
+
fullPriceSubscriptionStartDate: string;
|
|
17
|
+
paymentBreakdown?: PaymentBreakdownProps;
|
|
18
|
+
nextPaymentRow: SummaryRowProps;
|
|
19
|
+
remainingCredit?: SummaryRowProps;
|
|
20
|
+
}
|
|
21
|
+
export declare const OfferSummary: FC<OfferSummaryProps>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import { Divider, GridLayout, styled, TextBlock, getColorCssFromTheme, Block, getBorderCssFromTheme, getSpacingCssFromTheme, } from 'newskit';
|
|
18
|
+
import { SummaryRow } from './SummaryRow';
|
|
19
|
+
var StyledGridLayout = styled(GridLayout)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
20
|
+
var StyledSection = styled(GridLayout)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border: 1px solid;\n ", ";\n"], ["\n border: 1px solid;\n ", ";\n"])), getColorCssFromTheme('borderColor', 'neutral030'));
|
|
21
|
+
var StylesBlock = styled(Block)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border: 1px solid;\n ", ";\n ", ";\n ", "\n ", "\n right: 0;\n position: absolute;\n"], ["\n border: 1px solid;\n ", ";\n ", ";\n ", "\n ", "\n right: 0;\n position: absolute;\n"])), getColorCssFromTheme('borderColor', 'teal040'), getColorCssFromTheme('backgroundColor', 'teal010'), getBorderCssFromTheme('borderRadius', 'borderRadiusRounded010'), getSpacingCssFromTheme('padding', 'space020'));
|
|
22
|
+
export var OfferSummary = function (_a) {
|
|
23
|
+
var sectionTitle = _a.sectionTitle, offerTitle = _a.offerTitle, discountName = _a.discountName, discountPercentage = _a.discountPercentage, fullPriceSubscriptionPrice = _a.fullPriceSubscriptionPrice, fullPriceSubscriptionStartDate = _a.fullPriceSubscriptionStartDate, paymentBreakdown = _a.paymentBreakdown, nextPaymentRow = _a.nextPaymentRow, remainingCredit = _a.remainingCredit, discountStartDate = _a.discountStartDate;
|
|
24
|
+
return (React.createElement(React.Fragment, null,
|
|
25
|
+
React.createElement(StyledSection, { rowGap: "space040", columns: '12fr', overrides: {
|
|
26
|
+
paddingBlock: 'space040',
|
|
27
|
+
paddingInline: 'space040',
|
|
28
|
+
} },
|
|
29
|
+
React.createElement(TextBlock, { "data-testid": "offer-title", typographyPreset: "editorialHeadline010" }, offerTitle),
|
|
30
|
+
React.createElement(Divider, { overrides: {
|
|
31
|
+
marginBlock: 'space010',
|
|
32
|
+
} }),
|
|
33
|
+
React.createElement(StyledGridLayout, { rowGap: "space030" },
|
|
34
|
+
React.createElement(TextBlock, { "data-testid": "discount-name", typographyPreset: "utilitySubheading020" }, discountName),
|
|
35
|
+
React.createElement(TextBlock, { "data-testid": "discount-start-date", stylePreset: "inkSubtle", typographyPreset: "utilityBody010" }, discountStartDate),
|
|
36
|
+
React.createElement(StylesBlock, null,
|
|
37
|
+
React.createElement(TextBlock, { typographyPreset: "utilityLabel010" },
|
|
38
|
+
discountPercentage,
|
|
39
|
+
"% off"))),
|
|
40
|
+
React.createElement(GridLayout, { rowGap: "space030", overrides: {
|
|
41
|
+
marginBlockStart: 'space020',
|
|
42
|
+
} },
|
|
43
|
+
React.createElement(TextBlock, { "data-testid": "full-price-subscription-price", typographyPreset: "utilitySubheading020" }, fullPriceSubscriptionPrice),
|
|
44
|
+
React.createElement(TextBlock, { "data-testid": "full-price-subscription-start-date", stylePreset: "inkSubtle", typographyPreset: "utilityBody010" }, fullPriceSubscriptionStartDate)),
|
|
45
|
+
paymentBreakdown && (React.createElement(React.Fragment, null,
|
|
46
|
+
React.createElement(Divider, { overrides: {
|
|
47
|
+
marginBlock: 'space010',
|
|
48
|
+
} }),
|
|
49
|
+
React.createElement(TextBlock, { typographyPreset: "utilitySubheading020" }, paymentBreakdown.title),
|
|
50
|
+
paymentBreakdown.offerSubscriptionRow && (React.createElement(SummaryRow, __assign({}, paymentBreakdown.offerSubscriptionRow, { "data-testid": "offer-subscription-row", labelOverrides: {
|
|
51
|
+
stylePreset: 'inkSubtle',
|
|
52
|
+
typographyPreset: 'utilityBody010',
|
|
53
|
+
}, valueOverrides: {
|
|
54
|
+
stylePreset: 'inkSubtle',
|
|
55
|
+
typographyPreset: 'utilityBody010',
|
|
56
|
+
} }))),
|
|
57
|
+
React.createElement(SummaryRow, __assign({}, paymentBreakdown.accountCreditRow, { "data-testid": "account-credit-row", labelOverrides: {
|
|
58
|
+
stylePreset: 'inkSubtle',
|
|
59
|
+
typographyPreset: 'utilityBody010',
|
|
60
|
+
}, valueOverrides: {
|
|
61
|
+
stylePreset: 'inkSubtle',
|
|
62
|
+
typographyPreset: 'utilityBody010',
|
|
63
|
+
} })),
|
|
64
|
+
paymentBreakdown.discountedSubscriptionRow && (React.createElement(SummaryRow, __assign({}, paymentBreakdown.discountedSubscriptionRow, { "data-testid": "discounted-subscription-row", labelOverrides: {
|
|
65
|
+
stylePreset: 'inkSubtle',
|
|
66
|
+
typographyPreset: 'utilityBody010',
|
|
67
|
+
}, valueOverrides: {
|
|
68
|
+
stylePreset: 'inkSubtle',
|
|
69
|
+
typographyPreset: 'utilityBody010',
|
|
70
|
+
} }))))),
|
|
71
|
+
React.createElement(Divider, { overrides: {
|
|
72
|
+
marginBlock: 'space010',
|
|
73
|
+
} }),
|
|
74
|
+
React.createElement(SummaryRow, __assign({}, nextPaymentRow, { "data-testid": "next-payment-row", labelOverrides: {
|
|
75
|
+
typographyPreset: 'utilitySubheading030',
|
|
76
|
+
}, valueOverrides: {
|
|
77
|
+
typographyPreset: 'utilitySubheading030',
|
|
78
|
+
} })),
|
|
79
|
+
remainingCredit && (React.createElement(SummaryRow, __assign({}, remainingCredit, { "data-testid": "remaining-credit-row", labelOverrides: {
|
|
80
|
+
stylePreset: 'inkSubtle',
|
|
81
|
+
typographyPreset: 'utilityBody010',
|
|
82
|
+
}, valueOverrides: {
|
|
83
|
+
stylePreset: 'inkSubtle',
|
|
84
|
+
typographyPreset: 'utilityBody010',
|
|
85
|
+
} }))))));
|
|
86
|
+
};
|
|
87
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
88
|
+
//# sourceMappingURL=OfferSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OfferSummary.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/OfferPreview/OfferSummary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,EACL,OAAO,EACP,UAAU,EACV,MAAM,EACN,SAAS,EACT,oBAAoB,EACpB,KAAK,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,UAAU,EAAm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,eACL,gBAAgB,CAAC,yBAAyB,mBAClC,6BAA6B,EACzC,cAAc,EAAE;wBACd,WAAW,EAAE,WAAW;wBACxB,gBAAgB,EAAE,gBAAgB;qBACnC,EACD,cAAc,EAAE;wBACd,WAAW,EAAE,WAAW;wBACxB,gBAAgB,EAAE,gBAAgB;qBACnC,IACD,CACH,CACA,CACJ;YAED,oBAAC,OAAO,IACN,SAAS,EAAE;oBACT,WAAW,EAAE,UAAU;iBACxB,GACD;YACF,oBAAC,UAAU,eACL,cAAc,mBACN,kBAAkB,EAC9B,cAAc,EAAE;oBACd,gBAAgB,EAAE,sBAAsB;iBACzC,EACD,cAAc,EAAE;oBACd,gBAAgB,EAAE,sBAAsB;iBACzC,IACD;YACD,eAAe,IAAI,CAClB,oBAAC,UAAU,eACL,eAAe,mBACP,sBAAsB,EAClC,cAAc,EAAE;oBACd,WAAW,EAAE,WAAW;oBACxB,gBAAgB,EAAE,gBAAgB;iBACnC,EACD,cAAc,EAAE;oBACd,WAAW,EAAE,WAAW;oBACxB,gBAAgB,EAAE,gBAAgB;iBACnC,IACD,CACH,CACa,CACf,CACJ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TextBlockProps } from 'newskit';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface SummaryRowProps {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
labelOverrides?: TextBlockProps;
|
|
7
|
+
valueOverrides?: TextBlockProps;
|
|
8
|
+
}
|
|
9
|
+
export declare const SummaryRow: React.FC<SummaryRowProps>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { TextBlock, Stack } from 'newskit';
|
|
24
|
+
import React from 'react';
|
|
25
|
+
export var SummaryRow = function (_a) {
|
|
26
|
+
var label = _a.label, value = _a.value, labelOverrides = _a.labelOverrides, valueOverrides = _a.valueOverrides, rest = __rest(_a, ["label", "value", "labelOverrides", "valueOverrides"]);
|
|
27
|
+
return (React.createElement(Stack, __assign({ flow: "horizontal-stretch", stackDistribution: "space-between" }, rest),
|
|
28
|
+
React.createElement(TextBlock, __assign({}, labelOverrides), label),
|
|
29
|
+
React.createElement(TextBlock, __assign({}, valueOverrides), value)));
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=SummaryRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SummaryRow.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/OfferPreview/SummaryRow.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAkB,MAAM,SAAS,CAAA;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,MAAM,CAAC,IAAM,UAAU,GAA8B,UAAC,EAMrD;IALC,IAAA,KAAK,WAAA,EACL,KAAK,WAAA,EACL,cAAc,oBAAA,EACd,cAAc,oBAAA,EACX,IAAI,cAL6C,sDAMrD,CADQ;IAEP,OAAO,CACL,oBAAC,KAAK,aACJ,IAAI,EAAC,oBAAoB,EACzB,iBAAiB,EAAC,eAAe,IAC7B,IAAI;QAER,oBAAC,SAAS,eAAK,cAAc,GAAG,KAAK,CAAa;QAClD,oBAAC,SAAS,eAAK,cAAc,GAAG,KAAK,CAAa,CAC5C,CACT,CAAA;AACH,CAAC,CAAA"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/OfferPreview/index.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/OfferPreview/types.ts"],"names":[],"mappings":""}
|
|
@@ -2,7 +2,7 @@ import { InfoPanel, IntroductionProps, ModalProps, ListItemType, InvoiceAndNotic
|
|
|
2
2
|
import { StandaloneLinkPropsOverridable } from '../../Elements/StandaloneLinkComponent';
|
|
3
3
|
import { MQ, ImageProps } from 'newskit';
|
|
4
4
|
import { NewslettersGridOverrides, CancellationItem, CancellationSection } from '../../../context/types';
|
|
5
|
-
import { HandleCardClick,
|
|
5
|
+
import { HandleCardClick, NextStepProps } from '../../Templates/CancellationStepperRender';
|
|
6
6
|
import { UserData } from '../../../pages/types';
|
|
7
7
|
export type BelowContentExtra = {
|
|
8
8
|
type: 'delivery-address' | 'cancel-subscription' | 'no-billing' | 'payment-history' | 'leave-family';
|
|
@@ -34,7 +34,7 @@ export interface BaseSectionProps extends CancellationSection, CancellationItem
|
|
|
34
34
|
}
|
|
35
35
|
export interface GridSectionProps extends CancellationSection {
|
|
36
36
|
baseUrl?: string;
|
|
37
|
-
onNextStep:
|
|
37
|
+
onNextStep: NextStepProps;
|
|
38
38
|
handleCardClick: HandleCardClick;
|
|
39
39
|
eventContext?: EventContext;
|
|
40
40
|
user?: UserData;
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { EventContext } from '@newskit-render/shared-components';
|
|
3
3
|
export declare const componentMap: {
|
|
4
4
|
reason: ({ belowItemExtra, onNextStep, handleCardClick, items, ...props }: import("../Sections/SectionContainer").GridSectionProps) => JSX.Element;
|
|
5
|
-
downgrade: React.FC<import("../Sections/CancelSubscriptionDowngrade/CancelSubscriptionDowngrade").CancelSubscriptionDowngradeProps>;
|
|
6
5
|
preCancellation: ({ header, containerOverrides, user, subscriptionName, subscriptionEnd, selectedReason, defaultCancellationReason, dividerOverrides, continueButton, genericErrorMessage, setServiceCancellationDate, handleError, onNextStep, }: import("../Sections/CancellationDetails").CancellationDetailsProps) => JSX.Element;
|
|
7
6
|
confirmCancel: ({ featureFlags, ...rest }: import("../Sections/ConfirmCancellation").ConfirmCancellationStepProps) => React.CElement<{
|
|
8
7
|
image: {
|
|
@@ -59,18 +58,18 @@ export declare const componentMap: {
|
|
|
59
58
|
};
|
|
60
59
|
};
|
|
61
60
|
}, any, any>>;
|
|
62
|
-
offers: ({ baseUrl, header, offersSection, benefits, continueButton, continueButtonContainerOverrides,
|
|
63
|
-
|
|
64
|
-
offerConfirmation: ({ header, user, subscriptionDetails, buttonText, buttonEventContext, buttonUrl, baseUrl, buttonOverrides, }: import("../Sections/ConfirmSubscriptionOffer").ConfirmSubscriptionOfferProps) => JSX.Element | null;
|
|
61
|
+
offers: ({ baseUrl, header, offersSection, benefits, continueButton, continueButtonContainerOverrides, setSelectedOffer, selectedOffer, onNextStep, }: import("../Sections/CancellationOffers").CancellationOffersProps) => JSX.Element;
|
|
62
|
+
offerConfirmation: ({ header, user, subscriptionDetails, buttonText, buttonEventContext, buttonUrl, baseUrl, buttonOverrides, incentiveData, }: import("../Sections/ConfirmSubscriptionOffer").ConfirmSubscriptionOfferProps) => JSX.Element | null;
|
|
65
63
|
contactSupport: ({ header, contactMethods, continueButton, continueButtonContainerOverrides, onNextStep, }: import("../Sections/ContactSupport").ContactSupportProps) => JSX.Element;
|
|
66
64
|
reviewCancellation: ({ baseUrl, header, details, user, cancellationButtons, selectedReason, defaultCancellationReason, genericErrorMessage, setServiceCancellationDate, handleError, onNextStep, }: import("../Sections/CancellationReview").CancellationReviewProps) => JSX.Element;
|
|
65
|
+
offerPreview: React.FC<import("../Sections/OfferPreview/OfferPreview").OfferPreviewPops>;
|
|
67
66
|
};
|
|
68
67
|
export type SelectionData = {
|
|
69
68
|
id: string;
|
|
70
69
|
label?: string;
|
|
71
70
|
eventContext?: EventContext;
|
|
72
71
|
};
|
|
73
|
-
export type
|
|
72
|
+
export type NextStepProps = (event: React.MouseEvent, override?: string | null, eventContext?: Record<string, string>) => void;
|
|
74
73
|
export type HandleCardClick = (event: React.MouseEvent, selectionData: SelectionData) => void;
|
|
75
74
|
declare const CancellationStepperRender: React.FC;
|
|
76
75
|
export default CancellationStepperRender;
|