@licklist/design 0.71.6-dev.1 → 0.71.6-dev.10

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 (114) hide show
  1. package/dist/auth/Layout/AuthNavComponent.d.ts.map +1 -1
  2. package/dist/auth/Login/LoginComponent.d.ts.map +1 -1
  3. package/dist/auth/Login/LoginFormComponent.d.ts.map +1 -1
  4. package/dist/auth/Logout/Logout.js +1 -0
  5. package/dist/auth/Register/RegisterComponent.d.ts.map +1 -1
  6. package/dist/auth/Register/RegisterFormComponent.d.ts.map +1 -1
  7. package/dist/auth/ResetPassword/ResetPasswordFormComponent.d.ts.map +1 -1
  8. package/dist/auth/Router.d.ts.map +1 -1
  9. package/dist/auth/Router.js +2 -0
  10. package/dist/calendar/utils/index.d.ts +1 -1
  11. package/dist/calendar/utils/index.d.ts.map +1 -1
  12. package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.d.ts.map +1 -1
  13. package/dist/events/event-card/utils.d.ts.map +1 -1
  14. package/dist/events/event-statistic-modal/hooks/useTableData.d.ts.map +1 -1
  15. package/dist/events/event-statistic-modal/hooks/useTableData.js +1 -1
  16. package/dist/events/event-statistic-modal/utils/index.d.ts.map +1 -1
  17. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts +1 -1
  18. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
  19. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -2
  20. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts +1 -2
  21. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
  22. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.js +2 -2
  23. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts +1 -2
  24. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts.map +1 -1
  25. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.js +1 -2
  26. package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.d.ts.map +1 -1
  27. package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.js +22 -3
  28. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts +4 -1
  29. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
  30. package/dist/iframe/order-process/components/BookingSummary/utils/index.js +3 -2
  31. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
  32. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.js +1 -1
  33. package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.d.ts.map +1 -1
  34. package/dist/iframe/payment/payment-page/PaymentPage.d.ts +1 -1
  35. package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
  36. package/dist/iframe/payment/payment-page/PaymentPage.js +29 -5
  37. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts.map +1 -1
  38. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +15 -5
  39. package/dist/iframe/ryft/RyftPaymentForm.js +1 -0
  40. package/dist/index.js +1 -0
  41. package/dist/notification/email-template/card/EmailTemplateCard.d.ts.map +1 -1
  42. package/dist/notification/sms-template/card/SmsTemplateCard.d.ts.map +1 -1
  43. package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
  44. package/dist/product-set/card/ProductSetCard.js +1 -0
  45. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  46. package/dist/product-set/control/DateInput.d.ts.map +1 -1
  47. package/dist/product-set/form/VenueMapsControl.d.ts +1 -1
  48. package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
  49. package/dist/report/ReportRunnerModal/ReportRunnerModal.js +1 -0
  50. package/dist/sales/life-time-sales/LifeTimeSalesChart.js +1 -0
  51. package/dist/sales/manual-booking/select-event/SelectEvent.js +1 -0
  52. package/dist/sales/manual-booking/select-menu/SelectMenu.js +1 -0
  53. package/dist/sales/manual-booking/summary/ManualBookingSummary.js +1 -0
  54. package/dist/sales/modals/refund-modal/RefundModal.d.ts.map +1 -1
  55. package/dist/sales/modals/refund-modal/RefundModal.js +1 -0
  56. package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
  57. package/dist/setting/dashboard/snippet-templates/card/SnippetTemplateCard.d.ts.map +1 -1
  58. package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
  59. package/dist/snippet/snippet-template/preview/Preview.js +3 -7
  60. package/dist/static/date-range-input/utils/index.d.ts +1 -1
  61. package/dist/static/date-range-input/utils/index.d.ts.map +1 -1
  62. package/dist/static/loader/FullScreenLoader.d.ts +8 -0
  63. package/dist/static/loader/FullScreenLoader.d.ts.map +1 -0
  64. package/dist/static/loader/FullScreenLoader.js +41 -0
  65. package/dist/static/loader/LoaderIndicator.d.ts +2 -3
  66. package/dist/static/loader/LoaderIndicator.d.ts.map +1 -1
  67. package/dist/static/loader/LoaderIndicator.js +4 -2
  68. package/dist/static/loader/index.d.ts +1 -0
  69. package/dist/static/loader/index.d.ts.map +1 -1
  70. package/dist/styles/availability-indicator/AvailabilityIndicator.scss +0 -3
  71. package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +1 -1
  72. package/dist/styles/static/Loader.scss +9 -0
  73. package/package.json +5 -5
  74. package/src/auth/Layout/AuthNavComponent.tsx +4 -0
  75. package/src/auth/Login/LoginComponent.tsx +2 -0
  76. package/src/auth/Login/LoginFormComponent.tsx +2 -0
  77. package/src/auth/Register/RegisterComponent.tsx +2 -0
  78. package/src/auth/Register/RegisterFormComponent.tsx +4 -0
  79. package/src/auth/ResetPassword/ResetPasswordFormComponent.tsx +4 -0
  80. package/src/auth/Router.tsx +2 -0
  81. package/src/calendar/Calendar.stories.tsx +2 -2
  82. package/src/calendar/utils/index.ts +1 -1
  83. package/src/events/edit-event-modal/component/SaleDeadline/SaleDeadline.tsx +9 -7
  84. package/src/events/event-card/utils.ts +10 -9
  85. package/src/events/event-statistic-modal/EventStatisticModal.tsx +1 -1
  86. package/src/events/event-statistic-modal/hooks/useTableData.tsx +3 -4
  87. package/src/events/event-statistic-modal/utils/index.ts +2 -1
  88. package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +0 -2
  89. package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +1 -6
  90. package/src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx +0 -3
  91. package/src/iframe/order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.tsx +22 -3
  92. package/src/iframe/order-process/components/BookingSummary/utils/index.ts +14 -2
  93. package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +4 -7
  94. package/src/iframe/page/components/PageBody/hooks/useResizePageBody.ts +1 -2
  95. package/src/iframe/payment/payment-page/PaymentPage.tsx +65 -18
  96. package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +27 -6
  97. package/src/notification/email-template/card/EmailTemplateCard.tsx +2 -0
  98. package/src/notification/sms-template/card/SmsTemplateCard.tsx +2 -0
  99. package/src/product-set/card/ProductSetCard.tsx +7 -1
  100. package/src/product-set/control/DateAndRecurrenceInput.tsx +3 -4
  101. package/src/product-set/control/DateInput.tsx +3 -4
  102. package/src/product-set/form/VenueMapsControl.tsx +1 -1
  103. package/src/sales/modals/refund-modal/RefundModal.tsx +1 -0
  104. package/src/setting/admin/AdminSettingForm.tsx +4 -0
  105. package/src/setting/dashboard/snippet-templates/card/SnippetTemplateCard.tsx +2 -0
  106. package/src/snippet/snippet-template/preview/Preview.tsx +1 -8
  107. package/src/static/date-range-input/utils/index.ts +1 -1
  108. package/src/static/loader/FullScreenLoader.tsx +16 -0
  109. package/src/static/loader/LoaderIndicator.tsx +6 -3
  110. package/src/static/loader/index.ts +1 -0
  111. package/src/styles/availability-indicator/AvailabilityIndicator.scss +0 -3
  112. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +1 -1
  113. package/src/styles/static/Loader.scss +9 -0
  114. package/yarn.lock +989 -834
