@licklist/design 0.78.5-dev.2 → 0.78.5-dev.23

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 (72) hide show
  1. package/dist/CustomDatePicker/CustomDatePicker.d.ts +10 -0
  2. package/dist/CustomDatePicker/CustomDatePicker.d.ts.map +1 -0
  3. package/dist/auth/ChangePassword/ChangePasswordComponent.d.ts.map +1 -1
  4. package/dist/auth/ChangePassword/ChangePasswordComponent.js +5 -4
  5. package/dist/auth/Layout/UserNavDropDownToggle.js +3 -0
  6. package/dist/auth/Login/LoginComponent.d.ts.map +1 -1
  7. package/dist/auth/Login/LoginComponent.js +11 -7
  8. package/dist/auth/Register/RegisterComponent.d.ts.map +1 -1
  9. package/dist/auth/Register/RegisterComponent.js +5 -4
  10. package/dist/auth/ResetPassword/ResetPasswordComponent.d.ts.map +1 -1
  11. package/dist/auth/ResetPassword/ResetPasswordComponent.js +5 -4
  12. package/dist/auth/Social/SocialCallbackComponent.d.ts.map +1 -1
  13. package/dist/auth/Social/SocialCallbackComponent.js +5 -2
  14. package/dist/auth/Social/SocialFormComponent.d.ts.map +1 -1
  15. package/dist/auth/Social/SocialFormComponent.js +4 -4
  16. package/dist/custom-fields/field-set/components/CustomFieldSet/CustomFieldSet.d.ts.map +1 -1
  17. package/dist/custom-fields/field-set/components/CustomFieldSet/CustomFieldSet.js +5 -4
  18. package/dist/customRadioButton/RadioButton.d.ts +11 -0
  19. package/dist/customRadioButton/RadioButton.d.ts.map +1 -0
  20. package/dist/customRadioButton/RadioButton.js +93 -0
  21. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
  22. package/dist/events/edit-recurrent-event-modal/EditRecurrentEventModal.d.ts.map +1 -1
  23. package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
  24. package/dist/file-upload/FileUpload.d.ts.map +1 -1
  25. package/dist/file-upload/FileUpload.js +4 -4
  26. package/dist/iframe/payment/order-items-table/hooks/useTableData.d.ts.map +1 -1
  27. package/dist/iframe/payment/order-items-table/hooks/useTableData.js +81 -80
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +1 -0
  31. package/dist/modals/dialog/Dialog.d.ts.map +1 -1
  32. package/dist/modals/dialog/Dialog.js +39 -41
  33. package/dist/notification/email-template/card/EmailTemplateCard.d.ts.map +1 -1
  34. package/dist/notification/email-template/control/EmailTemplateControl.d.ts +1 -0
  35. package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
  36. package/dist/notification/email-template/control/EmailTemplateControl.js +4 -4
  37. package/dist/notification/email-template/form/EmailTemplateForm.d.ts +2 -1
  38. package/dist/notification/email-template/form/EmailTemplateForm.d.ts.map +1 -1
  39. package/dist/notification/email-template/form/EmailTemplateForm.js +2 -1
  40. package/dist/product-set/product/advanced-options/AdvancedOptions.js +1 -1
  41. package/dist/recurrence-input/RecurrenceInput.d.ts.map +1 -1
  42. package/dist/recurrence-input/RecurrenceInput.js +1 -1
  43. package/dist/sales/guest-profile/profile/Profile.d.ts.map +1 -1
  44. package/dist/sales/guest-profile/profile/Profile.js +2 -1
  45. package/dist/setting/dashboard/payments/payments-modal/PaymentsModal.d.ts.map +1 -1
  46. package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
  47. package/dist/snippet/snippet-template/preview/Preview.js +14 -20
  48. package/package.json +6 -6
  49. package/src/CustomDatePicker/CustomDatePicker.tsx +258 -0
  50. package/src/auth/ChangePassword/ChangePasswordComponent.tsx +3 -4
  51. package/src/auth/Layout/UserNavDropDownToggle.tsx +1 -1
  52. package/src/auth/Login/LoginComponent.tsx +7 -5
  53. package/src/auth/Register/RegisterComponent.tsx +3 -4
  54. package/src/auth/ResetPassword/ResetPasswordComponent.tsx +3 -4
  55. package/src/auth/Social/SocialCallbackComponent.tsx +3 -2
  56. package/src/auth/Social/SocialFormComponent.tsx +2 -3
  57. package/src/custom-fields/field-set/components/CustomFieldSet/CustomFieldSet.tsx +3 -4
  58. package/src/customRadioButton/RadioButton.tsx +84 -0
  59. package/src/events/edit-recurrent-event-modal/EditRecurrentEventModal.tsx +1 -0
  60. package/src/events/event-statistic-modal/EventStatisticModal.tsx +1 -0
  61. package/src/file-upload/FileUpload.tsx +2 -3
  62. package/src/iframe/payment/order-items-table/hooks/useTableData.tsx +103 -109
  63. package/src/index.ts +1 -0
  64. package/src/modals/dialog/Dialog.tsx +35 -36
  65. package/src/notification/email-template/card/EmailTemplateCard.tsx +0 -2
  66. package/src/notification/email-template/control/EmailTemplateControl.tsx +7 -5
  67. package/src/notification/email-template/form/EmailTemplateForm.tsx +3 -0
  68. package/src/recurrence-input/RecurrenceInput.tsx +4 -3
  69. package/src/sales/guest-profile/profile/Profile.tsx +2 -5
  70. package/src/setting/dashboard/payments/payments-modal/PaymentsModal.tsx +1 -0
  71. package/src/snippet/snippet-template/preview/Preview.tsx +6 -9
  72. package/yarn.lock +528 -576
