ordering-ui-external 2.4.2 → 2.4.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.
Files changed (26) hide show
  1. package/_bundles/{7.ordering-ui.f617c2b14777b5518ddc.js → 7.ordering-ui.a403107e2b344dcd35e9.js} +1 -1
  2. package/_bundles/ordering-ui.a403107e2b344dcd35e9.js +2 -0
  3. package/_modules/themes/five/src/components/Cart/index.js +12 -29
  4. package/_modules/themes/five/src/components/CartContent/index.js +25 -7
  5. package/_modules/themes/five/src/components/CartContent/styles.js +7 -3
  6. package/_modules/themes/five/src/components/Checkout/index.js +7 -7
  7. package/_modules/themes/five/src/components/MultiCheckout/index.js +9 -7
  8. package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +8 -7
  9. package/package.json +2 -2
  10. package/src/themes/five/src/components/Cart/index.js +11 -17
  11. package/src/themes/five/src/components/CartContent/index.js +58 -22
  12. package/src/themes/five/src/components/CartContent/styles.js +26 -0
  13. package/src/themes/five/src/components/Checkout/index.js +1 -1
  14. package/src/themes/five/src/components/MultiCheckout/index.js +7 -6
  15. package/src/themes/five/src/components/OrderDetails/OrderEta.js +6 -5
  16. package/_bundles/ordering-ui.f617c2b14777b5518ddc.js +0 -2
  17. /package/_bundles/{0.ordering-ui.f617c2b14777b5518ddc.js → 0.ordering-ui.a403107e2b344dcd35e9.js} +0 -0
  18. /package/_bundles/{1.ordering-ui.f617c2b14777b5518ddc.js → 1.ordering-ui.a403107e2b344dcd35e9.js} +0 -0
  19. /package/_bundles/{2.ordering-ui.f617c2b14777b5518ddc.js → 2.ordering-ui.a403107e2b344dcd35e9.js} +0 -0
  20. /package/_bundles/{4.ordering-ui.f617c2b14777b5518ddc.js → 4.ordering-ui.a403107e2b344dcd35e9.js} +0 -0
  21. /package/_bundles/{5.ordering-ui.f617c2b14777b5518ddc.js → 5.ordering-ui.a403107e2b344dcd35e9.js} +0 -0
  22. /package/_bundles/{6.ordering-ui.f617c2b14777b5518ddc.js → 6.ordering-ui.a403107e2b344dcd35e9.js} +0 -0
  23. /package/_bundles/{7.ordering-ui.f617c2b14777b5518ddc.js.LICENSE.txt → 7.ordering-ui.a403107e2b344dcd35e9.js.LICENSE.txt} +0 -0
  24. /package/_bundles/{8.ordering-ui.f617c2b14777b5518ddc.js → 8.ordering-ui.a403107e2b344dcd35e9.js} +0 -0
  25. /package/_bundles/{9.ordering-ui.f617c2b14777b5518ddc.js → 9.ordering-ui.a403107e2b344dcd35e9.js} +0 -0
  26. /package/_bundles/{ordering-ui.f617c2b14777b5518ddc.js.LICENSE.txt → ordering-ui.a403107e2b344dcd35e9.js.LICENSE.txt} +0 -0
@@ -54,3 +54,29 @@ export const Title = styled.h1`
54
54
  text-align: left;
55
55
  }
56
56
  `
