@licklist/design 0.50.1-dev.6 → 0.50.1-dev.8

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.
Files changed (26) hide show
  1. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts +1 -1
  2. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
  3. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
  4. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts +2 -1
  5. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
  6. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.js +1 -1
  7. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts +2 -1
  8. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts.map +1 -1
  9. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.js +1 -1
  10. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +1 -0
  11. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
  12. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
  13. package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
  14. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
  15. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.js +1 -1
  16. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +2 -1
  17. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  18. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +1 -1
  19. package/package.json +1 -1
  20. package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +2 -0
  21. package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +12 -6
  22. package/src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx +3 -0
  23. package/src/iframe/order-process/components/BookingSummary/types/index.ts +1 -0
  24. package/src/iframe/order-process/components/BookingSummary/utils/index.ts +2 -4
  25. package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +13 -23
  26. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +9 -3
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { BookingSummaryProps } from "./types";
3
3
  export declare const BookingSummary: {
4
- ({ date, time, menuSteps, formValues, shouldHidePeopleAmount, eventName, transactionFee, productsWithErrors, isLoading, hasPeopleInput, peopleAmount, }: Omit<BookingSummaryProps, "totallWithDiscount">): JSX.Element;
4
+ ({ date, time, menuSteps, formValues, shouldHidePeopleAmount, eventName, transactionFee, productsWithErrors, isLoading, hasPeopleInput, isPaymentLink, peopleAmount, }: Omit<BookingSummaryProps, "totallWithDiscount">): JSX.Element;
5
5
  SummaryTotal: ({ formValues, totalWithDiscount, transactionFee, isFreePayment, }: Pick<BookingSummaryProps, "formValues" | "totalWithDiscount" | "transactionFee" | "isFreePayment">) => JSX.Element;
6
6
  Accordion: ({ children, title, showTitleOnlyOnMobile, hasPeopleInput, }: import("./components/BookingSummaryAccordion").BookingSummaryAccordionProps) => JSX.Element;
7
7
  };
@@ -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;6JAYxB,KAAK,mBAAmB,EAAE,oBAAoB,CAAC;;;CAsEjD,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;4KAaxB,KAAK,mBAAmB,EAAE,oBAAoB,CAAC;;;CAuEjD,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"),m=require("react-i18next");require("../../../../static/index.js");var c=require("lodash"),o=require("react-intl");require("./components/SummaryTotal/components/SummaryTotalBlock.js");var l=require("./components/ProductsByMenuStep/ProductsByMenuStep.js"),s=require("./components/SummaryTotal/SummaryTotal.js"),i=require("./components/BookingSummaryAccordion/BookingSummaryAccordion.js"),u=function(e){var t,s=e.date,u=e.time,d=e.menuSteps,p=e.formValues,y=void 0===p?{}:p,E=e.shouldHidePeopleAmount,v=e.eventName,N=e.transactionFee,S=void 0===N?0:N,f=e.productsWithErrors,g=void 0===f?[]:f,k=e.isLoading,q=e.hasPeopleInput,B=e.peopleAmount,h=m.useTranslation("Design").t,j=o.useIntl().formatNumber;return k?r.createElement("div",{className:"payment-booking-summary"},r.createElement(n.LoaderIndicator,{isLoaded:!1})):r.createElement("div",{className:"payment-booking-summary"},r.createElement(i.BookingSummaryAccordion,{hasPeopleInput:q},r.createElement("div",{className:"event-info"},r.createElement("p",{className:"m-0 title event-name"},v),r.createElement("p",{className:"m-0"},s),u&&r.createElement("p",{className:"m-0"},u)),r.createElement("hr",null),(null===(t=c.values(y))||void 0===t?void 0:t.length)>0?r.createElement("div",null,r.createElement("div",{className:"cart-items"},r.createElement("div",{className:"products-by-menu-step"},d.map((function(e){return r.createElement(l.ProductsByMenuStep,{key:e.id,orderItems:y,step:e,productsWithErrors:g})}))),!E&&B>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"},h("people"),":"),r.createElement("p",{className:"price"},B))),!!S&&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"},h("transactionFee"),":"),r.createElement("p",{className:"price"},j(S,{style:"currency",currency:a.Currency.GBP})))))):r.createElement("div",{className:"cart-items"},r.createElement("p",{className:"empty-cart"},h("emptyBasket")))))};u.SummaryTotal=s.SummaryTotal,u.Accordion=i.BookingSummaryAccordion,exports.BookingSummary=u;
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"),m=require("react-i18next");require("../../../../static/index.js");var c=require("lodash"),o=require("react-intl");require("./components/SummaryTotal/components/SummaryTotalBlock.js");var s=require("./components/ProductsByMenuStep/ProductsByMenuStep.js"),l=require("./components/SummaryTotal/SummaryTotal.js"),i=require("./components/BookingSummaryAccordion/BookingSummaryAccordion.js"),u=function(e){var t,l=e.date,u=e.time,d=e.menuSteps,p=e.formValues,y=void 0===p?{}:p,E=e.shouldHidePeopleAmount,v=e.eventName,N=e.transactionFee,S=void 0===N?0:N,f=e.productsWithErrors,g=void 0===f?[]:f,k=e.isLoading,q=e.hasPeopleInput,B=e.isPaymentLink,h=e.peopleAmount,j=m.useTranslation("Design").t,P=o.useIntl().formatNumber;return k?r.createElement("div",{className:"payment-booking-summary"},r.createElement(n.LoaderIndicator,{isLoaded:!1})):r.createElement("div",{className:"payment-booking-summary"},r.createElement(i.BookingSummaryAccordion,{hasPeopleInput:q},r.createElement("div",{className:"event-info"},r.createElement("p",{className:"m-0 title event-name"},v),r.createElement("p",{className:"m-0"},l),u&&r.createElement("p",{className:"m-0"},u)),r.createElement("hr",null),(null===(t=c.values(y))||void 0===t?void 0:t.length)>0?r.createElement("div",null,r.createElement("div",{className:"cart-items"},r.createElement("div",{className:"products-by-menu-step"},d.map((function(e){return r.createElement(s.ProductsByMenuStep,{isPaymentLink:B,key:e.id,orderItems:y,step:e,productsWithErrors:g})}))),!E&&h>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"},j("people"),":"),r.createElement("p",{className:"price"},h))),!!S&&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"},j("transactionFee"),":"),r.createElement("p",{className:"price"},P(S,{style:"currency",currency:a.Currency.GBP})))))):r.createElement("div",{className:"cart-items"},r.createElement("p",{className:"empty-cart"},j("emptyBasket")))))};u.SummaryTotal=l.SummaryTotal,u.Accordion=i.BookingSummaryAccordion,exports.BookingSummary=u;
@@ -4,7 +4,8 @@ type ProductSummaryProps = {
4
4
  name?: string;
5
5
  productQuantityError?: string;
6
6
  orderProduct: OrderItem;
7
+ isPaymentLink?: boolean;
7
8
  };