@@ -1,13 +1,25 @@
1
1
  import { QuantityCheckProductInfo } from '@licklist/plugins/dist/types/Api/verifyStock'
2
2
  import { OrderItem } from '@licklist/plugins/dist/types/context/Iframe/orderItems'
3
3
 
4
- export const cartSumByOrderProducts = (orderProducts?: OrderItem[]) => {
4
+ export const cartSumByOrderProducts = ({
5
+ orderProducts,
6
+ isTotalSum,
7
+ }: {
8
+ orderProducts?: OrderItem[]
9
+ isTotalSum?: boolean
10
+ }) => {
5
11
  if (!orderProducts || !orderProducts.length) {
6
12
  return 0
7
13
  }
8
14
  return orderProducts.reduce((prevSumValue: number, product) => {
9
15
  if (!product) return 0
10
- const price = product?.hasDeposit ? product?.deposit : product?.price
16
+
17
+ const price = isTotalSum
18
+ ? product?.price
19
+ : product.hasDeposit
20
+ ? product?.deposit
21
+ : product?.price
22
+
11
23
  return prevSumValue + price * product.quantity
12
24
  }, 0)
13
25
  }
@@ -132,13 +132,10 @@ export const CategoryProduct = ({
132
132
  </div>
133
133
  <div className='iframe-event__product-price-wrapper'>
134
134
  <span className='product-price'>
135
- {formatNumber(
136
- category.allowDeposits ? product?.deposit : product.price,
137
- {
138
- style: 'currency',
139
- currency: Config.Currency.GBP,
140
- },
141
- )}
135
+ {formatNumber(product.price, {
136
+ style: 'currency',
137
+ currency: Config.Currency.GBP,
138
+ })}
142
139
  </span>
143
140
  <ProductQuantityInput
144
141
  onChange={onChange}
@@ -69,8 +69,7 @@ export const useResizePageBody = () => {
69
69
  rightBlockHeight -
70
70
  CALENDAR_WRAPPER_HEIGHT,
71
71
  }
72
-
73
- }
72
+ }
74
73
  return {
75
74
  maxHeight:
76
75
  height -
@@ -28,7 +28,7 @@ interface PaymentProps extends RyftPaymentFormProps {
28
28
  onFailIframePayment?: () => void
29
29
  data?: PaymentLinkResponse | null
30
30
  isLoading: boolean
31
- bookingSummaryProps: Omit<BookingSummaryProps, 'totallWithDiscount'>
31
+ bookingSummaryProps: BookingSummaryProps
32
32
  paymentMetadata?: PaymentMetadata
33
33
  }
34
34
 
@@ -103,17 +103,33 @@ export const PaymentPage = ({
103
103
  )
104
104
  }
105
105
 
106
- const orderTotalAmountByFormValues = cartSumByOrderProducts(
107
- bookingSummaryProps?.formValues &&
106
+ const orderCartAmountByFormValues = cartSumByOrderProducts({
107
+ orderProducts:
108
+ bookingSummaryProps?.formValues &&
108
109
  Object.values(bookingSummaryProps?.formValues),
109
- )
110
+ })
111
+
112
+ const orderTotalAmountByFormValues = cartSumByOrderProducts({
113
+ orderProducts:
114
+ bookingSummaryProps?.formValues &&
115
+ Object.values(bookingSummaryProps?.formValues),
116
+ isTotalSum: true,
117
+ })
118
+
119
+ const hasRemaingToPay =
120
+ orderTotalAmountByFormValues > orderCartAmountByFormValues
110
121
 
111
122
  // User can fill promo code only in iframe application.
112
123
  // It isn't possible via payment link. This check will
113
124
  // be applied when there is no metadata and in case when
114
125
  // orderValues sum is greater than amount in order.
115
126
  const isCalculatedAmountGreaterThanOrderAmount =
116
- orderTotalAmountByFormValues > data?.amount
127
+ !hasRemaingToPay && orderCartAmountByFormValues > data?.amount
128
+
129
+ const isPaymentLinkWithRemainingToPay =
130
+ data?.remaining_to_pay && !!Number(data?.remaining_to_pay)
131
+ const totalPaidWithRemainingToPay =
132
+ data?.amount_to_pay && !!Number(data?.amount_to_pay)
117
133
 
118
134
  return (
119
135
  <Page className='payment_link'>
@@ -173,25 +189,56 @@ export const PaymentPage = ({
173
189
  <>
174
190
  {isCalculatedAmountGreaterThanOrderAmount && (
175
191
  <SummaryTotalBlock
176
- label={t('total')}
192
+ label={t(hasRemaingToPay ? 'payNow' : 'total')}
177
193
  amount={
178
- orderTotalAmountByFormValues +
194
+ orderCartAmountByFormValues +
179
195
  (bookingSummaryProps?.transactionFee || 0)
180
196
  }
181
197
  />
182
198
  )}
183
199
 
184
- <SummaryTotalBlock
185
- label={t(
186
- isCalculatedAmountGreaterThanOrderAmount
187
- ? 'totalWithDiscount'
188
- : 'total',
189
- )}
190
- amount={
191
- data?.amount +
192
- (bookingSummaryProps?.transactionFee || 0)
193
- }
194
- />
200
+ {hasRemaingToPay && (
201
+ <SummaryTotalBlock
202
+ label={t('remaining')}
203
+ amount={
204
+ orderTotalAmountByFormValues -
205
+ orderCartAmountByFormValues
206
+ }
207
+ />
208
+ )}
209
+
210
+ {isPaymentLinkWithRemainingToPay && (
211
+ <SummaryTotalBlock
212
+ label={t('remaningToPay')}
213
+ amount={Number(data?.remaining_to_pay)}
214
+ />
215
+ )}
216
+
217
+ {totalPaidWithRemainingToPay && (
218
+ <SummaryTotalBlock
219
+ label={t('totalAmount')}
220
+ amount={Number(data?.amount_to_pay)}
221
+ />
222
+ )}
223
+ {isPaymentLinkWithRemainingToPay &&
224
+ totalPaidWithRemainingToPay ? (
225
+ <SummaryTotalBlock
226
+ label={t('payNow')}
227
+ amount={data?.amount}
228
+ />
229
+ ) : (
230
+ <SummaryTotalBlock
231
+ label={t(
232
+ isCalculatedAmountGreaterThanOrderAmount
233
+ ? 'totalWithDiscount'
234
+ : 'total',
235
+ )}
236
+ amount={
237
+ data?.amount +
238
+ (bookingSummaryProps?.transactionFee || 0)
239
+ }
240
+ />
241
+ )}
195
242
  </>
196
243
  )}
197
244
  </div>
@@ -59,9 +59,19 @@ export const PaymentStatusPage = ({
59
59
 
60
60
  if (isLoading) return <LoaderIndicator isLoaded={false} />
61
61
 
62
- const orderTotalAmounByFormValues = cartSumByOrderProducts(
63
- Object.values(bookingSummaryProps?.formValues ?? {}),
64
- )
62
+ const orderCartAmountByFormValues = cartSumByOrderProducts({
63
+ orderProducts:
64
+ bookingSummaryProps?.formValues &&
65
+ Object.values(bookingSummaryProps?.formValues),
66
+ })
67
+ const orderTotalAmountByFormValues = cartSumByOrderProducts({
68
+ orderProducts:
69
+ bookingSummaryProps?.formValues &&
70
+ Object.values(bookingSummaryProps?.formValues),
71
+ isTotalSum: true,
72
+ })
73
+ const hasRemaingToPay =
74
+ orderTotalAmountByFormValues > orderCartAmountByFormValues
65
75
 
66
76
  // User can fill promocode only in iframe appcliation.
67
77
  // It didn't possible via payment link. This check will
@@ -70,7 +80,9 @@ export const PaymentStatusPage = ({
70
80
  // For payment status page booking summary props can be empty
71
81
  // so we should also check for them
72
82
  const isCalculatedAmountGreaterThanOrderAmount =
73
- bookingSummaryProps && orderTotalAmounByFormValues > totalAmount
83
+ !hasRemaingToPay &&
84
+ bookingSummaryProps &&
85
+ orderCartAmountByFormValues > totalAmount
74
86
 
75
87
  return (
76
88
  <Page
@@ -127,9 +139,9 @@ export const PaymentStatusPage = ({
127
139
  <>
128
140
  {isCalculatedAmountGreaterThanOrderAmount && (
129
141
  <SummaryTotalBlock
130
- label={t('total')}
142
+ label={t(hasRemaingToPay ? 'payNow' : 'total')}
131
143
  amount={
132
- orderTotalAmounByFormValues +
144
+ orderCartAmountByFormValues +
133
145
  (bookingSummaryProps?.transactionFee || 0)
134
146
  }
135
147
  />
@@ -146,6 +158,15 @@ export const PaymentStatusPage = ({
146
158
  (bookingSummaryProps?.transactionFee || 0)
147
159
  }
148
160
  />
161
+ {hasRemaingToPay && (
162
+ <SummaryTotalBlock
163
+ label={t('remaining')}
164
+ amount={
165
+ orderTotalAmountByFormValues -
166
+ orderCartAmountByFormValues
167
+ }
168
+ />
169
+ )}
149
170
  </>
150
171
  )}
151
172
  </div>
@@ -35,6 +35,8 @@ export function EmailTemplateCard({
35
35
  return (
36
36
  <div className='snippet-template-card'>
37
37
  <div className='snippet-template-card-header'>
38
+ {/* TODO fix issue react router types
39
+ @ts-expect-error */}
38
40
  <Link to={href}>{name}</Link>
39
41
  {hasPermission && Boolean(onRemove) && (
40
42
  <ConfirmModal
@@ -33,6 +33,8 @@ export function SmsTemplateCard({
33
33
  return (
34
34
  <div className='snippet-template-card'>
35
35
  <div className='snippet-template-card-header'>
36
+ {/* TODO fix issue react router types
37
+ @ts-expect-error */}
36
38
  <Link to={href}>{name}</Link>
37
39
  {hasPermission && Boolean(onRemove) && (
38
40
  <ConfirmModal
@@ -136,7 +136,13 @@ export function ProductSetCard({
136
136
  onClick={(e) => e.stopPropagation()}
137
137
  >
138
138
  {Boolean(onRemove) && (
139
- <ConfirmModal>
139
+ <ConfirmModal
140
+ content={t(
141
+ override
142
+ ? 'confirmRemoveProductSetWithOverrides'
143
+ : 'areUSureYouWantToPerformThisAction',
144
+ )}
145
+ >
140
146
  {(confirm) => (
141
147
  <MenuButton
142
148
  onClick={() => {
@@ -198,7 +198,8 @@ export const DateAndRecurrenceInput = ({
198
198
  move(prevIndex, nextIndex)
199
199
  }
200
200
 
201
- const errorMessage = errors.menuRecurrences?.message || errors.menuRecurrences?.root?.message
201
+ const errorMessage =
202
+ errors.menuRecurrences?.message || errors.menuRecurrences?.root?.message
202
203
 
203
204
  useEffect(() => {
204
205
  if (fields.length) {
@@ -308,9 +309,7 @@ export const DateAndRecurrenceInput = ({
308
309
  })}
309
310
  />
310
311
 
311
- <div className='manual-form-error'>
312
- {errorMessage}
313
- </div>
312
+ <div className='manual-form-error'>{errorMessage}</div>
314
313
  </div>
315
314
  </OverlayTrigger>
316
315
  </Form.Group>
@@ -195,7 +195,8 @@ export const DateInput = ({
195
195
  }, 100)
196
196
  }
197
197
 
198
- const errorMessage = errors.menuRecurrences?.message || errors.menuRecurrences?.root?.message
198
+ const errorMessage =
199
+ errors.menuRecurrences?.message || errors.menuRecurrences?.root?.message
199
200
 
200
201
  return (
201
202
  <Form.Group>
@@ -284,9 +285,7 @@ export const DateInput = ({
284
285
  })}
285
286
  />
286
287
 
287
- <div className='manual-form-error'>
288
- {errorMessage}
289
- </div>
288
+ <div className='manual-form-error'>{errorMessage}</div>
290
289
  </div>
291
290
  </OverlayTrigger>
292
291
  </Form.Group>
@@ -3,9 +3,9 @@ import { Button } from 'react-bootstrap'
3
3
  import { VenueMap } from '@licklist/core/dist/DataMapper/Product/VenueMapDataMapper'
4
4
  import MediaService from '@licklist/plugins/dist/services/Media/MediaService'
5
5
  import { PointProduct } from '@licklist/core/dist/DataMapper/Product/PointProductDataMapper'
6
+ import { Product } from '@licklist/core/dist/DataMapper/Product/ProductDataMapper'
6
7
  import { FullscreenModal } from '../../modals/fullscreen'
7
8
  import { EventVenueMap } from '../../events/event-venue-map'
8
- import { Product } from '../types'
9
9
 
10
10
  type VenueMapsControlProps = {
11
11
  venueMaps?: VenueMap[]
@@ -110,6 +110,7 @@ export const RefundModal = ({
110
110
  }) as string
111
111
  },
112
112
  })}
113
+ step={0.01}
113
114
  disabled={isLoading || isFullRefund}
114
115
  isInvalid={!!errors.amount}
115
116
  min={0}
@@ -145,10 +145,14 @@ export const AdminSettingForm = ({
145
145
  ) && (
146
146
  <>
147
147
  {t('noCountryIsProvided')}
148
+ {/* TODO fix issue react router types
149
+ @ts-expect-error */}
148
150
  <Link
149
151
  role='button'
150
152
  to={`/provider/${providerMetadata?.providerType}/${providerMetadata?.providableId}/update`}
151
153
  >
154
+ {/* TODO fix issue react router types
155
+ @ts-expect-error */}
152
156
  {t('here')}
153
157
  </Link>
154
158
  </>
@@ -24,6 +24,8 @@ export function SnippetTemplateCard({
24
24
  return (
25
25
  <div className='snippet-template-card'>
26
26
  <div className='snippet-template-card-header'>
27
+ {/* TODO fix issue react router types
28
+ @ts-expect-error */}
27
29
  <Link to={href}>{name}</Link>
28
30
  {hasPermission && !isDefault && (
29
31
  <button
@@ -29,7 +29,6 @@ import {
29
29
  import { NumberInput } from '../../../iframe/order-process/components/CategoryProduct/components/NumberInput'
30
30
  import { SnippetTemplateContext } from '../context/snippetTemplate'
31
31
 
32
-
33
32
  const DEFAULT_IMAGE =
34
33
  'https://images.unsplash.com/photo-1638988319382-90e61be77c59?ixlib=rb-1.2.1&auto=format&fit=crop&w=687&q=80'
35
34
 
@@ -58,7 +57,7 @@ export function Preview({
58
57
 
59
58
  const [currentDate, setCurrentDate] = useState<DateTime>(defaultStartDay)
60
59
  const [selectedDate, setSelectedDate] = useState<DateTime | null>(null)
61
- const calendarDates = getMonthCalendarDates(currentDate)
60
+ const calendarDates = getMonthCalendarDates({ initialDate: currentDate })
62
61
 
63
62
  return (
64
63
  <div className='w-100 h-100 snippet-template-preview'>
@@ -309,7 +308,6 @@ export function Preview({
309
308
  productCategoryId: 57,
310
309
  productGroupId: null,
311
310
  availableQuantity: 980,
312
- zoneId: null,
313
311
  name: 'Cofee',
314
312
  description: '',
315
313
  price: 15,
@@ -318,8 +316,6 @@ export function Preview({
318
316
  maxQuantity: 15,
319
317
  totalQuantity: 980,
320
318
  type: 'sale' as const,
321
- capacity: 0,
322
- duration: 0,
323
319
  weight: 0,
324
320
  isAvailable: true,
325
321
  isSoldOut: false,
@@ -338,7 +334,6 @@ export function Preview({
338
334
  productCategoryId: 57,
339
335
  productGroupId: null,
340
336
  availableQuantity: 980,
341
- zoneId: null,
342
337
  name: 'Cofee 2',
343
338
  description: '',
344
339
  price: 15,
@@ -347,8 +342,6 @@ export function Preview({
347
342
  maxQuantity: 15,
348
343
  totalQuantity: 980,
349
344
  type: 'sale' as const,
350
- capacity: 0,
351
- duration: 0,
352
345
  weight: 0,
353
346
  isAvailable: true,
354
347
  isSoldOut: false,
@@ -58,7 +58,7 @@ export const stringDatesToInputValue = ({
58
58
  )} - ${DateTime.fromJSDate(nextEndDate).toFormat(INPUT_DATE_FORMAT)}`
59
59
  }
60
60
 
61
- export const getDateParams = (date: Date) => {
61
+ export const getDateParams = (date: Date): [number, number, number] => {
62
62
  const year = date.getFullYear()
63
63
  const month = date.getMonth() + 1
64
64
  const monthDate = date.getDate()
@@ -0,0 +1,16 @@
1
+ import clsx from 'clsx'
2
+ import { LoaderIndicator, LoaderIndicatorProps } from './LoaderIndicator'
3
+
4
+ interface FullScreenLoaderProps {
5
+ containerClassName?: string
6
+ indicatorProps?: LoaderIndicatorProps
7
+ }
8
+
9
+ export const FullScreenLoader = ({
10
+ containerClassName,
11
+ indicatorProps,
12
+ }: FullScreenLoaderProps) => (
13
+ <div className={clsx('fullscreen-loader', containerClassName)}>
14
+ <LoaderIndicator {...indicatorProps} />
15
+ </div>
16
+ )
@@ -1,16 +1,17 @@
1
1
  /* eslint-disable react/jsx-pascal-case */
2
- import { ReactNode } from 'react'
2
+ import { PropsWithChildren } from 'react'
3
3
  import * as ReactLoader from 'react-loader'
4
4
  import ILoaderOptions from '../../types/static/ILoaderOptions'
5
5
 
6
6
  export interface LoaderIndicatorProps {
7
- children?: ReactNode | ReactNode[]
8
7
  isLoaded?: boolean
9
8
  options?: ILoaderOptions
10
9
  className?: string
11
10
  }
12
11
 
13
- export function LoaderIndicator(props: LoaderIndicatorProps) {
12
+ export function LoaderIndicator(
13
+ props: PropsWithChildren<LoaderIndicatorProps>,
14
+ ) {
14
15
  const { children, isLoaded, options, className = '' } = props
15
16
 
16
17
  const defaultOptions: ILoaderOptions = {
@@ -37,6 +38,8 @@ export function LoaderIndicator(props: LoaderIndicatorProps) {
37
38
  } as ILoaderOptions
38
39
 
39
40
  return (
41
+ // TODO Remove this library, it's deprecated and even removed from npm packages
42
+ // @ts-expect-error
40
43
  <ReactLoader.default
41
44
  loaded={isLoaded!}
42
45
  options={mergedOptions}
@@ -5,3 +5,4 @@ export { ButtonLoader } from './ButtonLoader'
5
5
  export { SnippetLoader } from './SnippetLoader'
6
6
  export { PaymentLoader } from './PaymentLoader'
7
7
  export type { PaymentLoaderProps } from './PaymentLoader'
8
+ export { FullScreenLoader } from './FullScreenLoader'
@@ -6,7 +6,6 @@
6
6
  font-weight: 300;
7
7
  width: 100%;
8
8
 
9
-
10
9
  .indicator-label {
11
10
  text-overflow: ellipsis;
12
11
  white-space: nowrap;
@@ -25,8 +24,6 @@
25
24
  }
26
25
  }
27
26
 
28
-
29
-
30
27
  .activity-card {
31
28
  .availability-indicator {
32
29
  margin-top: 0.5rem;
@@ -179,7 +179,7 @@
179
179
  .form-disable-box {
180
180
  top: 20rem;
181
181
  }
182
- }
182
+ }
183
183
  }
184
184
 
185
185
  @include media-breakpoint-up(md) {
@@ -27,6 +27,15 @@
27
27
  }
28
28
  }
29
29
 
30
+ .fullscreen-loader {
31
+ width: 100vw;
32
+ height: 100vh;
33
+ position: fixed;
34
+ z-index: 5000;
35
+ top: 0;
36
+ left: 0;
37
+ }
38
+
30
39
  .payment-loader {
31
40
  position: absolute;
32
41
  top: 50%;