@licklist/design 0.44.485-dev.11 → 0.44.485-dev.12
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/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +3 -3
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts +5 -4
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts.map +1 -1
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +1 -1
- package/package.json +1 -1
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +4 -1
- package/src/iframe/order-process/components/BookingSummary/types/index.ts +3 -3
- package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +25 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingSummary.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/BookingSummary/BookingSummary.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,cAAc;uJAWxB,KAAK,mBAAmB,EAAE,oBAAoB,CAAC;;;
|
|
1
|
+
{"version":3,"file":"BookingSummary.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/BookingSummary/BookingSummary.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,cAAc;uJAWxB,KAAK,mBAAmB,EAAE,oBAAoB,CAAC;;;CA4EjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,a=require("@licklist/core/dist/Config"),n=require("../../../../static/loader/LoaderIndicator.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,a=require("@licklist/core/dist/Config"),n=require("../../../../static/loader/LoaderIndicator.js"),o=require("react-i18next");require("../../../../static/index.js");var m=require("react-intl");require("./components/SummaryTotal/components/SummaryTotalBlock.js");var c=require("./components/ProductsByMenuStep/ProductsByMenuStep.js"),l=require("./components/SummaryTotal/SummaryTotal.js"),s=require("./components/BookingSummaryAccordion/BookingSummaryAccordion.js"),i=function(e){var l=e.date,i=e.menuSteps,u=e.formValues,d=e.isNotShownPeopleAmount,p=e.eventName,y=e.transactionFee,E=void 0===y?0:y,v=e.productsWithErrors,f=e.isLoading,N=e.hasPeopleInput,S=e.peopleAmount,g=o.useTranslation("Design").t,B=m.useIntl().formatNumber,j=t.useMemo((function(){if(u){var e=Object.values(u).filter(Boolean);return null==e?void 0:e.filter((function(e){return 0!==(null==e?void 0:e.quantity)}))}}),[u]);return f?r.createElement("div",{className:"payment-booking-summary"},r.createElement(n.LoaderIndicator,{isLoaded:!1})):r.createElement("div",{className:"payment-booking-summary"},r.createElement(s.BookingSummaryAccordion,{hasPeopleInput:N},r.createElement("div",{className:"event-info"},r.createElement("p",{className:"m-0 title event-name"},p),r.createElement("p",{className:"m-0"},l)),r.createElement("hr",null),(null==j?void 0:j.length)>0?r.createElement("div",null,r.createElement("div",{className:"cart-items"},i.map((function(e){return r.createElement(c.ProductsByMenuStep,{key:e.id,orderProducts:j,step:e,productsWithErrors:v})})),!d&&S>0&&r.createElement(r.Fragment,null,r.createElement("hr",null),r.createElement("div",{className:"d-flex justify-content-between mt-3"},r.createElement("p",{className:"m-0"},g("people"),":"),r.createElement("p",{className:"price"},S))),!!E&&r.createElement(r.Fragment,null,r.createElement("hr",null),r.createElement("div",{className:"d-flex justify-content-between mt-3"},r.createElement("p",{className:"m-0"},g("transactionFee"),":"),r.createElement("p",{className:"price"},B(E,{style:"currency",currency:a.Currency.GBP})))))):r.createElement("div",{className:"cart-items"},r.createElement("p",{className:"empty-cart"},g("emptyBasket")))))};i.SummaryTotal=l.SummaryTotal,i.Accordion=s.BookingSummaryAccordion,exports.BookingSummary=i;
|
|
@@ -4,13 +4,13 @@ export declare const MOBILE_WIDTH = 576;
|
|
|
4
4
|
export declare const ACCORDION_KEY = "booking-summary";
|
|
5
5
|
export declare type BookingSummaryProps = {
|
|
6
6
|
date: string;
|
|
7
|
-
menuSteps
|
|
8
|
-
formValues
|
|
7
|
+
menuSteps?: MenuStep[];
|
|
8
|
+
formValues?: {
|
|
9
9
|
[key: string]: Order;
|
|
10
10
|
};
|
|
11
11
|
totalWithDiscount?: number;
|
|
12
12
|
isNotShownPeopleAmount?: boolean;
|
|
13
|
-
eventName
|
|
13
|
+
eventName?: string;
|
|
14
14
|
hasPeopleInput?: boolean;
|
|
15
15
|
transactionFee?: number;
|
|
16
16
|
isFreePayment?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEvD,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C,oBAAY,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,QAAQ,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEvD,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C,oBAAY,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC;KACtB,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,4BAA4B,CAAC,UAAU,CAAC,CAAC;IAC9D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { BookingSummaryProps } from "../../order-process/components/BookingSummary/types";
|
|
3
|
+
import { PaymentMetadata } from "../payment-page/PaymentPage";
|
|
3
4
|
export declare const ORDER_STATUS_FAILED = "failed";
|
|
4
5
|
export declare const ORDER_STATUS_SUCCESS = "success";
|
|
5
6
|
export declare const ORDER_STATUS_PENDING = "pending";
|
|
@@ -8,16 +9,16 @@ interface PaymentStatusComponentProps {
|
|
|
8
9
|
onCloseWindow: () => void;
|
|
9
10
|
onBack?: () => void;
|
|
10
11
|
onTryAgain?: () => void;
|
|
11
|
-
totalAmount?: number;
|
|
12
12
|
isLoading?: boolean;
|
|
13
13
|
status: OrderStatusPrefix;
|
|
14
14
|
isAppUsingInIframe?: boolean;
|
|
15
|
-
|
|
16
|
-
bookingSummaryProps?: Omit<BookingSummaryProps, "transactionFee">;
|
|
15
|
+
bookingSummaryProps?: BookingSummaryProps;
|
|
17
16
|
EventCardComponent?: ReactNode;
|
|
18
17
|
showCloseButton?: boolean;
|
|
19
18
|
email?: string;
|
|
19
|
+
totalAmount?: number;
|
|
20
|
+
paymentMetadata?: PaymentMetadata;
|
|
20
21
|
}
|
|
21
|
-
export declare const PaymentStatusPage: ({ onCloseWindow, onBack, onTryAgain,
|
|
22
|
+
export declare const PaymentStatusPage: ({ onCloseWindow, onBack, onTryAgain, isLoading, status, isAppUsingInIframe, bookingSummaryProps, EventCardComponent, showCloseButton, email, totalAmount, paymentMetadata, }: PaymentStatusComponentProps) => JSX.Element;
|
|
22
23
|
export {};
|
|
23
24
|
//# sourceMappingURL=PaymentStatusPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentStatusPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-status-page/PaymentStatusPage.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;
|
|
1
|
+
{"version":3,"file":"PaymentStatusPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-status-page/PaymentStatusPage.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAC5C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,oBAAY,iBAAiB,GACzB,OAAO,oBAAoB,GAC3B,OAAO,mBAAmB,GAC1B,OAAO,oBAAoB,CAAC;AAEhC,UAAU,2BAA2B;IACnC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAGD,eAAO,MAAM,iBAAiB,iLAa3B,2BAA2B,gBAqF7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),o=require("react"),r=(e=o)&&"object"==typeof e&&"default"in e?e.default:e,a=require("../../../static/loader/LoaderIndicator.js"),n=require("react-i18next");require("../../order-process/components/NavigationFooter/NavigationFooter.js"),require("../../page/components/PageHeader/PageHeader.js");var s=require("../payment-status-header/PaymentStatusHeader.js"),m=require("../../order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.js");require("../../order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.js");var i=require("../../order-process/components/BookingSummary/BookingSummary.js");require("../../order-process/components/NavigationSteps/NavigationSteps.js"),require("../../order-process/components/StepsForm/StepsForm.js"),require("../../order-process/components/Timer/Timer.js"),require("../../order-process/components/PaymentCard/PaymentCard.js");var c=require("../../order-process/components/BookingSummaryFooter/BookingSummaryFooter.js"),l=require("../../page/components/PageBody/PageBody.js");require("../../order-process/components/CalendarStepsForm/CalendarStepsForm.js");var u=require("../../page/Page.js"),p=require("./component/PaymentStatusBody.js"),d="failed",g="success",y="pending";exports.ORDER_STATUS_FAILED=d,exports.ORDER_STATUS_PENDING=y,exports.ORDER_STATUS_SUCCESS=g,exports.PaymentStatusPage=function(e){var o=e.onCloseWindow,S=e.onBack,B=e.onTryAgain,E=e.isLoading,k=e.status,P=e.isAppUsingInIframe,j=e.bookingSummaryProps,q=e.EventCardComponent,v=e.showCloseButton,T=void 0!==v&&v,f=e.email,C=e.totalAmount,F=void 0===C?0:C,h=e.paymentMetadata,_=n.useTranslation("Design").t,b=function(){switch(k){case g:return _("purchaseSuccessful");case y:return _("pendingPayment");default:return _("purchaseFailed")}}();return E?r.createElement(a.LoaderIndicator,{isLoaded:!1}):r.createElement(u.Page,{className:"payment-status-page",headerBlock:r.createElement(s.PaymentStatusHeader,{success:k!==d,showCloseButton:T,onCloseButtonClick:o,title:k===y?_("pendingPayment"):void 0}),isAppUsingInIframe:P},r.createElement(l.PageBody,{leftBlock:r.createElement(l.PageBody.LeftBlock,{title:b},r.createElement("div",null,q,r.createElement(p.PaymentStatusBody,{status:k,onBack:S||o,onTryAgain:B,email:f}))),rightBlock:r.createElement(l.PageBody.RightBlock,{bottomBlock:r.createElement(c.BookingSummaryFooter,{showButton:!1},r.createElement("div",{className:"d-flex flex-column justify-content-between"},h&&r.createElement(r.Fragment,null,r.createElement(m.SummaryTotalBlock,{label:_("total"),amount:h.total||0}),r.createElement(m.SummaryTotalBlock,{label:_("paidSum"),amount:h.paid||0})),r.createElement(m.SummaryTotalBlock,{label:_(h?"remaining":"total"),amount:F+((null==j?void 0:j.transactionFee)||0)})))},j?r.createElement(i.BookingSummary,t.__assign({},j)):r.createElement("h6",null,b))}))};
|
package/package.json
CHANGED
|
@@ -25,6 +25,9 @@ export const BookingSummary = ({
|
|
|
25
25
|
const { formatNumber } = useIntl();
|
|
26
26
|
|
|
27
27
|
const orderProducts = useMemo(() => {
|
|
28
|
+
if (!formValues) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
28
31
|
const products = Object.values(formValues).filter(Boolean) as Order[];
|
|
29
32
|
|
|
30
33
|
return products?.filter((prod) => prod?.quantity !== 0);
|
|
@@ -47,7 +50,7 @@ export const BookingSummary = ({
|
|
|
47
50
|
</div>
|
|
48
51
|
<hr />
|
|
49
52
|
|
|
50
|
-
{orderProducts
|
|
53
|
+
{orderProducts?.length > 0 ? (
|
|
51
54
|
<div>
|
|
52
55
|
<div className="cart-items">
|
|
53
56
|
{menuSteps.map((menuStep: MenuStep) => {
|
|
@@ -6,13 +6,13 @@ export const ACCORDION_KEY = "booking-summary";
|
|
|
6
6
|
|
|
7
7
|
export type BookingSummaryProps = {
|
|
8
8
|
date: string;
|
|
9
|
-
menuSteps
|
|
10
|
-
formValues
|
|
9
|
+
menuSteps?: MenuStep[];
|
|
10
|
+
formValues?: {
|
|
11
11
|
[key: string]: Order;
|
|
12
12
|
};
|
|
13
13
|
totalWithDiscount?: number;
|
|
14
14
|
isNotShownPeopleAmount?: boolean;
|
|
15
|
-
eventName
|
|
15
|
+
eventName?: string;
|
|
16
16
|
hasPeopleInput?: boolean;
|
|
17
17
|
transactionFee?: number;
|
|
18
18
|
isFreePayment?: boolean;
|
|
@@ -9,6 +9,7 @@ import { BookingSummary, BookingSummaryFooter } from "../../order-process";
|
|
|
9
9
|
import { PaymentStatusHeader } from "../payment-status-header/PaymentStatusHeader";
|
|
10
10
|
import { SummaryTotalBlock } from "../../order-process/components/BookingSummary/components/SummaryTotal";
|
|
11
11
|
import { BookingSummaryProps } from "../../order-process/components/BookingSummary/types";
|
|
12
|
+
import { PaymentMetadata } from "../payment-page/PaymentPage";
|
|
12
13
|
|
|
13
14
|
export const ORDER_STATUS_FAILED = "failed";
|
|
14
15
|
export const ORDER_STATUS_SUCCESS = "success";
|
|
@@ -23,15 +24,15 @@ interface PaymentStatusComponentProps {
|
|
|
23
24
|
onCloseWindow: () => void;
|
|
24
25
|
onBack?: () => void;
|
|
25
26
|
onTryAgain?: () => void;
|
|
26
|
-
totalAmount?: number;
|
|
27
27
|
isLoading?: boolean;
|
|
28
28
|
status: OrderStatusPrefix;
|
|
29
29
|
isAppUsingInIframe?: boolean;
|
|
30
|
-
|
|
31
|
-
bookingSummaryProps?: Omit<BookingSummaryProps, "transactionFee">;
|
|
30
|
+
bookingSummaryProps?: BookingSummaryProps;
|
|
32
31
|
EventCardComponent?: ReactNode;
|
|
33
32
|
showCloseButton?: boolean;
|
|
34
33
|
email?: string;
|
|
34
|
+
totalAmount?: number;
|
|
35
|
+
paymentMetadata?: PaymentMetadata;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
// @TODO In future think, how to reuse this component in Iframe Pending, Success and Failed Pages
|
|
@@ -39,15 +40,15 @@ export const PaymentStatusPage = ({
|
|
|
39
40
|
onCloseWindow,
|
|
40
41
|
onBack,
|
|
41
42
|
onTryAgain,
|
|
42
|
-
totalAmount,
|
|
43
43
|
isLoading,
|
|
44
44
|
status,
|
|
45
|
-
transactionFee = 0,
|
|
46
45
|
isAppUsingInIframe,
|
|
47
46
|
bookingSummaryProps,
|
|
48
47
|
EventCardComponent,
|
|
49
48
|
showCloseButton = false,
|
|
50
49
|
email,
|
|
50
|
+
totalAmount = 0,
|
|
51
|
+
paymentMetadata,
|
|
51
52
|
}: PaymentStatusComponentProps) => {
|
|
52
53
|
const { t } = useTranslation("Design");
|
|
53
54
|
|
|
@@ -100,25 +101,31 @@ export const PaymentStatusPage = ({
|
|
|
100
101
|
<PageBody.RightBlock
|
|
101
102
|
bottomBlock={
|
|
102
103
|
<BookingSummaryFooter showButton={false}>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
<div className="d-flex flex-column justify-content-between">
|
|
105
|
+
{paymentMetadata && (
|
|
106
|
+
<>
|
|
107
|
+
<SummaryTotalBlock
|
|
108
|
+
label={t("total")}
|
|
109
|
+
amount={paymentMetadata.total || 0}
|
|
110
|
+
/>
|
|
111
|
+
<SummaryTotalBlock
|
|
112
|
+
label={t("paidSum")}
|
|
113
|
+
amount={paymentMetadata.paid || 0}
|
|
114
|
+
/>
|
|
115
|
+
</>
|
|
116
|
+
)}
|
|
109
117
|
<SummaryTotalBlock
|
|
110
|
-
label={t("total")}
|
|
111
|
-
amount={
|
|
118
|
+
label={t(paymentMetadata ? "remaining" : "total")}
|
|
119
|
+
amount={
|
|
120
|
+
totalAmount + (bookingSummaryProps?.transactionFee || 0)
|
|
121
|
+
}
|
|
112
122
|
/>
|
|
113
|
-
|
|
123
|
+
</div>
|
|
114
124
|
</BookingSummaryFooter>
|
|
115
125
|
}
|
|
116
126
|
>
|
|
117
127
|
{bookingSummaryProps ? (
|
|
118
|
-
<BookingSummary
|
|
119
|
-
{...bookingSummaryProps}
|
|
120
|
-
transactionFee={transactionFee}
|
|
121
|
-
/>
|
|
128
|
+
<BookingSummary {...bookingSummaryProps} />
|
|
122
129
|
) : (
|
|
123
130
|
<h6>{title}</h6>
|
|
124
131
|
)}
|