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

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 (108) 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 +0 -1
  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 +0 -2
  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 +2 -1
  20. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts +2 -1
  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 +2 -1
  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 +2 -1
  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 +5 -13
  28. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
  29. package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
  30. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
  31. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.js +1 -1
  32. package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.d.ts.map +1 -1
  33. package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
  34. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts.map +1 -1
  35. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +2 -2
  36. package/dist/iframe/ryft/RyftPaymentForm.js +0 -1
  37. package/dist/index.js +0 -1
  38. package/dist/notification/email-template/card/EmailTemplateCard.d.ts.map +1 -1
  39. package/dist/notification/sms-template/card/SmsTemplateCard.d.ts.map +1 -1
  40. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  41. package/dist/product-set/control/DateInput.d.ts.map +1 -1
  42. package/dist/product-set/form/VenueMapsControl.d.ts +1 -1
  43. package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
  44. package/dist/report/ReportRunnerModal/ReportRunnerModal.js +0 -1
  45. package/dist/sales/life-time-sales/LifeTimeSalesChart.js +0 -1
  46. package/dist/sales/manual-booking/select-event/SelectEvent.js +0 -1
  47. package/dist/sales/manual-booking/select-menu/SelectMenu.js +0 -1
  48. package/dist/sales/manual-booking/summary/ManualBookingSummary.js +0 -1
  49. package/dist/sales/modals/refund-modal/RefundModal.d.ts.map +1 -1
  50. package/dist/sales/modals/refund-modal/RefundModal.js +0 -1
  51. package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
  52. package/dist/setting/dashboard/snippet-templates/card/SnippetTemplateCard.d.ts.map +1 -1
  53. package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
  54. package/dist/snippet/snippet-template/preview/Preview.js +7 -3
  55. package/dist/static/date-range-input/utils/index.d.ts +1 -1
  56. package/dist/static/date-range-input/utils/index.d.ts.map +1 -1
  57. package/dist/static/loader/LoaderIndicator.d.ts +3 -2
  58. package/dist/static/loader/LoaderIndicator.d.ts.map +1 -1
  59. package/dist/static/loader/LoaderIndicator.js +2 -4
  60. package/dist/static/loader/index.d.ts +0 -1
  61. package/dist/static/loader/index.d.ts.map +1 -1
  62. package/dist/styles/availability-indicator/AvailabilityIndicator.scss +3 -0
  63. package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +1 -1
  64. package/dist/styles/static/Loader.scss +0 -9
  65. package/package.json +1 -1
  66. package/src/auth/Layout/AuthNavComponent.tsx +0 -4
  67. package/src/auth/Login/LoginComponent.tsx +0 -2
  68. package/src/auth/Login/LoginFormComponent.tsx +0 -2
  69. package/src/auth/Register/RegisterComponent.tsx +0 -2
  70. package/src/auth/Register/RegisterFormComponent.tsx +0 -4
  71. package/src/auth/ResetPassword/ResetPasswordFormComponent.tsx +0 -4
  72. package/src/auth/Router.tsx +0 -2
  73. package/src/calendar/Calendar.stories.tsx +2 -2
  74. package/src/calendar/utils/index.ts +1 -1
  75. package/src/events/edit-event-modal/component/SaleDeadline/SaleDeadline.tsx +7 -9
  76. package/src/events/event-card/utils.ts +9 -10
  77. package/src/events/event-statistic-modal/EventStatisticModal.tsx +1 -1
  78. package/src/events/event-statistic-modal/hooks/useTableData.tsx +4 -3
  79. package/src/events/event-statistic-modal/utils/index.ts +1 -2
  80. package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +2 -0
  81. package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +6 -1
  82. package/src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx +3 -0
  83. package/src/iframe/order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.tsx +10 -16
  84. package/src/iframe/order-process/components/BookingSummary/utils/index.ts +7 -11
  85. package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +7 -4
  86. package/src/iframe/page/components/PageBody/hooks/useResizePageBody.ts +2 -1
  87. package/src/iframe/payment/payment-page/PaymentPage.tsx +2 -4
  88. package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +20 -19
  89. package/src/notification/email-template/card/EmailTemplateCard.tsx +0 -2
  90. package/src/notification/sms-template/card/SmsTemplateCard.tsx +0 -2
  91. package/src/product-set/control/DateAndRecurrenceInput.tsx +4 -3
  92. package/src/product-set/control/DateInput.tsx +4 -3
  93. package/src/product-set/form/VenueMapsControl.tsx +1 -1
  94. package/src/sales/modals/refund-modal/RefundModal.tsx +0 -1
  95. package/src/setting/admin/AdminSettingForm.tsx +0 -4
  96. package/src/setting/dashboard/snippet-templates/card/SnippetTemplateCard.tsx +0 -2
  97. package/src/snippet/snippet-template/preview/Preview.tsx +8 -1
  98. package/src/static/date-range-input/utils/index.ts +1 -1
  99. package/src/static/loader/LoaderIndicator.tsx +3 -6
  100. package/src/static/loader/index.ts +0 -1
  101. package/src/styles/availability-indicator/AvailabilityIndicator.scss +3 -0
  102. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +1 -1
  103. package/src/styles/static/Loader.scss +0 -9
  104. package/yarn.lock +721 -785
  105. package/dist/static/loader/FullScreenLoader.d.ts +0 -8
  106. package/dist/static/loader/FullScreenLoader.d.ts.map +0 -1
  107. package/dist/static/loader/FullScreenLoader.js +0 -41
  108. package/src/static/loader/FullScreenLoader.tsx +0 -16
