@licklist/design 0.58.3-dev.2 → 0.58.3-dev.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,2FA4EvB,CAAC"}
1
+ {"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,2FAiGvB,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=require("react"),n=e(t),a=require("react-bootstrap"),r=e(require("clsx")),u=t.forwardRef((function(e,t){var u=e.className,o=void 0===u?"":u,i=e.value,l=e.onChange,d=e.onArrowDown,c=e.onArrowUp,m=e.min,b=e.max,p=e.placeholder,s=e.defaultValue,f=e.disabled,v=!i,y=void 0!==b&&i===b,N=r("payment-number-input",o);return n.createElement("div",{className:N},n.createElement("button",{type:"button",onClick:function(){void 0!==m&&i>m&&d(i-1),void 0===m&&c(i-1)},className:"payment-number-input__btn-down ".concat(v&&"disabled-number-input-button"),disabled:f},"−"),n.createElement(a.FormControl,{type:"number",onChange:function(e){return l(Number(e.target.value))},value:i,min:m,max:b,defaultValue:s,placeholder:p,height:"5rem",disabled:f,ref:t}),n.createElement("button",{type:"button",onClick:function(){void 0!==b&&(i||0)<b&&c(i+1),void 0===b&&c(i+1)},className:"payment-number-input__btn-up ".concat(y&&"disabled-number-input-button"),disabled:f},"+"))}));u.displayName="NumberInput",exports.NumberInput=u;
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=require("react"),n=e(t),a=require("react-bootstrap"),r=e(require("clsx")),u=t.forwardRef((function(e,t){var u=e.className,o=void 0===u?"":u,i=e.value,l=e.onChange,d=e.onArrowDown,c=e.onArrowUp,m=e.min,b=e.max,p=e.placeholder,s=e.defaultValue,v=e.disabled,f=!i,y=void 0!==b&&i===b,N=r("payment-number-input",o);return n.createElement("div",{className:N},n.createElement("button",{type:"button",onClick:function(){m>0&&(i||0)-1<m?d(0):(void 0!==m&&i>m&&d(i-1),void 0===m&&c(i-1))},className:"payment-number-input__btn-down ".concat(f&&"disabled-number-input-button"),disabled:v},"−"),n.createElement(a.FormControl,{type:"number",onChange:function(e){return t=Number(e.target.value),void l(void 0!==b&&t>b?b:m>0&&t&&t<m?m:t);var t},value:i,min:m,max:b,defaultValue:s,placeholder:p,height:"5rem",disabled:v,ref:t}),n.createElement("button",{type:"button",onClick:function(){m>0&&(i||0)<m?c(m):(void 0!==b&&(i||0)<b&&c(i+1),void 0===b&&c(i+1))},className:"payment-number-input__btn-up ".concat(y&&"disabled-number-input-button"),disabled:v},"+"))}));u.displayName="NumberInput",exports.NumberInput=u;
@@ -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,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
+ {"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,gBAkE3B,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"),o=require("react-bootstrap"),i=e(require("clsx")),u=require("../NumberInput/NumberInput.js");exports.ProductQuantityInput=function(e){var r=e.product,l=e.category,a=e.onChange,d=e.clearErrors,c=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&&(null==r?void 0:r.deposit)<r.price,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:c,disabled:r.isSoldOut,className:i("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(u.NumberInput,{ref:c,onChange:function(e){p(e||null),d("".concat(r.id))},onArrowDown:function(){p((null==s?void 0:s.quantity)-1||0),d("".concat(r.id))},onArrowUp:function(){var e;p((null!==(e=null==s?void 0:s.quantity)&&void 0!==e?e:0)+1),d("".concat(r.id))},min:0,max:(null==r?void 0:r.maxAmount)?Number(null==r?void 0:r.maxAmount):void 0,placeholder:"0",disabled:r.isSoldOut,value:null==s?void 0:s.quantity,className:i(v&&"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"),i=e(require("clsx")),r=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,m=n.useTranslation("Design").t,v=function(e){var t;l({id:u.id,name:u.name,deposit:null==u?void 0:u.deposit,hasDeposit:a.allowDeposits&&(null==u?void 0:u.deposit)<u.price,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"},m("Design:soldOut")):1===(null==u?void 0:u.maxAmount)?t.createElement(o.Button,{ref:d,disabled:u.isSoldOut,className:i("iframe-event__".concat((null==s?void 0:s.quantity)?"unselect-product":"select-product"),p&&"error"),onClick:function(){return v((null==s?void 0:s.quantity)?0:1)}},m("Design:".concat((null==s?void 0:s.quantity)?"unselect":"select"))):t.createElement(r.NumberInput,{ref:d,onChange:function(e){v(e),c("".concat(u.id))},onArrowDown:function(e){v(e||0),c("".concat(u.id))},onArrowUp:function(e){v(e||0),c("".concat(u.id))},min:(null==u?void 0:u.minAmount)?Number(u.minAmount):0,max:(null==u?void 0:u.maxAmount)?Number(u.maxAmount):void 0,placeholder:"0",disabled:u.isSoldOut,value:null==s?void 0:s.quantity,className:i(p&&"error")})};
@@ -1 +1 @@
1
- {"version":3,"file":"ResultCard.d.ts","sourceRoot":"","sources":["../../../../../src/sales/booking/results/components/ResultCard.tsx"],"names":[],"mappings":";AAKA,OAAO,EACL,KAAK,EAEN,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAC;AAO1E,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,UAAU,oDAKpB,eAAe,gBA2FjB,CAAC"}
1
+ {"version":3,"file":"ResultCard.d.ts","sourceRoot":"","sources":["../../../../../src/sales/booking/results/components/ResultCard.tsx"],"names":[],"mappings":";AAKA,OAAO,EACL,KAAK,EAEN,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAC;AAQ1E,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,UAAU,oDAKpB,eAAe,gBA+FjB,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")),r=require("@licklist/core/dist/Config"),l=require("react-i18next"),a=require("../../../../static/Icon.js"),n=e(require("clsx")),i=require("luxon"),c=require("react-intl"),u=require("@licklist/core/dist/DataMapper/Order/OrderDataMapper"),s=require("@licklist/plugins/dist/utils/formatDate"),o=require("@licklist/plugins/dist/utils/sourceTitle");exports.ResultCard=function(e){var m,d,p,E=e.order,f=e.className,v=e.staffMember,y=e.onCardClick,N=l.useTranslation("Design").t,q=c.useIntl().formatNumber,D=E.id,g=E.people,C=E.user,O=E.status,M=E.startDate,T=E.products,b=E.source,k=E.totalAmount,x=E.event,A=E.menu,h=E.remainingToPay,I=(null===(m=T.map((function(e){return e.name})))||void 0===m?void 0:m.join(", "))||"",R=(null==x?void 0:x.name)||(null==A?void 0:A.name)||"",_=function(){y&&y(D)};return t.createElement("div",{className:n("result-card",f),onClick:_,onKeyUp:_,role:"button",tabIndex:0},t.createElement("div",{className:"card-content"},t.createElement("div",{className:"order-id"},D),t.createElement("div",{className:"order-people"},t.createElement(a.default,{type:"user",width:"10",height:"11"}),g),t.createElement("div",{className:"order-description"},t.createElement("p",{className:"name"},C.firstName," ",C.lastName),C.email&&t.createElement("p",null,C.email),(null===(d=C.userDetail)||void 0===d?void 0:d.phone)&&t.createElement("p",null,null===(p=C.userDetail)||void 0===p?void 0:p.phone),t.createElement("p",null,"------"),t.createElement("p",null,N("activity"),": ",R," "),b===u.ORDER_SOURCE_MANUAL&&v&&t.createElement("p",null,N("staff"),": ","".concat(v.firstName," ").concat(v.lastName)),t.createElement("p",null,N("status"),": ",N(O)),t.createElement("p",null,N("date"),": ",s.formatDateStringForEvent(M,!1)),t.createElement("p",null,N("time"),": ",i.DateTime.fromISO(M).toFormat(r.TIME_FORMAT)),t.createElement("p",{className:"products",title:I},N("products"),": ",I),!!h&&t.createElement("p",null,N("remainingAmount"),":"," ",q(h,{style:"currency",currency:r.Currency.GBP})),t.createElement("p",null,N("paidAmount"),":"," ",q(k,{style:"currency",currency:r.Currency.GBP})),t.createElement("p",null,N("source"),": ",N(o.getOrderSourceTitle(b))))))};
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")),r=require("@licklist/core/dist/Config"),l=require("react-i18next"),a=require("../../../../static/Icon.js"),n=e(require("clsx")),i=require("luxon"),c=require("react-intl"),u=require("@licklist/core/dist/DataMapper/Order/OrderDataMapper"),s=require("../../../../iframe/payment/order-items-table/utils/index.js"),o=require("@licklist/plugins/dist/utils/formatDate"),m=require("@licklist/plugins/dist/utils/sourceTitle");exports.ResultCard=function(e){var d,p,E,f=e.order,v=e.className,y=e.staffMember,N=e.onCardClick,q=l.useTranslation("Design").t,D=c.useIntl().formatNumber,g=f.id,C=f.people,O=f.user,T=f.status,b=f.startDate,x=f.products,M=f.source,k=f.totalAmount,A=f.event,h=f.menu,j=f.remainingToPay,I=f.payments,R=s.calculateTotalDiscount(I),_=(null===(d=x.map((function(e){return e.name})))||void 0===d?void 0:d.join(", "))||"",P=(null==A?void 0:A.name)||(null==h?void 0:h.name)||"",S=k-R,F=function(){N&&N(g)};return t.createElement("div",{className:n("result-card",v),onClick:F,onKeyUp:F,role:"button",tabIndex:0},t.createElement("div",{className:"card-content"},t.createElement("div",{className:"order-id"},g),t.createElement("div",{className:"order-people"},t.createElement(a.default,{type:"user",width:"10",height:"11"}),C),t.createElement("div",{className:"order-description"},t.createElement("p",{className:"name"},O.firstName," ",O.lastName),O.email&&t.createElement("p",null,O.email),(null===(p=O.userDetail)||void 0===p?void 0:p.phone)&&t.createElement("p",null,null===(E=O.userDetail)||void 0===E?void 0:E.phone),t.createElement("p",null,"------"),t.createElement("p",null,q("activity"),": ",P," "),M===u.ORDER_SOURCE_MANUAL&&y&&t.createElement("p",null,q("staff"),": ","".concat(y.firstName," ").concat(y.lastName)),t.createElement("p",null,q("status"),": ",q(T)),t.createElement("p",null,q("date"),": ",o.formatDateStringForEvent(b,!1)),t.createElement("p",null,q("time"),": ",i.DateTime.fromISO(b).toFormat(r.TIME_FORMAT)),t.createElement("p",{className:"products",title:_},q("products"),": ",_),!!j&&t.createElement("p",null,q("remainingAmount"),":"," ",D(j,{style:"currency",currency:r.Currency.GBP})),t.createElement("p",null,q("paidAmount"),":"," ",D(S,{style:"currency",currency:r.Currency.GBP})),t.createElement("p",null,q("source"),": ",q(m.getOrderSourceTitle(M))))))};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.58.3-dev.2",
3
+ "version": "0.58.3-dev.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -34,7 +34,24 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
34
34
  const minusButtonGreyedOut = !value;