57
+
58
+ export const MultiCartPriceContainer = styled.div`
59
+ margin-top: 38px;
60
+ > div {
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: space-between;
64
+ margin-top: 5px;
65
+ margin-bottom: 5px;
66
+ > h4 {
67
+ font-size: 18px;
68
+ margin: 0;
69
+ }
70
+ }
71
+ > span {
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: space-between;
75
+ margin-bottom: 5px;
76
+ }
77
+ p {
78
+ font-size: 14px;
79
+ color: ${props => props.theme.colors.darkGray};
80
+ margin: 0;
81
+ }
82
+ `
@@ -341,7 +341,7 @@ const CheckoutUI = (props) => {
341
341
  </div>
342
342
  ) : (
343
343
  <AddressDetails
344
- location={businessDetails?.business?.location}
344
+ location={options?.address?.location}
345
345
  businessLogo={businessDetails?.business?.logo || theme.images?.dummies?.businessLogo}
346
346
  isCartPending={cart?.status === 2}
347
347
  businessId={cart?.business_id}
@@ -108,7 +108,7 @@ const MultiCheckoutUI = (props) => {
108
108
 
109
109
  const getIncludedTaxes = (cart) => {
110
110
  if (cart?.taxes === null || !cart?.taxes) {
111
- return cart.business.tax_type === 1 ? cart?.tax : 0
111
+ return cart?.business?.tax_type === 1 ? cart?.tax : 0
112
112
  } else {
113
113
  return cart?.taxes.reduce((taxIncluded, tax) => {
114
114
  return taxIncluded + (tax.type === 1 ? tax.summary?.tax : 0)
@@ -116,11 +116,12 @@ const MultiCheckoutUI = (props) => {
116
116
  }
117
117
  }
118
118
 
119
- const loyaltyRewardValue = creditPointPlanOnBusiness?.accumulation_rate
120
- ? Math.round(
121
- openCarts.reduce((sum, cart) => sum + cart?.subtotal + getIncludedTaxes(cart), 0) /
122
- creditPointPlanOnBusiness?.accumulation_rate
123
- ) : 0
119
+ const subtotalAmount = openCarts.reduce((sum, cart) => sum + (cart?.subtotal + getIncludedTaxes(cart)), 0) *
120
+ creditPointPlanOnBusiness?.accumulation_rate
121
+
122
+ const loyaltyRewardValue = (creditPointPlanOnBusiness?.accumulation_rate
123
+ ? (Math.trunc(subtotalAmount * 100) / 100).toFixed(configs.format_number_decimal_length?.value ?? 2)
124
+ : 0)
124
125
 
125
126
  const handlePlaceOrder = () => {
126
127
  if (!userErrors.length) {
@@ -8,7 +8,7 @@ export const OrderEta = (props) => {
8
8
  outputFormat
9
9
  } = props
10
10
 
11
- const [{ parseTime }] = useUtils()
11
+ const [{ parseDate }] = useUtils()
12
12
  const [estimatedDeliveryTime, setEstimatedDeliveryTime] = useState(null)
13
13
 
14
14
  const getEstimatedDeliveryTime = () => {
@@ -36,10 +36,11 @@ export const OrderEta = (props) => {
36
36
  if (diffTimeAsMinutes <= 0) {
37
37
  totalEta += (Math.floor(Math.abs(diffTimeAsMinutes / order?.eta_current_status_time) + 1) * order?.eta_current_status_penalty_time)
38
38
  }
39
- _estimatedTime = moment(_delivery).add(totalEta, 'minutes')
39
+ _estimatedTime = moment.utc(_delivery).add(totalEta, 'minutes')
40
40
  } else {
41
- _estimatedTime = moment(_delivery).add(order?.eta_time, 'minutes')
41
+ _estimatedTime = moment.utc(_delivery).add(order?.eta_time, 'minutes')
42
42
  }
43
+ _estimatedTime = outputFormat ? moment(_estimatedTime).format(outputFormat) : parseDate(_estimatedTime, { utc: false })
43
44
  setEstimatedDeliveryTime(_estimatedTime)
44
45
  }
45
46
 
@@ -49,11 +50,11 @@ export const OrderEta = (props) => {
49
50
  getEstimatedDeliveryTime()
50
51
  }, 1000)
51
52
  return () => clearInterval(interval)
52
- }, [order])
53
+ }, [order, outputFormat])
53
54
 
54
55
  return (
55
56
  <>
56
- {!outputFormat ? parseTime(estimatedDeliveryTime) : parseTime(estimatedDeliveryTime, { outputFormat: 'hh:mm A' })}
57
+ {estimatedDeliveryTime}
57
58
  </>
58
59
  )
59
60
  }