@@ -5,5 +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';
9
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/static/loader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/static/loader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA"}
@@ -6,6 +6,7 @@
6
6
  font-weight: 300;
7
7
  width: 100%;
8
8
 
9
+
9
10
  .indicator-label {
10
11
  text-overflow: ellipsis;
11
12
  white-space: nowrap;
@@ -24,6 +25,8 @@
24
25
  }
25
26
  }
26
27
 
28
+
29
+
27
30
  .activity-card {
28
31
  .availability-indicator {
29
32
  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,15 +27,6 @@
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
-
39
30
  .payment-loader {
40
31
  position: absolute;
41
32
  top: 50%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.71.6-dev.10",
3
+ "version": "0.71.6-dev.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -8,15 +8,11 @@ function AuthNavComponent() {
8
8
 
9
9
  return (
10
10
  <Router>
11
- {/* TODO fix issue react router types
12
- @ts-expect-error */}
13
11
  <Link to='/login'>
14
12
  <StyledButton size='sm' className='rounded-pill mr-2'>
15
13
  {t('login')}
16
14
  </StyledButton>
17
15
  </Link>
18
- {/* TODO fix issue react router types
19
- @ts-expect-error */}
20
16
  <Link to='/register'>
21
17
  <StyledButton
22
18
  size='sm'
@@ -112,8 +112,6 @@ const LoginComponent = ({
112
112
  {!hideSignUpLink && (
113
113
  <h6 className='text-center'>
114
114
  <Trans t={t} i18nKey='loginPromo'>
115
- {/* TODO fix issue react router types
116
- @ts-expect-error */}
117
115
  Don&apos;t have account? <Link to='/register'>Sign up</Link>.
118
116
  </Trans>
119
117
  </h6>
@@ -147,8 +147,6 @@ function LoginFormComponent(props: LoginFormComponentProps) {
147
147
  <p className='text-center mb-0 mt-3'>
148
148
  <Trans t={t} i18nKey='User:resetPromo'>
149
149
  Forgot your password?{' '}
150
- {/* TODO fix issue react router types
151
- @ts-expect-error */}
152
150
  <Link
153
151
  to='/forgot-password'
154
152
  className={[isLoading && 'disabled'].join(' ')}
@@ -105,8 +105,6 @@ function RegisterComponent({
105
105
  <h6 className='text-center'>
106
106
  <Trans t={t} i18nKey='registerPromo'>
107
107
  Fill out the form below to sign up for {{ name: t('bookedit') }}
108
- {/* TODO fix issue react router types
109
- @ts-expect-error */}
110
108
  . Already signed up? Then just <Link to='/login'>Log in</Link>.
111
109
  </Trans>
112
110
  </h6>
@@ -400,14 +400,10 @@ function RegisterFormComponent({
400
400
  <Trans t={t} i18nKey='User:agreementsPromo'>
401
401
  By creating an account, I agree to {{ name: t('User:bookedit') }}
402
402
  &apos;s{' '}
403
- {/* TODO fix issue react router types
404
- @ts-expect-error */}
405
403
  <Link to='/terms' className={[isLoading && 'disabled'].join(' ')}>
406
404
  terms of service
407
405
  </Link>{' '}
408
406
  and{' '}
409
- {/* TODO fix issue react router types
410
- @ts-expect-error */}
411
407
  <Link to='/privacy' className={[isLoading && 'disabled'].join(' ')}>
412
408
  privacy policy
413
409
  </Link>
@@ -97,8 +97,6 @@ function ResetPasswordFormComponent(props: ResetPasswordFormComponentProps) {
97
97
  <p className='text-center mb-0 mt-3'>
98
98
  <Trans t={t} i18nKey='User:signinPromo'>
99
99
  Already a user?{' '}
100
- {/* TODO fix issue react router types
101
- @ts-expect-error */}
102
100
  <Link to='/login' className={[isLoading && 'disabled'].join(' ')}>
103
101
  Sign in
104
102
  </Link>
@@ -108,8 +106,6 @@ function ResetPasswordFormComponent(props: ResetPasswordFormComponentProps) {
108
106
  <p className='text-center mb-0 mt-3'>
109
107
  <Trans t={t} i18nKey='User:loginPromo'>
110
108
  Don&apos;t have an account?{' '}
111
- {/* TODO fix issue react router types
112
- @ts-expect-error */}
113
109
  <Link
114
110
  to='/register'
115
111
  className={[isLoading && 'disabled'].join(' ')}
@@ -29,8 +29,6 @@ function Router(props: RouterProps) {
29
29
  }
30
30
  }, [])
31
31
 
32
- // TODO fix issue react router types
33
- // @ts-expect-error
34
32
  return <BrowserRouter history={history}>{children}</BrowserRouter>
35
33
  }
36
34
 
@@ -28,7 +28,7 @@ Default.args = {
28
28
  fromPrice: 'from £10',
29
29
  selectedDate: null,
30
30
  setSelectedDate: () => null,
31
- calendarDates: getMonthCalendarDates({ initialDate: now }),
31
+ calendarDates: getMonthCalendarDates(now),
32
32
  currentDate: now,
33
33
  getDateTimeButtonProps: () => ({
34
34
  resources: [],
@@ -50,7 +50,7 @@ Loading.args = {
50
50
  fromPrice: 'from £10',
51
51
  selectedDate: null,
52
52
  setSelectedDate: () => null,
53
- calendarDates: getMonthCalendarDates({ initialDate: now }),
53
+ calendarDates: getMonthCalendarDates(now),
54
54
  currentDate: now,
55
55
  getDateTimeButtonProps: () => ({
56
56
  resources: [],
@@ -3,7 +3,7 @@ import { DateTime, Interval } from 'luxon'
3
3
 
4
4
  type Builder = (args: {
5
5
  initialDate?: DateTime
6
- timeZone?: TimeZone['name']
6
+ timeZone: TimeZone['name']
7
7
  }) => DateTime[]
8
8
 
9
9
  export const getMonthCalendarDates: Builder = ({
@@ -28,13 +28,11 @@ export const DEADLINE_NAME = [
28
28
 
29
29
  export type DeadLineNameType = (typeof DEADLINE_NAME)[number]
30
30
 
31
- type SaleDeadlineType =
32
- | {
33
- saleDeadline: null | number
34
- }
35
- | {
36
- [key: string]: null | number
37
- }
31
+ type SaleDeadlineType = {
32
+ saleDeadline: null | number
33
+ } | {
34
+ [key: string] : null | number
35
+ }
38
36
 
39
37
  export const SaleDeadline = ({
40
38
  disabled = false,
@@ -54,8 +52,8 @@ export const SaleDeadline = ({
54
52
  const [deadlineType, setDeadlineType] = useState<DeadlineType>(
55
53
  SALE_DEADLINE_BEFORE_TYPE,
56
54
  )
57
-
58
- const saleDeadline = watch(deadLineCategory || SALE_DEADLINE_NAME)
55
+
56
+ const saleDeadline = watch(deadLineCategory || SALE_DEADLINE_NAME)
59
57
 
60
58
  useEffect(() => {
61
59
  if (onlyBefore) return
@@ -2,25 +2,24 @@ import { DATE_FORMAT, DATE_TIME_FULL_FORMAT } from '@licklist/core/dist/Config'
2
2
  import { EventStatistic } from '@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper'
3
3
  import { DateTime } from 'luxon'
4
4
 
5
- export const MIN_EVENT_DESCRIPTION_SIZE = 150
6
- export const EVENT_DESCRIPTION_SIZE = 350
7
- export const EMOJI_REGEX =
8
- /<span data-emoji-replacer=""><img[^>]*alt="([^"]+)"[^>]*><\/span>/g
5
+ export const MIN_EVENT_DESCRIPTION_SIZE = 150;
6
+ export const EVENT_DESCRIPTION_SIZE = 350;
7
+ export const EMOJI_REGEX = /<span data-emoji-replacer=""><img[^>]*alt="([^"]+)"[^>]*><\/span>/g;
9
8
 
10
9
  export const formatContent = (content, maxLength = EVENT_DESCRIPTION_SIZE) => {
11
- if (!content) return ''
10
+ if (!content) return '';
12
11
 
13
- const replacedContent = replaceEmojiImagesWithText(content)
12
+ const replacedContent = replaceEmojiImagesWithText(content);
14
13
 
15
14
  if (replacedContent.length <= maxLength) {
16
- return replacedContent
15
+ return replacedContent;
17
16
  }
18
17
 
19
- return replacedContent.slice(0, maxLength).concat('...')
20
- }
18
+ return replacedContent.slice(0, maxLength).concat('...');
19
+ };
21
20
 
22
21
  function replaceEmojiImagesWithText(text) {
23
- return text.replace(EMOJI_REGEX, (_, emojiText) => emojiText)
22
+ return text.replace(EMOJI_REGEX, (_, emojiText) => emojiText);
24
23
  }
25
24
 
26
25
  /**
@@ -25,7 +25,7 @@ export const EventStatisticModal = ({
25
25
  }: EventStatisticModalProps) => {
26
26
  const { t } = useTranslation('Design')
27
27
 
28
- const data = useTableData(date, eventStatistic, eventId)
28
+ const data = useTableData(date, eventStatistic, eventId )
29
29
  const handleClose = () => {
30
30
  setIsOpen(false)
31
31
  }
@@ -11,7 +11,7 @@ import { StaticTableData } from '../../../table'
11
11
  export const useTableData = (
12
12
  date: Event['startAt'] | null,
13
13
  eventStatistic: EventStatistic | null,
14
- eventId: string,
14
+ eventId: string
15
15
  ) => {
16
16
  const { t } = useTranslation('Design')
17
17
  const { formatNumber } = useIntl()
@@ -34,6 +34,7 @@ export const useTableData = (
34
34
  const transformStatisticToTableRows = (
35
35
  date: Event['startAt'],
36
36
  statistic: EventStatistic | null,
37
+ eventId: string
37
38
  ) => {
38
39
  if (!statistic) {
39
40
  return []
@@ -41,7 +42,7 @@ export const useTableData = (
41
42
 
42
43
  const tableDataRows: StaticTableData[] = []
43
44
 
44
- convertEventStatisticToTableData(date, statistic).forEach(
45
+ convertEventStatisticToTableData(date, statistic, eventId).forEach(
45
46
  ({ name, quantity, total, isBold, isHeader, key }) => {
46
47
  const formattedTotal = !Object.keys(TRANSLATION_KEYS).includes(
47
48
  String(total),
@@ -83,7 +84,7 @@ export const useTableData = (
83
84
  }
84
85
 
85
86
  useEffect(() => {
86
- setTableRows(transformStatisticToTableRows(date, eventStatistic))
87
+ setTableRows(transformStatisticToTableRows(date, eventStatistic, eventId))
87
88
  // eslint-disable-next-line react-hooks/exhaustive-deps
88
89
  }, [date, eventId, eventStatistic])
89
90
 
@@ -100,8 +100,7 @@ export const convertEventStatisticToTableData = (
100
100
 
101
101
  const maxTotalQuantity = maxBy(overrides, 'id')?.totalQuantity
102
102
 
103
- const totalQuantity =
104
- maxTotalQuantity || productSummary?.totalQuantity
103
+ const totalQuantity = maxTotalQuantity || productSummary?.totalQuantity
105
104
 
106
105
  summaryMap.set(`${categoryName}.${productSummary.name}`, {
107
106
  name: productSummary.name,
@@ -21,6 +21,7 @@ export const BookingSummary = ({
21
21
  productsWithErrors = [],
22
22
  isLoading,
23
23
  hasPeopleInput,
24
+ isPaymentLink,
24
25
  peopleAmount,
25
26
  footer,
26
27
  headerComponent,
@@ -61,6 +62,7 @@ export const BookingSummary = ({
61
62
  <div className='products-by-menu-step'>
62
63
  {menuSteps.map((menuStep) => (
63
64
  <ProductsByMenuStep
65
+ isPaymentLink={isPaymentLink}
64
66
  key={menuStep.id}
65
67
  orderItems={formValues}
66
68
  step={menuStep}
@@ -7,17 +7,22 @@ type ProductSummaryProps = {
7
7
  name?: string
8
8
  productQuantityError?: string
9
9
  orderProduct: OrderItem
10
+ isPaymentLink?: boolean
10
11
  }
11
12
 
12
13
  export const ProductSummary = ({
13
14
  name,
14
15
  productQuantityError,
15
16
  orderProduct,
17
+ isPaymentLink,
16
18
  }: ProductSummaryProps) => {
17
19
  const { t } = useTranslation('Design')
18
20
  const { formatNumber } = useIntl()
19
21
 
20
- const priceForOneProduct = orderProduct?.price
22
+ const priceForOneProduct =
23
+ !isPaymentLink && orderProduct?.hasDeposit
24
+ ? orderProduct?.deposit
25
+ : orderProduct?.price
21
26
 
22
27
  const fullPrice = formatNumber(priceForOneProduct * orderProduct?.quantity, {
23
28
  style: 'currency',
@@ -28,12 +28,14 @@ export type ProductsByMenuStepsProps = {
28
28
  orderItems: OrderItems
29
29
  step: MenuStep
30
30
  productsWithErrors?: QuantityCheckProductInfo[]
31
+ isPaymentLink?: boolean
31
32
  }
32
33
 
33
34
  export const ProductsByMenuStep = ({
34
35
  orderItems,
35
36
  step,
36
37
  productsWithErrors = [],
38
+ isPaymentLink,
37
39
  }: ProductsByMenuStepsProps) => {
38
40
  const { productCategories } = step
39
41
 
@@ -61,6 +63,7 @@ export const ProductsByMenuStep = ({
61
63
 
62
64
  return (
63
65
  <ProductSummary
66
+ isPaymentLink={isPaymentLink}
64
67
  key={orderItem.id}
65
68
  name={orderItem.name}
66
69
  productQuantityError={productQuantityError}
@@ -22,23 +22,24 @@ export const SummaryTotal = ({
22
22
 
23
23
  const cartSum = isFreePayment
24
24
  ? 0
25
- : cartSumByOrderProducts({ orderProducts }) + transactionFee
25
+ : cartSumByOrderProducts({orderProducts}) + transactionFee
26
26
 
27
- const totalSum = isFreePayment
28
- ? 0
29
- : cartSumByOrderProducts({ orderProducts, isTotalSum: true }) +
30
- transactionFee
31
27
 
32
- const hasRemaingToPay = totalSum > cartSum
28
+ const totalSum = isFreePayment
29
+ ? 0
30
+ : cartSumByOrderProducts({orderProducts, isTotalSum: true}) +
31
+ transactionFee;
32
+
33
+ const hasRemaingToPay = totalSum > cartSum;
33
34
 
34
35
  if (!orderProducts.length) {
35
36
  return null
36
37
  }
37
38
 
38
39
  return (
39
- <div className='d-flex flex-column justify-content-between'>
40
+ <div className="d-flex flex-column justify-content-between">
40
41
  <SummaryTotalBlock
41
- label={t(hasRemaingToPay ? 'payNow' : 'total')}
42
+ label={t(hasRemaingToPay ? "payNow" : "total")}
42
43
  amount={cartSum}
43
44
  />
44
45
  {!!totalWithDiscount && !isFreePayment && (
@@ -48,14 +49,7 @@ export const SummaryTotal = ({
48
49
  />
49
50
  )}
50
51
  {hasRemaingToPay && (
51
- <>
52
- <SummaryTotalBlock
53
- label={t('remaining')}
54
- amount={totalSum - cartSum}
55
- />
56
-
57
- <SummaryTotalBlock label={t('total')} amount={totalSum} />
58
- </>
52
+ <SummaryTotalBlock label={t("remaining")} amount={totalSum - cartSum} />
59
53
  )}
60
54
  </div>
61
55
  )
@@ -5,24 +5,20 @@ export const cartSumByOrderProducts = ({
5
5
  orderProducts,
6
6
  isTotalSum,
7
7
  }: {
8
- orderProducts?: OrderItem[]
9
- isTotalSum?: boolean
8
+ orderProducts?: OrderItem[];
9
+ isTotalSum?: boolean;
10
10
  }) => {
11
11
  if (!orderProducts || !orderProducts.length) {
12
12
  return 0
13
13
  }
14
14
  return orderProducts.reduce((prevSumValue: number, product) => {
15
- if (!product) return 0
16
-
15
+ if (!product) return 0;
17
16
  const price = isTotalSum
18
17
  ? product?.price
19
- : product.hasDeposit
20
- ? product?.deposit
21
- : product?.price
22
-
23
- return prevSumValue + price * product.quantity
24
- }, 0)
25
- }
18
+ : product?.deposit || product?.price;
19
+ return prevSumValue + price * product.quantity;
20
+ }, 0);
21
+ };
26
22
 
27
23
  export const getProductError = (
28
24
  productsWithErrors: QuantityCheckProductInfo[],
@@ -132,10 +132,13 @@ export const CategoryProduct = ({
132
132
  </div>
133
133
  <div className='iframe-event__product-price-wrapper'>
134
134
  <span className='product-price'>
135
- {formatNumber(product.price, {
136
- style: 'currency',
137
- currency: Config.Currency.GBP,
138
- })}
135
+ {formatNumber(
136
+ category.allowDeposits ? product?.deposit : product.price,
137
+ {
138
+ style: 'currency',
139
+ currency: Config.Currency.GBP,
140
+ },
141
+ )}
139
142
  </span>
140
143
  <ProductQuantityInput
141
144
  onChange={onChange}
@@ -69,7 +69,8 @@ export const useResizePageBody = () => {
69
69
  rightBlockHeight -
70
70
  CALENDAR_WRAPPER_HEIGHT,
71
71
  }
72
- }
72
+
73
+ }
73
74
  return {
74
75
  maxHeight:
75
76
  height -
@@ -126,10 +126,8 @@ export const PaymentPage = ({
126
126
  const isCalculatedAmountGreaterThanOrderAmount =
127
127
  !hasRemaingToPay && orderCartAmountByFormValues > data?.amount
128
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)
129
+ const isPaymentLinkWithRemainingToPay = data?.remaining_to_pay && !!Number(data?.remaining_to_pay)
130
+ const totalPaidWithRemainingToPay = data?.amount_to_pay && !!Number(data?.amount_to_pay)
133
131
 
134
132
  return (
135
133
  <Page className='payment_link'>
@@ -59,19 +59,20 @@ export const PaymentStatusPage = ({
59
59
 
60
60
  if (isLoading) return <LoaderIndicator isLoaded={false} />
61
61
 
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
62
+
63
+ const orderCartAmountByFormValues = cartSumByOrderProducts({
64
+ orderProducts:
65
+ bookingSummaryProps?.formValues &&
66
+ Object.values(bookingSummaryProps?.formValues),
67
+ });
68
+ const orderTotalAmountByFormValues = cartSumByOrderProducts({
69
+ orderProducts:
70
+ bookingSummaryProps?.formValues &&
71
+ Object.values(bookingSummaryProps?.formValues),
72
+ isTotalSum: true,
73
+ });
74
+ const hasRemaingToPay =
75
+ orderTotalAmountByFormValues > orderCartAmountByFormValues;
75
76
 
76
77
  // User can fill promocode only in iframe appcliation.
77
78
  // It didn't possible via payment link. This check will
@@ -80,9 +81,9 @@ export const PaymentStatusPage = ({
80
81
  // For payment status page booking summary props can be empty
81
82
  // so we should also check for them
82
83
  const isCalculatedAmountGreaterThanOrderAmount =
83
- !hasRemaingToPay &&
84
- bookingSummaryProps &&
85
- orderCartAmountByFormValues > totalAmount
84
+ !hasRemaingToPay &&
85
+ bookingSummaryProps &&
86
+ orderCartAmountByFormValues > totalAmount;
86
87
 
87
88
  return (
88
89
  <Page
@@ -139,7 +140,7 @@ export const PaymentStatusPage = ({
139
140
  <>
140
141
  {isCalculatedAmountGreaterThanOrderAmount && (
141
142
  <SummaryTotalBlock
142
- label={t(hasRemaingToPay ? 'payNow' : 'total')}
143
+ label={t(hasRemaingToPay ? "payNow" : "total")}
143
144
  amount={
144
145
  orderCartAmountByFormValues +
145
146
  (bookingSummaryProps?.transactionFee || 0)
@@ -158,9 +159,9 @@ export const PaymentStatusPage = ({
158
159
  (bookingSummaryProps?.transactionFee || 0)
159
160
  }
160
161
  />
161
- {hasRemaingToPay && (
162
+ {hasRemaingToPay && (
162
163
  <SummaryTotalBlock
163
- label={t('remaining')}
164
+ label={t("remaining")}
164
165
  amount={
165
166
  orderTotalAmountByFormValues -
166
167
  orderCartAmountByFormValues
@@ -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
@@ -33,8 +33,6 @@ 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 */}
38
36
  <Link to={href}>{name}</Link>
39
37
  {hasPermission && Boolean(onRemove) && (
40
38
  <ConfirmModal
@@ -198,8 +198,7 @@ export const DateAndRecurrenceInput = ({
198
198
  move(prevIndex, nextIndex)
199
199
  }
200
200
 
201
- const errorMessage =
202
- errors.menuRecurrences?.message || errors.menuRecurrences?.root?.message
201
+ const errorMessage = errors.menuRecurrences?.message || errors.menuRecurrences?.root?.message
203
202
 
204
203
  useEffect(() => {
205
204
  if (fields.length) {
@@ -309,7 +308,9 @@ export const DateAndRecurrenceInput = ({
309
308
  })}
310
309
  />
311
310
 
312
- <div className='manual-form-error'>{errorMessage}</div>
311
+ <div className='manual-form-error'>
312
+ {errorMessage}
313
+ </div>
313
314
  </div>
314
315
  </OverlayTrigger>
315
316
  </Form.Group>
@@ -195,8 +195,7 @@ export const DateInput = ({
195
195
  }, 100)
196
196
  }
197
197
 
198
- const errorMessage =
199
- errors.menuRecurrences?.message || errors.menuRecurrences?.root?.message
198
+ const errorMessage = errors.menuRecurrences?.message || errors.menuRecurrences?.root?.message
200
199
 
201
200
  return (
202
201
  <Form.Group>
@@ -285,7 +284,9 @@ export const DateInput = ({
285
284
  })}
286
285
  />
287
286
 
288
- <div className='manual-form-error'>{errorMessage}</div>
287
+ <div className='manual-form-error'>
288
+ {errorMessage}
289
+ </div>
289
290
  </div>
290
291
  </OverlayTrigger>
291
292
  </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'
7
6
  import { FullscreenModal } from '../../modals/fullscreen'
8
7
  import { EventVenueMap } from '../../events/event-venue-map'
8
+ import { Product } from '../types'
9
9
 
10
10
  type VenueMapsControlProps = {
11
11
  venueMaps?: VenueMap[]
@@ -110,7 +110,6 @@ export const RefundModal = ({
110
110
  }) as string
111
111
  },
112
112
  })}
113
- step={0.01}
114
113
  disabled={isLoading || isFullRefund}
115
114
  isInvalid={!!errors.amount}
116
115
  min={0}