8
- export declare const ProductSummary: ({ name, productQuantityError, orderProduct, }: ProductSummaryProps) => JSX.Element;
9
+ export declare const ProductSummary: ({ name, productQuantityError, orderProduct, isPaymentLink, }: ProductSummaryProps) => JSX.Element;
9
10
  export {};
10
11
  //# sourceMappingURL=ProductSummary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AAEnF,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,SAAS,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,cAAc,kDAIxB,mBAAmB,gBA0BrB,CAAC"}
1
+ {"version":3,"file":"ProductSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AAEnF,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,SAAS,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,cAAc,iEAKxB,mBAAmB,gBA8BrB,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("react-i18next"),l=require("react-intl");exports.ProductSummary=function(e){var t=e.name,c=e.productQuantityError,u=e.orderProduct,i=n.useTranslation("Design").t,s=(0,l.useIntl().formatNumber)(((null==u?void 0:u.deposit)||(null==u?void 0:u.price)||0)*(null==u?void 0:u.quantity),{style:"currency",currency:a.Currency.GBP});return r.createElement("div",{className:"product"},r.createElement("p",{className:"m-0 name"},null!=t?t:null==u?void 0:u.name),r.createElement("div",{className:"d-flex justify-content-between"},r.createElement("p",{className:"m-0"},i("shortQuantity"),": ",null==u?void 0:u.quantity),r.createElement("p",{className:"price"},s)),c&&r.createElement("p",{className:"iframe-event__message-error"},c))};
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("react-i18next"),l=require("react-intl");exports.ProductSummary=function(e){var t=e.name,i=e.productQuantityError,u=e.orderProduct,c=e.isPaymentLink,s=n.useTranslation("Design").t,o=(0,l.useIntl().formatNumber)((!c&&(null==u?void 0:u.hasDeposit)?null==u?void 0:u.deposit:null==u?void 0:u.price)*(null==u?void 0:u.quantity),{style:"currency",currency:a.Currency.GBP});return r.createElement("div",{className:"product"},r.createElement("p",{className:"m-0 name"},null!=t?t:null==u?void 0:u.name),r.createElement("div",{className:"d-flex justify-content-between"},r.createElement("p",{className:"m-0"},s("shortQuantity"),": ",null==u?void 0:u.quantity),r.createElement("p",{className:"price"},o)),i&&r.createElement("p",{className:"iframe-event__message-error"},i))};
@@ -6,6 +6,7 @@ export type ProductsByMenuStepsProps = {
6
6
  orderItems: OrderItems;
7
7
  step: MenuStep;
8
8
  productsWithErrors?: QuantityCheckProductInfo[];
9
+ isPaymentLink?: boolean;
9
10
  };
10
- export declare const ProductsByMenuStep: ({ orderItems, step, productsWithErrors, }: ProductsByMenuStepsProps) => JSX.Element;
11
+ export declare const ProductsByMenuStep: ({ orderItems, step, productsWithErrors, isPaymentLink, }: ProductsByMenuStepsProps) => JSX.Element;
11
12
  //# sourceMappingURL=ProductsByMenuStep.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductsByMenuStep.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAEL,UAAU,EACX,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAC;AAqB/E,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,kBAAkB,8CAI5B,wBAAwB,gBAuC1B,CAAC"}
1
+ {"version":3,"file":"ProductsByMenuStep.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAEL,UAAU,EACX,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAC;AAqB/E,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAChD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,6DAK5B,wBAAwB,gBAwC1B,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),t=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,u=require("lodash"),n=require("../ProductSummary/ProductSummary.js"),o=require("../../utils/index.js");exports.ProductsByMenuStep=function(e){var r=e.orderItems,a=e.step,c=e.productsWithErrors,i=void 0===c?[]:c,d=a.productCategories;return function(e,r){var t=r.productCategories.map((function(e){return e.id}));return u.values(e).filter((function(e){return t.includes(e.productCategoryId)})).length>0}(r,a)?t.createElement("div",{className:"categories"},d.map((function(e){var a=function(e,r){return u.values(e).filter((function(e){return e.productCategoryId===r}))}(r,e.id);return 0===a.length?null:t.createElement("div",{key:e.id,className:"products"},t.createElement("p",{className:"m-0 title"},e.name),a.map((function(e){var r=o.getProductError(i,e.id);return t.createElement(n.ProductSummary,{key:e.id,name:e.name,productQuantityError:r,orderProduct:e})})))}))):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),t=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,u=require("lodash"),n=require("../ProductSummary/ProductSummary.js"),a=require("../../utils/index.js");exports.ProductsByMenuStep=function(e){var r=e.orderItems,o=e.step,i=e.productsWithErrors,c=void 0===i?[]:i,d=e.isPaymentLink,s=o.productCategories;return function(e,r){var t=r.productCategories.map((function(e){return e.id}));return u.values(e).filter((function(e){return t.includes(e.productCategoryId)})).length>0}(r,o)?t.createElement("div",{className:"categories"},s.map((function(e){var o=function(e,r){return u.values(e).filter((function(e){return e.productCategoryId===r}))}(r,e.id);return 0===o.length?null:t.createElement("div",{key:e.id,className:"products"},t.createElement("p",{className:"m-0 title"},e.name),o.map((function(e){var r=a.getProductError(c,e.id);return t.createElement(n.ProductSummary,{isPaymentLink:d,key:e.id,name:e.name,productQuantityError:r,orderProduct:e})})))}))):null};
@@ -17,5 +17,6 @@ export type BookingSummaryProps = {
17
17
  productsWithErrors?: QuantityCheckProductInfo[];
18
18
  isLoading?: boolean;
19
19
  peopleAmount: number;
20
+ isPaymentLink?: boolean;
20
21
  };
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -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,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,wDAAwD,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAC;AAE/E,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,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,wBAAwB,EAAE,CAAC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,wDAAwD,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAC;AAE/E,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,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,wBAAwB,EAAE,CAAC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AAEnF,eAAO,MAAM,sBAAsB,mBAAoB,SAAS,EAAE,WAWjE,CAAC;AAEF,eAAO,MAAM,eAAe,uBACN,wBAAwB,EAAE,aACnC,SAAS,CAAC,IAAI,CAAC,KACzB,MAAM,GAAG,SAGA,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AAEnF,eAAO,MAAM,sBAAsB,mBAAoB,SAAS,EAAE,WASjE,CAAC;AAEF,eAAO,MAAM,eAAe,uBACN,wBAAwB,EAAE,aACnC,SAAS,CAAC,IAAI,CAAC,KACzB,MAAM,GAAG,SAGA,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.cartSumByOrderProducts=function(r){return r&&r.length?r.reduce((function(r,e){return e?r+((null==e?void 0:e.deposit)||(null==e?void 0:e.price))*e.quantity:0}),0):0},exports.getProductError=function(r,e){var t;return null===(t=r.find((function(r){return r.product_id===e})))||void 0===t?void 0:t.message};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.cartSumByOrderProducts=function(r){return r&&r.length?r.reduce((function(r,e){return e?r+((null==e?void 0:e.hasDeposit)?null==e?void 0:e.deposit:null==e?void 0:e.price)*e.quantity:0}),0):0},exports.getProductError=function(r,e){var t;return null===(t=r.find((function(r){return r.product_id===e})))||void 0===t?void 0:t.message};
@@ -1 +1 @@
1
- {"version":3,"file":"CategoryProduct.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EACL,OAAO,EACP,eAAe,EAChB,MAAM,qDAAqD,CAAC;AAI7D,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAChD,eAAe,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAC9C;AAED,eAAO,MAAM,eAAe,sFAMzB,oBAAoB,gBA0LtB,CAAC"}
1
+ {"version":3,"file":"CategoryProduct.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EACL,OAAO,EACP,eAAe,EAChB,MAAM,qDAAqD,CAAC;AAI7D,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAChD,eAAe,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAC9C;AAED,eAAO,MAAM,eAAe,sFAMzB,oBAAoB,gBAgLtB,CAAC"}
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=require("react"),i=e(t),n=require("@licklist/core/dist/Config"),a=require("react-i18next"),o=require("react-hook-form"),c=e(require("@licklist/plugins/dist/services/Form/HookFormService")),u=e(require("clsx")),s=require("react-intl"),d=require("../../../event/ticket-description/TicketDescription.js"),l=require("./components/ProductQuantityInput/ProductQuantityInput.js");exports.CategoryProduct=function(e){var m=e.product,p=e.category,v=e.canExpandDescription,f=void 0===v||v,y=e.productsWithErrors,g=e.soldOutProducts,E=s.useIntl().formatNumber,q=a.useTranslation(["Design","Validation"]).t,_=o.useFormContext(),x=_.control,N=_.clearErrors,A=_.setError,C=t.useMemo((function(){if(y){var e=y.find((function(e){return e.product_id===m.id}));return null==e?void 0:e.message}}),[y,m.id]),P=t.useMemo((function(){if(p.allowDeposits&&m.deposit&&!(null==m?void 0:m.isSoldOut)&&!(m.deposit>=m.price))return m.deposit}),[p,m]),D=function(){if(g&&!(null==m?void 0:m.isSoldOut)){var e=g.find((function(e){return e.product_id===m.id}));return!!(null==e?void 0:e.message)}};return t.useEffect((function(){C&&A("".concat(m.id),{message:C,type:"validate"})}),[C,m.id]),i.createElement(o.Controller,{control:x,name:"".concat(m.id),rules:{required:m.isRequired,validate:function(e){var r,t=m.isRequired,i=void 0!==t&&t,n=m.maxAmount,a=void 0===n?0:n,o=m.minAmount,c=void 0===o?0:o,u=null!==(r=null==e?void 0:e.quantity)&&void 0!==r?r:0;return!e||(!u&&!i||(!u&&i?q("Design:pleaseSelectAtLeastFrom",{min:1,type:"item",from:"this category"}):u<c?q("Validation:fieldMinNumber",{min:m.minAmount,attribute:m.name}):!(a&&u>=c&&a<u)||q("Validation:quantityMaxNumber",{max:m.maxAmount})))}},render:function(e){var t=e.field,a=t.onChange,o=t.value,s=void 0===o?{}:o,v=t.ref,y=e.fieldState,g=y.invalid,_=y.error;return i.createElement("div",{id:String(m.id),className:"iframe-event__category-product"},i.createElement("div",{className:u("iframe-event__product",g&&"error")},i.createElement(d.TicketDescription,{title:m.name,description:m.description,className:u("iframe-event__product-description"),images:m.images,isRequired:m.isRequired,canExpand:f})),i.createElement("div",{className:"iframe-event__product-price-wrapper"},i.createElement("span",{className:"product-price"},E(null!=P?P:m.price,{style:"currency",currency:n.Currency.GBP})),i.createElement(l.ProductQuantityInput,{onChange:a,productInfo:s,refCallback:v,clearErrors:N,product:r.__assign(r.__assign({},m),{isSoldOut:(null==m?void 0:m.isSoldOut)||D()}),category:p,invalid:g,deposit:P})),P&&!(null==p?void 0:p.remainderExpireAfter)&&i.createElement("div",{className:"mt-4"},q("Design:payNowAndUponArrival",{deposit:E(P,{style:"currency",currency:n.Currency.GBP}),remainder:E(m.price-P,{style:"currency",currency:n.Currency.GBP})})),P&&(null==p?void 0:p.remainderExpireAfter)>0&&i.createElement("div",{className:"mt-4"},q("Design:payNowAndReminderDays",{deposit:E(P,{style:"currency",currency:n.Currency.GBP}),remainder:E(m.price-P,{style:"currency",currency:n.Currency.GBP}),days:null==p?void 0:p.remainderExpireAfter})),g&&i.createElement("div",{className:"d-flex mt-3 w-100"},i.createElement("p",{className:"iframe-event__message-error"},c.hasError(_,"required")&&q("Design:pleaseSelectAtLeastFrom",{min:1,type:"item",from:"this category"}),c.hasError(_,"validate")&&_.message)))}})};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=require("react"),i=e(t),n=require("@licklist/core/dist/Config"),o=require("react-i18next"),a=require("react-hook-form"),c=e(require("@licklist/plugins/dist/services/Form/HookFormService")),s=e(require("clsx")),u=require("react-intl"),l=require("../../../event/ticket-description/TicketDescription.js"),d=require("./components/ProductQuantityInput/ProductQuantityInput.js");exports.CategoryProduct=function(e){var m=e.product,p=e.category,v=e.canExpandDescription,y=void 0===v||v,f=e.productsWithErrors,g=e.soldOutProducts,E=u.useIntl().formatNumber,q=o.useTranslation(["Design","Validation"]).t,_=a.useFormContext(),x=_.control,N=_.clearErrors,A=_.setError,C=t.useMemo((function(){if(f){var e=f.find((function(e){return e.product_id===m.id}));return null==e?void 0:e.message}}),[f,m.id]),D=function(){if(g&&!(null==m?void 0:m.isSoldOut)){var e=g.find((function(e){return e.product_id===m.id}));return!!(null==e?void 0:e.message)}};return t.useEffect((function(){C&&A("".concat(m.id),{message:C,type:"validate"})}),[C,m.id]),i.createElement(a.Controller,{control:x,name:"".concat(m.id),rules:{required:m.isRequired,validate:function(e){var r,t=m.isRequired,i=void 0!==t&&t,n=m.maxAmount,o=void 0===n?0:n,a=m.minAmount,c=void 0===a?0:a,s=null!==(r=null==e?void 0:e.quantity)&&void 0!==r?r:0;return!e||(!s&&!i||(!s&&i?q("Design:pleaseSelectAtLeastFrom",{min:1,type:"item",from:"this category"}):s<c?q("Validation:fieldMinNumber",{min:m.minAmount,attribute:m.name}):!(o&&s>=c&&o<s)||q("Validation:quantityMaxNumber",{max:m.maxAmount})))}},render:function(e){var t=e.field,o=t.onChange,a=t.value,u=void 0===a?{}:a,v=t.ref,f=e.fieldState,g=f.invalid,_=f.error;return i.createElement("div",{id:String(m.id),className:"iframe-event__category-product"},i.createElement("div",{className:s("iframe-event__product",g&&"error")},i.createElement(l.TicketDescription,{title:m.name,description:m.description,className:s("iframe-event__product-description"),images:m.images,isRequired:m.isRequired,canExpand:y})),i.createElement("div",{className:"iframe-event__product-price-wrapper"},i.createElement("span",{className:"product-price"},E(p.allowDeposits?null==m?void 0:m.deposit:m.price,{style:"currency",currency:n.Currency.GBP})),i.createElement(d.ProductQuantityInput,{onChange:o,productInfo:u,refCallback:v,clearErrors:N,product:r.__assign(r.__assign({},m),{isSoldOut:(null==m?void 0:m.isSoldOut)||D()}),category:p,invalid:g})),p.allowDeposits&&!(null==p?void 0:p.remainderExpireAfter)&&i.createElement("div",{className:"mt-4"},q("Design:payNowAndUponArrival",{deposit:E(null==m?void 0:m.deposit,{style:"currency",currency:n.Currency.GBP}),remainder:E(m.price-(null==m?void 0:m.deposit),{style:"currency",currency:n.Currency.GBP})})),p.allowDeposits&&(null==p?void 0:p.remainderExpireAfter)>0&&i.createElement("div",{className:"mt-4"},q("Design:payNowAndReminderDays",{deposit:E(null==m?void 0:m.deposit,{style:"currency",currency:n.Currency.GBP}),remainder:E(m.price-(null==m?void 0:m.deposit),{style:"currency",currency:n.Currency.GBP}),days:null==p?void 0:p.remainderExpireAfter})),g&&i.createElement("div",{className:"d-flex mt-3 w-100"},i.createElement("p",{className:"iframe-event__message-error"},c.hasError(_,"required")&&q("Design:pleaseSelectAtLeastFrom",{min:1,type:"item",from:"this category"}),c.hasError(_,"validate")&&_.message)))}})};
@@ -7,6 +7,7 @@ interface FormOrderItem {
7
7
  name: string;
8
8
  price: number;
9
9
  productCategoryId: number;
10
+ hasDeposit?: boolean;
10
11
  zoneId?: Zone["id"];
11
12
  deposit?: number | null;
12
13
  quantity: number;
@@ -22,6 +23,6 @@ interface ProductQuantityInputProps {
22
23
  invalid: boolean;
23
24
  productInfo: FormOrderItem;
24
25
  }
25
- export declare const ProductQuantityInput: ({ product, category, onChange: _onChange, clearErrors, refCallback, productInfo, invalid, deposit, }: ProductQuantityInputProps) => JSX.Element;
26
+ export declare const ProductQuantityInput: ({ product, category, onChange: _onChange, clearErrors, refCallback, productInfo, invalid, }: ProductQuantityInputProps) => JSX.Element;
26
27
  export {};
27
28
  //# sourceMappingURL=ProductQuantityInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductQuantityInput.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAC9E,OAAO,EACL,OAAO,EACP,eAAe,EAChB,MAAM,qDAAqD,CAAC;AAG7D,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,UAAU,yBAAyB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,WAAW,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC7C,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,aAAa,CAAC;CAC5B;AAED,eAAO,MAAM,oBAAoB,yGAS9B,yBAAyB,gBAgE3B,CAAC"}
1
+ {"version":3,"file":"ProductQuantityInput.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAC9E,OAAO,EACL,OAAO,EACP,eAAe,EAChB,MAAM,qDAAqD,CAAC;AAG7D,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,UAAU,yBAAyB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,WAAW,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC7C,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,aAAa,CAAC;CAC5B;AAED,eAAO,MAAM,oBAAoB,gGAQ9B,yBAAyB,gBAsE3B,CAAC"}
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),n=require("react-i18next"),r=require("react-bootstrap"),o=e(require("clsx")),i=require("../NumberInput/NumberInput.js");exports.ProductQuantityInput=function(e){var u=e.product,a=e.category,l=e.onChange,c=e.clearErrors,d=e.refCallback,s=e.productInfo,p=e.invalid,v=e.deposit,f=n.useTranslation("Design").t,m=function(e){var t;l({id:u.id,name:u.name,deposit:v,price:u.price,productCategoryId:a.id,zoneId:null===(t=a.zone)||void 0===t?void 0:t.id,quantity:e,capacity:null==u?void 0:u.capacity})};return u.isSoldOut?t.createElement("div",{className:"iframe-event__sold-out-wrapper"},f("Design:soldOut")):1===(null==u?void 0:u.maxAmount)?t.createElement(r.Button,{ref:d,disabled:u.isSoldOut,className:o("iframe-event__".concat((null==s?void 0:s.quantity)?"unselect-product":"select-product"),p&&"error"),onClick:function(){return m((null==s?void 0:s.quantity)?0:1)}},f("Design:".concat((null==s?void 0:s.quantity)?"unselect":"select"))):t.createElement(i.NumberInput,{ref:d,onChange:function(e){m(e||null),c("".concat(u.id))},onArrowDown:function(){m((null==s?void 0:s.quantity)-1||0),c("".concat(u.id))},onArrowUp:function(){var e;m((null!==(e=null==s?void 0:s.quantity)&&void 0!==e?e:0)+1),c("".concat(u.id))},min:0,placeholder:"0",disabled:u.isSoldOut,value:null==s?void 0:s.quantity,className:o(p&&"error")})};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),n=require("react-i18next"),o=require("react-bootstrap"),u=e(require("clsx")),i=require("../NumberInput/NumberInput.js");exports.ProductQuantityInput=function(e){var r=e.product,l=e.category,a=e.onChange,c=e.clearErrors,d=e.refCallback,s=e.productInfo,v=e.invalid,m=n.useTranslation("Design").t,p=function(e){var t,n=e;(null==r?void 0:r.maxAmount)&&e>(null==r?void 0:r.maxAmount)&&(n=null==r?void 0:r.maxAmount),a({id:r.id,name:r.name,deposit:null==r?void 0:r.deposit,hasDeposit:l.allowDeposits,price:r.price,productCategoryId:l.id,zoneId:null===(t=l.zone)||void 0===t?void 0:t.id,quantity:n,capacity:null==r?void 0:r.capacity})};return r.isSoldOut?t.createElement("div",{className:"iframe-event__sold-out-wrapper"},m("Design:soldOut")):1===(null==r?void 0:r.maxAmount)?t.createElement(o.Button,{ref:d,disabled:r.isSoldOut,className:u("iframe-event__".concat((null==s?void 0:s.quantity)?"unselect-product":"select-product"),v&&"error"),onClick:function(){return p((null==s?void 0:s.quantity)?0:1)}},m("Design:".concat((null==s?void 0:s.quantity)?"unselect":"select"))):t.createElement(i.NumberInput,{ref:d,onChange:function(e){p(e||null),c("".concat(r.id))},onArrowDown:function(){p((null==s?void 0:s.quantity)-1||0),c("".concat(r.id))},onArrowUp:function(){var e;p((null!==(e=null==s?void 0:s.quantity)&&void 0!==e?e:0)+1),c("".concat(r.id))},min:0,max:(null==r?void 0:r.maxAmount)?null==r?void 0:r.maxAmount:void 0,placeholder:"0",disabled:r.isSoldOut,value:null==s?void 0:s.quantity,className:u(v&&"error")})};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.50.1-dev.6",
3
+ "version": "0.50.1-dev.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -20,6 +20,7 @@ export const BookingSummary = ({
20
20
  productsWithErrors = [],
21
21
  isLoading,
22
22
  hasPeopleInput,
23
+ isPaymentLink,
23
24
  peopleAmount,
24
25
  }: Omit<BookingSummaryProps, "totallWithDiscount">) => {
25
26
  const { t } = useTranslation("Design");
@@ -49,6 +50,7 @@ export const BookingSummary = ({
49
50
  <div className="products-by-menu-step">
50
51
  {menuSteps.map((menuStep) => (
51
52
  <ProductsByMenuStep
53
+ isPaymentLink={isPaymentLink}
52
54
  key={menuStep.id}
53
55
  orderItems={formValues}
54
56
  step={menuStep}
@@ -8,21 +8,27 @@ type ProductSummaryProps = {
8
8
  name?: string;
9
9
  productQuantityError?: string;
10
10
  orderProduct: OrderItem;
11
+ isPaymentLink?: boolean;
11
12
  };
12
13
 
13
14
  export const ProductSummary = ({
14
15
  name,
15
16
  productQuantityError,
16
17
  orderProduct,
18
+ isPaymentLink,
17
19
  }: ProductSummaryProps) => {
18
20
  const { t } = useTranslation("Design");
19
21
  const { formatNumber } = useIntl();
20
22
 
21
- const price = formatNumber(
22
- (orderProduct?.deposit || orderProduct?.price || 0) *
23
- orderProduct?.quantity,
24
- { style: "currency", currency: Config.Currency.GBP }
25
- );
23
+ const priceForOneProduct =
24
+ !isPaymentLink && orderProduct?.hasDeposit
25
+ ? orderProduct?.deposit
26
+ : orderProduct?.price;
27
+
28
+ const fullPrice = formatNumber(priceForOneProduct * orderProduct?.quantity, {
29
+ style: "currency",
30
+ currency: Config.Currency.GBP,
31
+ });
26
32
 
27
33
  return (
28
34
  <div className="product">
@@ -32,7 +38,7 @@ export const ProductSummary = ({
32
38
  {t("shortQuantity")}:&nbsp;{orderProduct?.quantity}
33
39
  </p>
34
40
 
35
- <p className="price">{price}</p>
41
+ <p className="price">{fullPrice}</p>
36
42
  </div>
37
43
 
38
44
  {productQuantityError && (
@@ -29,12 +29,14 @@ export type ProductsByMenuStepsProps = {
29
29
  orderItems: OrderItems;
30
30
  step: MenuStep;
31
31
  productsWithErrors?: QuantityCheckProductInfo[];
32
+ isPaymentLink?: boolean;
32
33
  };
33
34
 
34
35
  export const ProductsByMenuStep = ({
35
36
  orderItems,
36
37
  step,
37
38
  productsWithErrors = [],
39
+ isPaymentLink,
38
40
  }: ProductsByMenuStepsProps) => {
39
41
  const { productCategories } = step;
40
42
 
@@ -62,6 +64,7 @@ export const ProductsByMenuStep = ({
62
64
 
63
65
  return (
64
66
  <ProductSummary
67
+ isPaymentLink={isPaymentLink}
65
68
  key={orderItem.id}
66
69
  name={orderItem.name}
67
70
  productQuantityError={productQuantityError}
@@ -19,4 +19,5 @@ export type BookingSummaryProps = {
19
19
  productsWithErrors?: QuantityCheckProductInfo[];
20
20
  isLoading?: boolean;
21
21
  peopleAmount: number;
22
+ isPaymentLink?: boolean;
22
23
  };
@@ -7,10 +7,8 @@ export const cartSumByOrderProducts = (orderProducts?: OrderItem[]) => {
7
7
  }
8
8
  return orderProducts.reduce((prevSumValue: number, product) => {
9
9
  if (!product) return 0;
10
-
11
- return (
12
- prevSumValue + (product?.deposit || product?.price) * product.quantity
13
- );
10
+ const price = product?.hasDeposit ? product?.deposit : product?.price;
11
+ return prevSumValue + price * product.quantity;
14
12
  }, 0);
15
13
  };
16
14
 
@@ -42,18 +42,6 @@ export const CategoryProduct = ({
42
42
  return error?.message;
43
43
  }, [productsWithErrors, product.id]);
44
44
 
45
- const deposit = useMemo(() => {
46
- if (
47
- !category.allowDeposits ||
48
- !product.deposit ||
49
- product?.isSoldOut ||
50
- product.deposit >= product.price
51
- ) {
52
- return undefined;
53
- }
54
- return product.deposit;
55
- }, [category, product]);
56
-
57
45
  const checkIfSoldOutProduct = () => {
58
46
  if (!soldOutProducts || product?.isSoldOut) {
59
47
  return undefined;
@@ -146,10 +134,13 @@ export const CategoryProduct = ({
146
134
  </div>
147
135
  <div className="iframe-event__product-price-wrapper">
148
136
  <span className="product-price">
149
- {formatNumber(deposit ?? product.price, {
150
- style: "currency",
151
- currency: Config.Currency.GBP,
152
- })}
137
+ {formatNumber(
138
+ category.allowDeposits ? product?.deposit : product.price,
139
+ {
140
+ style: "currency",
141
+ currency: Config.Currency.GBP,
142
+ }
143
+ )}
153
144
  </span>
154
145
  <ProductQuantityInput
155
146
  onChange={onChange}
@@ -162,17 +153,16 @@ export const CategoryProduct = ({
162
153
  }}
163
154
  category={category}
164
155
  invalid={invalid}
165
- deposit={deposit}
166
156
  />
167
157
  </div>
168
- {deposit && !category?.remainderExpireAfter && (
158
+ {category.allowDeposits && !category?.remainderExpireAfter && (
169
159
  <div className="mt-4">
170
160
  {t("Design:payNowAndUponArrival", {
171
- deposit: formatNumber(deposit, {
161
+ deposit: formatNumber(product?.deposit, {
172
162
  style: "currency",
173
163
  currency: Config.Currency.GBP,
174
164
  }),
175
- remainder: formatNumber(product.price - deposit, {
165
+ remainder: formatNumber(product.price - product?.deposit, {
176
166
  style: "currency",
177
167
  currency: Config.Currency.GBP,
178
168
  }),
@@ -180,14 +170,14 @@ export const CategoryProduct = ({
180
170
  </div>
181
171
  )}
182
172
 
183
- {deposit && category?.remainderExpireAfter > 0 && (
173
+ {category.allowDeposits && category?.remainderExpireAfter > 0 && (
184
174
  <div className="mt-4">
185
175
  {t("Design:payNowAndReminderDays", {
186
- deposit: formatNumber(deposit, {
176
+ deposit: formatNumber(product?.deposit, {
187
177
  style: "currency",
188
178
  currency: Config.Currency.GBP,
189
179
  }),
190
- remainder: formatNumber(product.price - deposit, {
180
+ remainder: formatNumber(product.price - product?.deposit, {
191
181
  style: "currency",
192
182
  currency: Config.Currency.GBP,
193
183
  }),
@@ -15,6 +15,7 @@ interface FormOrderItem {
15
15
  name: string;
16
16
  price: number;
17
17
  productCategoryId: number;
18
+ hasDeposit?: boolean;
18
19
  zoneId?: Zone["id"];
19
20
  deposit?: number | null;
20
21
  quantity: number;
@@ -40,19 +41,23 @@ export const ProductQuantityInput = ({
40
41
  refCallback,
41
42
  productInfo,
42
43
  invalid,
43
- deposit,
44
44
  }: ProductQuantityInputProps) => {
45
45
  const { t } = useTranslation("Design");
46
46
 
47
47
  const onChange = (quantity: number | null) => {
48
+ let productQuantity = quantity;
49
+ if (product?.maxAmount && quantity > product?.maxAmount) {
50
+ productQuantity = product?.maxAmount;
51
+ }
48
52
  _onChange({
49
53
  id: product.id,
50
54
  name: product.name,
51
- deposit,
55
+ deposit: product?.deposit,
56
+ hasDeposit: category.allowDeposits,
52
57
  price: product.price,
53
58
  productCategoryId: category.id,
54
59
  zoneId: category.zone?.id,
55
- quantity,
60
+ quantity: productQuantity,
56
61
  capacity: product?.capacity,
57
62
  });
58
63
  };
@@ -99,6 +104,7 @@ export const ProductQuantityInput = ({
99
104
  clearErrors(`${product.id}` as const);
100
105
  }}
101
106
  min={0}
107
+ max={product?.maxAmount ? product?.maxAmount : undefined}
102
108
  placeholder="0"
103
109
  disabled={product.isSoldOut}
104
110
  value={productInfo?.quantity}