@@ -1,8 +1,8 @@
1
+ import { showAlert } from '@licklist/plugins/dist/context/app/AlertContext'
1
2
  /* eslint-disable no-return-assign */
2
3
  /* eslint-disable react-hooks/exhaustive-deps */
3
4
  import { useEffect, useState } from 'react'
4
5
  import clsx from 'clsx'
5
- import useNotification from '@licklist/plugins/dist/context/app/hooks/useNotification'
6
6
  import { Image } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
7
7
  import { Attachment } from '@licklist/core/dist/DataMapper/Notification/AttachmentDataMapper'
8
8
  import { AttachmentMetadata } from '@licklist/core/dist/DataMapper/Notification/AttachmentMetadataDataMapper'
@@ -153,7 +153,6 @@ export const useFileUpload = ({
153
153
  const [files, setFiles] = useState<File[] | null>(null)
154
154
  const [isDragged, setIsDragged] = useState(false)
155
155
 
156
- const notification = useNotification()
157
156
  const { t } = useTranslation('Design')
158
157
 
159
158
  const uploadFile = (file: File) => {
@@ -183,7 +182,7 @@ export const useFileUpload = ({
183
182
  if (isExtensionValid) {
184
183
  uploadFile(file)
185
184
  } else {
186
- notification.danger({
185
+ showAlert({ type: 'error',
187
186
  title: t('fileNotUploaded', { fileName: file.name }),
188
187
  message: t('invalidExtension', { extension: fileExtension }),
189
188
  })
@@ -1,24 +1,22 @@
1
1
  import { useMemo } from 'react'
2
- import { uniqueId, flatMap, flatten, map } from 'lodash'
2
+ import { uniqueId, flatMap, flatten } from 'lodash'
3
3
  import { useIntl } from 'react-intl'
4
4
  import { useTranslation } from 'react-i18next'
5
5
  import { Product } from '@licklist/core/dist/DataMapper/Product/ProductDataMapper'
6
6
  import { OrderModifier } from '@licklist/core/dist/DataMapper/Order/OrderModifierDataMapper'
7
+ import { OrderProduct } from '@licklist/core/dist/DataMapper/Order/OrderProductDataMapper'
7
8
  import {
8
9
  PAYMENT_TYPE_VAT,
9
10
  PAYMENT_TYPE_FEE,
10
11
  PAYMENT_TYPE_NET_PROFIT,
11
12
  } from '@licklist/core/dist/DataMapper/Order/PaymentDataMapper'
12
13
  import { StaticTableData } from '../../../../table'
13
- import { getProductQuantityAndPrice, getTotalSumByCategory } from '../utils'
14
+ import { getTotalSumByCategory } from '../utils'
14
15
  import { OrderItemsTableProps, SummaryItem } from '../types'
15
16
  import { getOrderSummaryItems } from '../utils/paymentSummary'
16
- import { Order } from '@licklist/core/dist/DataMapper'
17
- import { OrderPayment } from '@licklist/core/dist/DataMapper/Order/OrderPaymentDataMapper'
18
- import { OrderProduct } from '@licklist/core/dist/DataMapper/Order/OrderProductDataMapper'
19
- import { OrderModifierByProduct } from '@licklist/core/dist/DataMapper/Order/OrderModifiierByProduct'
20
17
 
21
18
  const CURRENCY_DEFAULT = 'GBP'
19
+
22
20
  export const PAYMENT_TYPE_TRANSLATE_KEYS = {
23
21
  [PAYMENT_TYPE_NET_PROFIT]: 'netAmount',
24
22
  [PAYMENT_TYPE_FEE]: 'bookeditFee',
@@ -41,43 +39,62 @@ export const useTableData = ({
41
39
  })
42
40
 
43
41
  const wrapLabelContent = (string: string) => (
44
- <div className='label'>{string}</div>
42
+ <div className="label">{string}</div>
45
43
  )
46
44
 
47
45
  const renderCategoryItem = (products: Product[]) => ({
48
46
  key: uniqueId('category-id-'),
49
- name: wrapLabelContent(products[0].productCategory?.name ?? ''),
47
+ name: wrapLabelContent(products[0]?.productCategory?.name ?? ''),
50
48
  quantity: '',
51
49
  price: wrapLabelContent(
52
50
  `${t('total')}: ${formatPrice(
53
- getTotalSumByCategory(order.orderProducts, products),
51
+ getTotalSumByCategory(order.orderProducts ?? [], products),
54
52
  )}`,
55
53
  ),
56
54
  })
57
55
 
58
- const reworkProductStructure = (order: OrderProduct) =>
59
- order
60
- ? flatMap(order, (item) => {
61
- if (!item || !Array.isArray(item)) return []
62
- return item.map((modGroup, idx) => ({
63
- deletedAt: order.deletedAt ?? null,
64
- id: `${order.id}-${idx + 1}`, // Ensuring uniqueness with string concatenation
65
- orderId: order.orderId ?? null,
66
- price: order.price ?? 0,
67
- productId: order.productId ?? '',
68
- quantity: modGroup.productQuantity ?? 1,
69
- deposit: order.deposit ?? 0,
70
- orderProductModifiers: modGroup.modifiers.map((mod) => ({
71
- modifierId: mod.modifierId ?? '',
72
- price: mod.price ?? 0,
73
- productId: mod.productId ?? '',
74
- quantity: mod.quantity ?? 1,
75
- modifierSetId: mod.modifierSetId ?? '',
76
- modifier: mod.modifier ?? null,
77
- })),
78
- }))
79
- })
80
- : []
56
+ const reworkProductStructure = (order: OrderProduct) => {
57
+ if (!order) return []
58
+
59
+ const groups: any[] = (order as any)?.orderProductModifiersGroups ?? []
60
+ if (!Array.isArray(groups) || !groups.length) return [order]
61
+
62
+ return groups.flatMap((modGroup, idx) => ({
63
+ deletedAt: order.deletedAt ?? null,
64
+ id: `${order.id}-${idx + 1}`,
65
+ orderId: order.orderId ?? null,
66
+ price: order.price ?? 0,
67
+ productId: order.productId ?? '',
68
+ quantity: modGroup?.productQuantity ?? 1,
69
+ deposit: order.deposit ?? 0,
70
+ orderProductModifiers:
71
+ (modGroup?.modifiers ?? []).map((mod: any) => ({
72
+ modifierId: mod?.modifierId ?? '',
73
+ price: mod?.price ?? 0,
74
+ productId: mod?.productId ?? '',
75
+ quantity: mod?.quantity ?? 1,
76
+ modifierSetId: mod?.modifierSetId ?? '',
77
+ modifier: mod?.modifier ?? null,
78
+ })) ?? [],
79
+ }))
80
+ }
81
+
82
+ const renderModifierItem = (orderModifier: OrderModifier) => {
83
+ if (!orderModifier || orderModifier.quantity === 0) return null
84
+ const { quantity, modifier, modifierId, price } = orderModifier
85
+
86
+ return {
87
+ key: modifierId,
88
+ name: ` - ${modifier?.name || ''}`,
89
+ quantity: (
90
+ <div className="quantity">
91
+ <div className="multiplier">x</div>
92
+ {quantity}
93
+ </div>
94
+ ),
95
+ price: formatPrice(price ?? 0),
96
+ }
97
+ }
81
98
 
82
99
  const renderProductItem = ({
83
100
  product,
@@ -86,43 +103,26 @@ export const useTableData = ({
86
103
  product: OrderProduct
87
104
  productsForCategory: Product[]
88
105
  }) => {
89
- if (product.quantity === 0) {
90
- return null
91
- }
92
-
106
+ if (!product || product.quantity === 0) return null
107
+
93
108
  const name =
94
- productsForCategory.find((item) => item.id === product.productId)?.name || ''
109
+ productsForCategory.find((item) => item.id === product.productId)?.name ||
110
+ ''
95
111
 
96
112
  return {
97
113
  key: product.id,
98
114
  name,
99
115
  quantity: (
100
- <div className='quantity'>
101
- <div className='multiplier'>x</div>
116
+ <div className="quantity">
117
+ <div className="multiplier">x</div>
102
118
  {product.quantity}
103
119
  </div>
104
120
  ),
105
- price: formatPrice(product.price),
106
- modifier: product?.orderProductModifiers?.map(renderModifierItem) || [],
107
- }
108
- }
109
-
110
- const renderModifierItem = (orderModifier: OrderModifier) => {
111
- const { quantity, modifier, modifierId, price } = orderModifier
112
- if (quantity === 0) {
113
- return null
114
- }
115
-
116
- return {
117
- key: modifierId,
118
- name: ` - ${modifier?.name || ''}`,
119
- quantity: (
120
- <div className='quantity'>
121
- <div className='multiplier'>x</div>
122
- {quantity}
123
- </div>
124
- ),
125
- price: formatPrice(price),
121
+ price: formatPrice(product.price ?? 0),
122
+ modifier:
123
+ (product?.orderProductModifiers?.map(renderModifierItem) ?? []).filter(
124
+ Boolean,
125
+ ),
126
126
  }
127
127
  }
128
128
 
@@ -132,41 +132,40 @@ export const useTableData = ({
132
132
  ]
133
133
 
134
134
  return productCategories.reduce(
135
- (previousValues: StaticTableData[], categoryId) => {
136
- const productsForCategory = order?.products.filter(
137
- (product) => product.productCategoryId === categoryId,
138
- )
139
-
140
- const products = order.orderProducts.filter((el) =>
141
- productsForCategory
142
- .map((product) => product.id)
143
- .includes(el.productId),
144
- )
145
-
146
- if (!products.length) {
147
- return previousValues
148
- }
135
+ (acc: StaticTableData[], categoryId) => {
136
+ const productsForCategory =
137
+ order?.products.filter((p) => p.productCategoryId === categoryId) ?? []
138
+
139
+ const products =
140
+ order?.orderProducts?.filter((el) =>
141
+ productsForCategory.map((p) => p.id).includes(el.productId),
142
+ ) ?? []
143
+
144
+ if (!products.length) return acc
145
+
149
146
  const productsWithReworkedModifier = products.map((product) => {
150
- if (!product.orderProductModifiers.length) return product
147
+ if (!product?.orderProductModifiers?.length) return product
151
148
  return reworkProductStructure(product)
152
149
  })
153
150
 
154
- const filteredProducts = flatten(productsWithReworkedModifier).map(
155
- (product) =>
156
- renderProductItem({ product , productsForCategory }),
157
- )
158
-
159
- const productWithModifier = flatMap(filteredProducts, (item) => [
160
- item,
161
- ...item.modifier,
162
- ])
151
+ const filteredProducts = flatten(productsWithReworkedModifier)
152
+ .map((p) =>
153
+ renderProductItem({
154
+ product: p as OrderProduct,
155
+ productsForCategory,
156
+ }),
157
+ )
158
+ .filter((row): row is NonNullable<typeof row> => Boolean(row))
159
+
160
+ if (!filteredProducts.length) return acc
163
161
 
164
- if (!filteredProducts.length) {
165
- return previousValues
166
- }
162
+ const productWithModifier = flatMap(filteredProducts, (row) => [
163
+ row,
164
+ ...(row.modifier ?? []),
165
+ ])
167
166
 
168
167
  return [
169
- ...previousValues,
168
+ ...acc,
170
169
  renderCategoryItem(productsForCategory),
171
170
  ...productWithModifier,
172
171
  ]
@@ -183,26 +182,21 @@ export const useTableData = ({
183
182
  price: wrapLabelContent(formatPrice(price)),
184
183
  }))
185
184
 
186
- const data = useMemo(
187
- () => {
188
- if (!order) {
189
- return []
190
- }
191
-
192
- return [
193
- ...renderProductsContent(),
194
- ...renderSummaryItems(
195
- getOrderSummaryItems({
196
- order,
197
- paymentDetail,
198
- isPaymentProcessed,
199
- externalDiscount,
200
- }),
201
- ),
202
- ]
203
- },
204
- // eslint-disable-next-line react-hooks/exhaustive-deps
205
- [order, externalDiscount, isPaymentProcessed],
206
- )
185
+ const data = useMemo(() => {
186
+ if (!order) return []
187
+
188
+ return [
189
+ ...renderProductsContent(),
190
+ ...renderSummaryItems(
191
+ getOrderSummaryItems({
192
+ order,
193
+ paymentDetail,
194
+ isPaymentProcessed,
195
+ externalDiscount,
196
+ }),
197
+ ),
198
+ ]
199
+ }, [order, externalDiscount, isPaymentProcessed, paymentDetail])
200
+
207
201
  return data
208
202
  }
package/src/index.ts CHANGED
@@ -43,3 +43,4 @@ export * from './availability-indicator'
43
43
  export * from './number-of-people-input'
44
44
  export * from './fullscreen-loader'
45
45
  export * from './pages'
46
+ export { default as RadioButton } from './customRadioButton/RadioButton'
@@ -32,42 +32,41 @@ export const Dialog = ({
32
32
  }
33
33
 
34
34
  return (
35
- <>
36
- <Modal
37
- show={isActive}
38
- onHide={onDecline}
39
- animation={false}
40
- size='sm'
41
- centered
42
- className='text-center justify-content-center rounded'
43
- >
44
- <Modal.Header className='justify-content-center border-0'>
45
- {title && <Modal.Title as='h6'>{title}</Modal.Title>}
46
- </Modal.Header>
47
- {content && (
48
- <Modal.Body className='justify-content-center'>{content}</Modal.Body>
35
+ <Modal
36
+ show={isActive}
37
+ onHide={onDecline}
38
+ animation={false}
39
+ size='sm'
40
+ centered
41
+ className='text-center justify-content-center rounded'
42
+ >
43
+ {/* @ts-ignore */}
44
+ <Modal.Header className='justify-content-center border-0'>
45
+ {title && <Modal.Title as='h6'>{title}</Modal.Title>}
46
+ </Modal.Header>
47
+ {content && (
48
+ <Modal.Body className='justify-content-center'>{content}</Modal.Body>
49
+ )}
50
+ <Modal.Footer className='border-0 justify-content-center'>
51
+ {customButtons || (
52
+ <>
53
+ <Button
54
+ variant='secondary'
55
+ className='modal-buttons'
56
+ onClick={declineHandler}
57
+ >
58
+ {t('cancel')}
59
+ </Button>
60
+ <Button
61
+ variant='primary'
62
+ className='modal-buttons'
63
+ onClick={approveHandler}
64
+ >
65
+ {t('Design:confirm')}
66
+ </Button>
67
+ </>
49
68
  )}
50
- <Modal.Footer className='border-0 justify-content-center'>
51
- {customButtons || (
52
- <>
53
- <Button
54
- variant='secondary'
55
- className='modal-buttons'
56
- onClick={declineHandler}
57
- >
58
- {t('cancel')}
59
- </Button>
60
- <Button
61
- variant='primary'
62
- className='modal-buttons'
63
- onClick={approveHandler}
64
- >
65
- {t('Design:confirm')}
66
- </Button>
67
- </>
68
- )}
69
- </Modal.Footer>
70
- </Modal>
71
- </>
69
+ </Modal.Footer>
70
+ </Modal>
72
71
  )
73
72
  }
@@ -35,8 +35,6 @@ 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 */}
40
38
  <Link to={href}>{name}</Link>
41
39
  {hasPermission && Boolean(onRemove) && (
42
40
  <ConfirmModal
@@ -27,6 +27,7 @@ export interface EmailTemplateControlProps {
27
27
  meta: string
28
28
  defaultAttachments?: Attachment[]
29
29
  notificationTypes?: NotificationType[]
30
+ waiverType?: boolean
30
31
  getDefaultTemplateMetaByType?: (type?: NotificationType | null) => string
31
32
  }
32
33
 
@@ -38,6 +39,7 @@ export const EmailTemplateControl = forwardRef(
38
39
  options = [],
39
40
  defaultAttachments = [],
40
41
  notificationTypes = [],
42
+ waiverType = false,
41
43
  getDefaultTemplateMetaByType,
42
44
  }: EmailTemplateControlProps,
43
45
  ref: any,
@@ -196,7 +198,7 @@ export const EmailTemplateControl = forwardRef(
196
198
  })
197
199
  })
198
200
  }
199
-
201
+
200
202
  return (
201
203
  <>
202
204
  <Row>
@@ -284,7 +286,7 @@ export const EmailTemplateControl = forwardRef(
284
286
  </Form.Group>
285
287
  </Row>
286
288
 
287
- <Row>
289
+ { !waiverType && (<Row>
288
290
  <Form.Group as={Col}>
289
291
  <Form.Check
290
292
  {...register('isActive')}
@@ -301,7 +303,7 @@ export const EmailTemplateControl = forwardRef(
301
303
  custom
302
304
  />
303
305
  </Form.Group>
304
- </Row>
306
+ </Row>)}
305
307
  <Row className='mb-4'>
306
308
  <Form.Group as={Col}>
307
309
  <Form.Label>{t('Design:emailBody')}</Form.Label>
@@ -374,7 +376,7 @@ export const EmailTemplateControl = forwardRef(
374
376
  }
375
377
  // should show dropdown only if user want to include PDF file
376
378
  if (option.type === OPTION_TYPE.files_selector) {
377
- const fileSelectors = JSON.parse(option.defaultValue)
379
+ const fileSelectors = option?.defaultValue ? JSON.parse(option.defaultValue) : ''
378
380
  const fileNames = Object.values(fileSelectors)
379
381
  const fileKeys = Object.keys(fileSelectors)
380
382
 
@@ -423,7 +425,7 @@ export const EmailTemplateControl = forwardRef(
423
425
  )
424
426
  }
425
427
 
426
- if (option.type === OPTION_TYPE.days_reminder) {
428
+ if (option.type === OPTION_TYPE.days_reminder || option.type === OPTION_TYPE.waiver_reminder ) {
427
429
  return (
428
430
  <>
429
431
  <Form.Label className='mt-4'>
@@ -41,6 +41,7 @@ export interface EmailTemplateProps extends HasPermissionProp {
41
41
  placeholders?: NotificationPlaceholder[]
42
42
  options?: TemplateOption[]
43
43
  serverErrors?: ServerError
44
+ waiverType?: boolean
44
45
  notificationTypes?: NotificationType[]
45
46
  getDefaultTemplateMetaByType?: (type?: NotificationType | null) => string
46
47
  onTypeChange?: (type?: NotificationType | null) => void
@@ -54,6 +55,7 @@ export const EmailTemplateForm = ({
54
55
  placeholders = [],
55
56
  options = [],
56
57
  serverErrors,
58
+ waiverType,
57
59
  notificationTypes = [],
58
60
  getDefaultTemplateMetaByType,
59
61
  onTypeChange,
@@ -93,6 +95,7 @@ export const EmailTemplateForm = ({
93
95
  >
94
96
  <EmailTemplateControl
95
97
  ref={emailEditorRef}
98
+ waiverType={waiverType}
96
99
  setIsLoading={setIsLoading}
97
100
  meta={defaultValues?.meta || null}
98
101
  defaultAttachments={defaultValues?.attachments || []}
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable prefer-destructuring */
2
2
  /* eslint-disable react-hooks/exhaustive-deps */
3
3
  import { DateTime } from 'luxon'
4
- import { useEffect, useReducer, useState } from 'react'
4
+ import { useEffect, useReducer } from 'react'
5
5
  import RRule, { Frequency, Weekday } from 'rrule'
6
6
  import RecurrenceEndInput, { defaultOccurrences } from './RecurrenceEndInput'
7
7
  import RecurrenceIntervalAndFrequencyInput from './RecurrenceIntervalAndFrequencyInput'
@@ -37,7 +37,7 @@ export function RecurrenceInput({
37
37
 
38
38
  useEffect(
39
39
  // TODO: unhardcode timezone
40
- () =>
40
+ () => {
41
41
  onChange(
42
42
  RRule.optionsToString({
43
43
  freq: state.freq,
@@ -47,7 +47,8 @@ export function RecurrenceInput({
47
47
  tzid: 'Europe/London',
48
48
  ...state,
49
49
  }).replace('RRULE:', ''),
50
- ),
50
+ )
51
+ },
51
52
  [state],
52
53
  )
53
54
 
@@ -16,11 +16,8 @@ export const Profile = ({ user }: ProfileProps) => {
16
16
  return null
17
17
  }
18
18
 
19
- const {
20
- firstName,
21
- lastName,
22
- userDetail: { gender },
23
- } = user
19
+ const { firstName, lastName, userDetail } = user
20
+ const gender = userDetail?.gender
24
21
 
25
22
  return (
26
23
  <div className='profile'>
@@ -25,6 +25,7 @@ export function PaymentsModal({
25
25
 
26
26
  return (
27
27
  <Modal show={isVisible} onHide={onHide} centered>
28
+ {/* @ts-ignore */}
28
29
  <Modal.Header closeButton>
29
30
  <Modal.Title>{t('Design:setEmail')}</Modal.Title>
30
31
  </Modal.Header>
@@ -1,6 +1,5 @@
1
1
  import { useContext, useState } from 'react'
2
2
  import { useTranslation } from 'react-i18next'
3
- import { MemoryRouter } from 'react-router-dom'
4
3
  import { Button } from 'react-bootstrap'
5
4
  import {
6
5
  SNIPPET_TEMPLATE_TYPE_VENUE_MAP,
@@ -79,14 +78,12 @@ export function Preview({
79
78
  <div className='mt-5 pt-5 external-header'>
80
79
  <PageHeader showCloseButton showBackButton>
81
80
  <Timer timer={600} />
82
- <MemoryRouter initialEntries={['/step1', '/step2']}>
83
- <NavigationSteps
84
- steps={[
85
- { pathname: '/step1', key: '/step1', name: 'Burger' },
86
- { pathname: '/step2', key: '/step2', name: 'Cheese' },
87
- ]}
88
- />
89
- </MemoryRouter>
81
+ <NavigationSteps
82
+ steps={[
83
+ { pathname: '/step1', key: '/step1', name: 'Burger' },
84
+ { pathname: '/step2', key: '/step2', name: 'Cheese' },
85
+ ]}
86
+ />
90
87
  </PageHeader>
91
88
  </div>
92
89
  </div>