35
35
  const plusButtonGreyedOut = max !== undefined && value === max;
36
36
 
37
+ const handleChangeValue = (val: number) => {
38
+ if (max !== undefined && val > max) {
39
+ onChange(max);
40
+ return;
41
+ }
42
+
43
+ if (min > 0 && val && val < min) {
44
+ onChange(min);
45
+ return;
46
+ }
47
+ onChange(val);
48
+ };
49
+
37
50
  const handleArrowUpClick = () => {
51
+ if (min > 0 && (value || 0) < min) {
52
+ onArrowUp(min);
53
+ return;
54
+ }
38
55
  if (max !== undefined && (value || 0) < max) {
39
56
  onArrowUp(value + 1);
40
57
  }
@@ -44,6 +61,10 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
44
61
  };
45
62
 
46
63
  const handleArrowDownClick = () => {
64
+ if (min > 0 && (value || 0) - 1 < min) {
65
+ onArrowDown(0);
66
+ return;
67
+ }
47
68
  if (min !== undefined && value > min) {
48
69
  onArrowDown(value - 1);
49
70
  }
@@ -68,7 +89,7 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
68
89
  </button>
69
90
  <FormControl
70
91
  type="number"
71
- onChange={(e) => onChange(Number(e.target.value))}
92
+ onChange={(e) => handleChangeValue(Number(e.target.value))}
72
93
  value={value}
73
94
  min={min}
74
95
  max={max}
@@ -45,10 +45,6 @@ export const ProductQuantityInput = ({
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
- }
52
48
  _onChange({
53
49
  id: product.id,
54
50
  name: product.name,
@@ -57,7 +53,7 @@ export const ProductQuantityInput = ({
57
53
  price: product.price,
58
54
  productCategoryId: category.id,
59
55
  zoneId: category.zone?.id,
60
- quantity: productQuantity,
56
+ quantity,
61
57
  capacity: product?.capacity,
62
58
  });
63
59
  };
@@ -92,19 +88,19 @@ export const ProductQuantityInput = ({
92
88
  <NumberInput
93
89
  ref={refCallback}
94
90
  onChange={(val) => {
95
- onChange(val || null);
91
+ onChange(val);
96
92
  clearErrors(`${product.id}` as const);
97
93
  }}
98
- onArrowDown={() => {
99
- onChange(productInfo?.quantity - 1 || 0);
94
+ onArrowDown={(val) => {
95
+ onChange(val || 0);
100
96
  clearErrors(`${product.id}` as const);
101
97
  }}
102
- onArrowUp={() => {
103
- onChange((productInfo?.quantity ?? 0) + 1);
98
+ onArrowUp={(val) => {
99
+ onChange(val || 0);
104
100
  clearErrors(`${product.id}` as const);
105
101
  }}
106
- min={0}
107
- max={product?.maxAmount ? Number(product?.maxAmount) : undefined}
102
+ min={product?.minAmount ? Number(product.minAmount) : 0}
103
+ max={product?.maxAmount ? Number(product.maxAmount) : undefined}
108
104
  placeholder="0"
109
105
  disabled={product.isSoldOut}
110
106
  value={productInfo?.quantity}
@@ -12,6 +12,7 @@ import { TIME_FORMAT } from "@licklist/core/dist/Config";
12
12
  import * as Config from "@licklist/core/dist/Config";
13
13
  import { formatDateStringForEvent } from "@licklist/plugins/dist/utils/formatDate";
14
14
  import { getOrderSourceTitle } from "@licklist/plugins/dist/utils/sourceTitle";
15
+ import { calculateTotalDiscount } from "../../../../iframe/payment/order-items-table/utils";
15
16
  import Icon from "../../../../static/Icon";
16
17
 
17
18
  export type ResultCardProps = {
@@ -42,10 +43,14 @@ export const ResultCard = ({
42
43
  event,
43
44
  menu,
44
45
  remainingToPay,
46
+ payments,
45
47
  } = order;
46
48
 
49
+ const discount = calculateTotalDiscount(payments);
50
+
47
51
  const productList = products.map((product) => product.name)?.join(", ") || "";
48
52
  const activityName = event?.name || menu?.name || "";
53
+ const totalAmountWithDiscount = totalAmount - discount;
49
54
 
50
55
  const onClick = () => {
51
56
  if (!onCardClick) return;
@@ -105,7 +110,7 @@ export const ResultCard = ({
105
110
  )}
106
111
  <p>
107
112
  {t("paidAmount")}:{" "}
108
- {formatNumber(totalAmount, {
113
+ {formatNumber(totalAmountWithDiscount, {
109
114
  style: "currency",
110
115
  currency: Config.Currency.GBP,
111
116
  })}