@eventlook/sdk 1.4.28 → 1.4.38

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 (85) hide show
  1. package/.env +1 -0
  2. package/dist/cjs/context/GlobalContext.js +1 -2
  3. package/dist/cjs/context/GlobalContext.js.map +1 -1
  4. package/dist/cjs/form/PaymentOverviewBox.js +31 -1
  5. package/dist/cjs/form/PaymentOverviewBox.js.map +1 -1
  6. package/dist/cjs/form/TicketForm.js +9 -5
  7. package/dist/cjs/form/TicketForm.js.map +1 -1
  8. package/dist/cjs/form/TicketSelection.js.map +1 -1
  9. package/dist/cjs/form/index.js +2 -2
  10. package/dist/cjs/form/index.js.map +1 -1
  11. package/dist/cjs/form/payment/PaymentOverviewCheckbox.js +48 -0
  12. package/dist/cjs/form/payment/PaymentOverviewCheckbox.js.map +1 -0
  13. package/dist/cjs/locales/cs.js +19 -1
  14. package/dist/cjs/locales/cs.js.map +1 -1
  15. package/dist/cjs/locales/en.js +12 -1
  16. package/dist/cjs/locales/en.js.map +1 -1
  17. package/dist/cjs/locales/es.js +12 -1
  18. package/dist/cjs/locales/es.js.map +1 -1
  19. package/dist/cjs/locales/pl.js +12 -1
  20. package/dist/cjs/locales/pl.js.map +1 -1
  21. package/dist/cjs/locales/sk.js +12 -1
  22. package/dist/cjs/locales/sk.js.map +1 -1
  23. package/dist/cjs/locales/uk.js +12 -1
  24. package/dist/cjs/locales/uk.js.map +1 -1
  25. package/dist/esm/context/GlobalContext.js +1 -2
  26. package/dist/esm/context/GlobalContext.js.map +1 -1
  27. package/dist/esm/form/PaymentOverviewBox.js +31 -1
  28. package/dist/esm/form/PaymentOverviewBox.js.map +1 -1
  29. package/dist/esm/form/TicketForm.js +9 -5
  30. package/dist/esm/form/TicketForm.js.map +1 -1
  31. package/dist/esm/form/TicketSelection.js.map +1 -1
  32. package/dist/esm/form/index.js +2 -2
  33. package/dist/esm/form/index.js.map +1 -1
  34. package/dist/esm/form/payment/PaymentOverviewCheckbox.js +44 -0
  35. package/dist/esm/form/payment/PaymentOverviewCheckbox.js.map +1 -0
  36. package/dist/esm/locales/cs.js +19 -1
  37. package/dist/esm/locales/cs.js.map +1 -1
  38. package/dist/esm/locales/en.js +12 -1
  39. package/dist/esm/locales/en.js.map +1 -1
  40. package/dist/esm/locales/es.js +12 -1
  41. package/dist/esm/locales/es.js.map +1 -1
  42. package/dist/esm/locales/pl.js +12 -1
  43. package/dist/esm/locales/pl.js.map +1 -1
  44. package/dist/esm/locales/sk.js +12 -1
  45. package/dist/esm/locales/sk.js.map +1 -1
  46. package/dist/esm/locales/uk.js +12 -1
  47. package/dist/esm/locales/uk.js.map +1 -1
  48. package/dist/types/context/GlobalContext.d.ts +1 -2
  49. package/dist/types/form/index.d.ts +0 -1
  50. package/dist/types/form/payment/PaymentOverviewCheckbox.d.ts +12 -0
  51. package/dist/types/locales/cs.d.ts +19 -1
  52. package/dist/types/locales/en.d.ts +12 -1
  53. package/dist/types/locales/es.d.ts +12 -1
  54. package/dist/types/locales/pl.d.ts +12 -1
  55. package/dist/types/locales/sk.d.ts +12 -1
  56. package/dist/types/locales/uk.d.ts +12 -1
  57. package/dist/types/utils/types/event.type.d.ts +0 -1
  58. package/dist/types/utils/types/global.type.d.ts +0 -1
  59. package/dist/types/utils/types/shopping-cart.type.d.ts +7 -0
  60. package/dist/types/utils/types/ticket.type.d.ts +8 -17
  61. package/package.json +3 -8
  62. package/rollup.config.mjs +1 -15
  63. package/src/context/GlobalContext.tsx +0 -3
  64. package/src/form/PaymentOverviewBox.tsx +83 -0
  65. package/src/form/TicketForm.tsx +9 -9
  66. package/src/form/TicketSelection.tsx +0 -1
  67. package/src/form/index.tsx +0 -3
  68. package/src/form/payment/PaymentOverviewCheckbox.tsx +87 -0
  69. package/src/locales/cs.tsx +22 -1
  70. package/src/locales/en.tsx +14 -1
  71. package/src/locales/es.tsx +14 -1
  72. package/src/locales/pl.tsx +14 -1
  73. package/src/locales/sk.tsx +14 -1
  74. package/src/locales/uk.tsx +14 -1
  75. package/src/utils/types/event.type.ts +0 -1
  76. package/src/utils/types/global.type.ts +0 -1
  77. package/src/utils/types/shopping-cart.type.ts +7 -0
  78. package/src/utils/types/ticket.type.ts +6 -20
  79. package/dev-frontend.sh +0 -32
  80. package/dist/cjs/form/TicketSelectionMap.js +0 -67
  81. package/dist/cjs/form/TicketSelectionMap.js.map +0 -1
  82. package/dist/esm/form/TicketSelectionMap.js +0 -63
  83. package/dist/esm/form/TicketSelectionMap.js.map +0 -1
  84. package/dist/types/form/TicketSelectionMap.d.ts +0 -7
  85. package/src/form/TicketSelectionMap.tsx +0 -83
@@ -50,7 +50,6 @@ export interface IEvent extends IBase {
50
50
  type: EventType;
51
51
  parents: IEvent[];
52
52
  children: IEvent[];
53
- mapId: string | null;
54
53
  }
55
54
  export interface IEventCategory extends IBase {
56
55
  translation: {
@@ -16,7 +16,6 @@ export interface IGlobalContext {
16
16
  options?: IGlobalContextOptions;
17
17
  user?: IUser;
18
18
  content?: IContent;
19
- seatingIframeUrl?: string;
20
19
  }
21
20
  export interface IGlobalContextCallbacks {
22
21
  homepage: () => void;
@@ -28,6 +28,8 @@ export interface ICalculateShoppingCartDto {
28
28
  gender: string | null;
29
29
  paymentMethodOptionId: number | null;
30
30
  paymentMethodId: number | null;
31
+ ticketInsurance?: boolean;
32
+ smsNotification?: boolean;
31
33
  }
32
34
  export interface IShoppingCart {
33
35
  uuid: string;
@@ -66,4 +68,9 @@ export interface IShoppingCart {
66
68
  orderFeeValue: number | null;
67
69
  orderFeeType: OrderFeeType | null;
68
70
  shippingFee: number;
71
+ ticketInsurance?: boolean;
72
+ ticketInsurancePrice?: number;
73
+ ticketInsurancePricePerUnit?: number;
74
+ smsNotification?: boolean;
75
+ smsNotificationPrice?: number;
69
76
  }
@@ -31,26 +31,13 @@ export interface ITicketFormTicket {
31
31
  products: IEventProductForm[];
32
32
  extraFields: IExtraFieldForm[][];
33
33
  eventTimeslotId?: number | null;
34
- location?: ITicketLocation | null;
35
34
  }
36
- export interface ITicketLocation {
37
- id: string;
38
- type: LocationType;
39
- locationDescription?: {
40
- type: BaseLocationDescriptionType | 'custom';
41
- label: string;
42
- value: string;
43
- }[] | null;
44
- }
45
- type BaseLocationDescriptionType = 'seatNumber' | 'rowNumber' | 'sectionName';
46
- type LocationType = 'seat' | 'zone';
47
- export type EventTicketsType = {
48
- [eventId: string]: ITicketFormTicket[];
49
- };
50
35
  export interface ITicketForm {
51
36
  uuid?: string | null;
52
37
  eventId: number;
53
- tickets: EventTicketsType;
38
+ tickets: {
39
+ [eventId: string]: ITicketFormTicket[];
40
+ };
54
41
  total: number;
55
42
  originalPrice: number;
56
43
  firstName: string;
@@ -63,6 +50,11 @@ export interface ITicketForm {
63
50
  paymentMethodId: number | null;
64
51
  paymentMethodOptionId: number | null;
65
52
  termsAndConditions: boolean;
53
+ ticketInsurance: boolean;
54
+ ticketInsurancePrice: number;
55
+ ticketInsurancePricePerUnit: number;
56
+ smsNotification: boolean;
57
+ smsNotificationPrice: number;
66
58
  iframeCampaignId?: number;
67
59
  promoCode: IPromoCode | null;
68
60
  products: {
@@ -105,4 +97,3 @@ export interface ICreateTicket {
105
97
  price: number;
106
98
  number: string;
107
99
  }
108
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eventlook/sdk",
3
- "version": "1.4.28",
3
+ "version": "1.4.38",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -15,13 +15,9 @@
15
15
  "scripts": {
16
16
  "build": "rollup -c && tsc -p tsconfig.build.json",
17
17
  "prepare": "yarn run build",
18
- "push": "yalc push --force",
19
- "push:initial": "yarn build && yalc push --force",
20
18
  "watch:rollup": "rollup -c -w",
21
- "watch:types": "tsc -p tsconfig.build.json --watch",
22
- "watch:push": "chokidar 'dist/**/*' -c 'yalc push --changed --force'",
23
- "dev": "concurrently --kill-others-on-fail --kill-others \"yarn watch:rollup\" \"yarn watch:types\" \"yarn watch:push\"",
24
- "dev:simple": "concurrently --kill-others-on-fail \"yarn watch:rollup\" \"yarn watch:types\"",
19
+ "watch:push": "chokidar 'dist/**/*' -c 'yalc push --changed'",
20
+ "dev": "concurrently \"yarn watch:rollup\" \"yarn watch:push\"",
25
21
  "publish": "npm publish",
26
22
  "lint:fix": "eslint --fix --ext .ts,.tsx .",
27
23
  "prettier": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'",
@@ -65,7 +61,6 @@
65
61
  "@rollup/plugin-node-resolve": "^15.0.0",
66
62
  "@rollup/plugin-replace": "^6.0.2",
67
63
  "@rollup/plugin-typescript": "^11.0.0",
68
- "@seat-picker/seat-picker-sdk": "^1.1.0",
69
64
  "@types/js-cookie": "^3.0.6",
70
65
  "@types/lodash": "^4.17.20",
71
66
  "@types/numeral": "^2.0.5",
package/rollup.config.mjs CHANGED
@@ -52,19 +52,5 @@ export default {
52
52
  },
53
53
  }),
54
54
  ],
55
- external: [
56
- 'react',
57
- 'react-dom',
58
- 'fs',
59
- 'path',
60
- 'http',
61
- 'https',
62
- 'stream',
63
- 'swr',
64
- 'mui-tel-input',
65
- '@seat-picker/seat-picker-sdk',
66
- '@mui/material',
67
- '@emotion/react',
68
- '@emotion/styled',
69
- ],
55
+ external: ['react', 'react-dom', 'fs', 'path', 'http', 'https', 'stream', 'swr', 'mui-tel-input'],
70
56
  };
@@ -30,7 +30,6 @@ type Props = {
30
30
  showSnackbar?: IGlobalContext['showSnackbar'];
31
31
  options?: IGlobalContext['options'];
32
32
  content?: IGlobalContext['content'];
33
- seatingIframeUrl?: IGlobalContext['seatingIframeUrl'];
34
33
  };
35
34
 
36
35
  function GlobalProvider({
@@ -41,7 +40,6 @@ function GlobalProvider({
41
40
  links,
42
41
  options,
43
42
  content,
44
- seatingIframeUrl,
45
43
  }: Props) {
46
44
  const [global, setGlobal] = useState<IGlobalContext>({
47
45
  ...initialState,
@@ -51,7 +49,6 @@ function GlobalProvider({
51
49
  links,
52
50
  options,
53
51
  content,
54
- seatingIframeUrl,
55
52
  });
56
53
 
57
54
  const handleSetGlobal = (value: Partial<IGlobalContext>) => {
@@ -1,6 +1,7 @@
1
1
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
2
  import { Iconify, Image, TextIconLabel } from '@components';
3
3
  import { Box, Divider, Grid, IconButton, Stack, Typography } from '@mui/material';
4
+ import PaymentOverviewCheckbox from '@form/payment/PaymentOverviewCheckbox.tsx';
4
5
  import locationIcon from '@iconify/icons-carbon/location';
5
6
  import { getPlaceAsString } from '@utils/place';
6
7
  import { LoadingButton } from '@mui/lab';
@@ -57,6 +58,10 @@ const PaymentOverviewBox: React.FC<Props> = ({ event }) => {
57
58
  shipping,
58
59
  totalFee,
59
60
  isPaymentVerify,
61
+ ticketInsurance,
62
+ ticketInsurancePricePerUnit,
63
+ smsNotification,
64
+ smsNotificationPrice,
60
65
  } = values;
61
66
  const tickets: Record<string, ITicketFormTicket[]> = useWatch({
62
67
  name: 'tickets',
@@ -181,6 +186,8 @@ const PaymentOverviewBox: React.FC<Props> = ({ event }) => {
181
186
  gender,
182
187
  paymentMethodId: paymentMethodId === null ? null : Number(paymentMethodId),
183
188
  paymentMethodOptionId: paymentMethodOptionId === null ? null : Number(paymentMethodOptionId),
189
+ ticketInsurance,
190
+ smsNotification,
184
191
  }),
185
192
  [
186
193
  uuid,
@@ -201,6 +208,8 @@ const PaymentOverviewBox: React.FC<Props> = ({ event }) => {
201
208
  paymentMethodId,
202
209
  paymentMethodOptionId,
203
210
  eventTimeslotId,
211
+ ticketInsurance,
212
+ smsNotification,
204
213
  ]
205
214
  );
206
215
 
@@ -250,6 +259,11 @@ const PaymentOverviewBox: React.FC<Props> = ({ event }) => {
250
259
  setValue('totalFee', feeTotal);
251
260
 
252
261
  setShippingFee(data.shippingFee);
262
+ setValue('ticketInsurance', data.ticketInsurance || false);
263
+ setValue('ticketInsurancePrice', data.ticketInsurancePrice || 0);
264
+ setValue('ticketInsurancePricePerUnit', data.ticketInsurancePricePerUnit || 0);
265
+ setValue('smsNotification', data.smsNotification || false);
266
+ setValue('smsNotificationPrice', data.smsNotificationPrice || 0);
253
267
  };
254
268
 
255
269
  const totalItemCount = useMemo(() => {
@@ -561,6 +575,22 @@ const PaymentOverviewBox: React.FC<Props> = ({ event }) => {
561
575
  </Typography>
562
576
  </Stack>
563
577
  )}
578
+ {ticketInsurance && totalItemCount.totalTickets > 0 && (
579
+ <Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}>
580
+ <Typography variant="caption">{t('form.labels.ticket_insurance')}</Typography>
581
+ <Typography variant="caption">
582
+ {fCurrency(values.ticketInsurancePrice, lang, event.currency)}
583
+ </Typography>
584
+ </Stack>
585
+ )}
586
+ {smsNotification && totalItemCount.totalTickets > 0 && (
587
+ <Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}>
588
+ <Typography variant="caption">{t('form.labels.sms_notification')}</Typography>
589
+ <Typography variant="caption">
590
+ {fCurrency(values.smsNotificationPrice, lang, event.currency)}
591
+ </Typography>
592
+ </Stack>
593
+ )}
564
594
  {!!total && !!totalFee && (
565
595
  <Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}>
566
596
  <Typography variant="caption">{t('form.labels.service_fee')}</Typography>
@@ -570,6 +600,59 @@ const PaymentOverviewBox: React.FC<Props> = ({ event }) => {
570
600
  {((!!selectedTickets.length && isMobile) || !isMobile) && (
571
601
  <Divider sx={{ borderStyle: 'dashed' }} />
572
602
  )}
603
+ {!!selectedTickets.length && (
604
+ <>
605
+ {/* TODO: Uncomment this when Colonnade response - must update terms and conditions and email info */}
606
+ {/*<PaymentOverviewCheckbox*/}
607
+ {/* checkboxName="ticketInsurance"*/}
608
+ {/* label={t('event.tickets.insurance.label')}*/}
609
+ {/* value={*/}
610
+ {/* <>*/}
611
+ {/* + {fCurrency(ticketInsurancePricePerUnit, lang, event.currency)} /{' '}*/}
612
+ {/* {t('event.tickets.insurance.per_ticket')}*/}
613
+ {/* </>*/}
614
+ {/* }*/}
615
+ {/* modal={{*/}
616
+ {/* title: t('event.tickets.insurance.label'),*/}
617
+ {/* description: (*/}
618
+ {/* <>*/}
619
+ {/* <Typography variant="body2" paragraph>*/}
620
+ {/* {t('event.tickets.insurance.modal.description')}*/}
621
+ {/* </Typography>*/}
622
+ {/* <Typography variant="body2" paragraph>*/}
623
+ {/* {t('event.tickets.insurance.modal.coverage')}*/}
624
+ {/* </Typography>*/}
625
+ {/* <Typography variant="body2" sx={{ fontWeight: 600 }}>*/}
626
+ {/* {t('event.tickets.insurance.modal.price')}:{' '}*/}
627
+ {/* {fCurrency(ticketInsurancePricePerUnit, lang, event.currency)} /{' '}*/}
628
+ {/* {t('event.tickets.insurance.per_ticket')}*/}
629
+ {/* </Typography>*/}
630
+ {/* </>*/}
631
+ {/* ),*/}
632
+ {/* }}*/}
633
+ {/*/>*/}
634
+ <PaymentOverviewCheckbox
635
+ checkboxName="smsNotification"
636
+ label={t('event.tickets.sms_notification.label')}
637
+ value={<>+ {fCurrency(smsNotificationPrice, lang, event.currency)}</>}
638
+ modal={{
639
+ title: t('event.tickets.sms_notification.label'),
640
+ description: (
641
+ <>
642
+ <Typography variant="body2" paragraph>
643
+ {t('event.tickets.sms_notification.modal.description')}
644
+ </Typography>
645
+ <Typography variant="body2" sx={{ fontWeight: 600 }}>
646
+ {t('event.tickets.sms_notification.modal.price')}:{' '}
647
+ {fCurrency(smsNotificationPrice, lang, event.currency)}
648
+ </Typography>
649
+ </>
650
+ ),
651
+ }}
652
+ />
653
+ <Divider sx={{ borderStyle: 'dashed' }} />
654
+ </>
655
+ )}
573
656
  <FeeBox event={event} />
574
657
  <LoadingButton type="submit" variant="contained" size="large" fullWidth>
575
658
  {t(isPaymentVerify ? 'verify' : 'buy')}
@@ -3,7 +3,6 @@ import PaymentSuccess from '@form/PaymentSuccess';
3
3
  import FormProvider, { RHFCheckbox } from '@components/hook-form';
4
4
  import {
5
5
  Box,
6
- Button,
7
6
  Grid,
8
7
  Link,
9
8
  LinkProps,
@@ -56,7 +55,6 @@ import useGlobal from '@hooks/useGlobal';
56
55
  import { Trans } from '@components/Trans';
57
56
  import { EVENTLOOK_ORDER_FORM_ID } from '@utils/data/global.ts';
58
57
  import ChildEventSection from './ChildEvents';
59
- import TicketSelectionMap from '@form/TicketSelectionMap.tsx';
60
58
 
61
59
  interface Props {
62
60
  event: IEvent;
@@ -73,8 +71,7 @@ const TicketForm: React.FC<Props> = ({
73
71
  isIframe,
74
72
  isInline,
75
73
  }) => {
76
- const { t, setGlobal, callbacks, links, user, options, showSnackbar, content, seatingIframeUrl } =
77
- useGlobal();
74
+ const { t, setGlobal, callbacks, links, user, options, showSnackbar, content } = useGlobal();
78
75
  const { transformErrors } = useErrors(t('event.tickets.error.order'));
79
76
  const { data: eventProducts, isLoading } = useActiveEventProducts(event.id);
80
77
  const [paymentRedirect, setPaymentRedirect] = useState<string | null>(null);
@@ -215,6 +212,11 @@ const TicketForm: React.FC<Props> = ({
215
212
  paymentMethodId: null,
216
213
  paymentMethodOptionId: null,
217
214
  termsAndConditions: false,
215
+ ticketInsurance: false,
216
+ ticketInsurancePrice: 0,
217
+ ticketInsurancePricePerUnit: 0,
218
+ smsNotification: false,
219
+ smsNotificationPrice: 0,
218
220
  iframeCampaignId: undefined,
219
221
  promoCode: null,
220
222
  promoCodes: [],
@@ -279,6 +281,8 @@ const TicketForm: React.FC<Props> = ({
279
281
  paymentMethodId: Yup.number().nullable().required(t('form.validation.required')),
280
282
  paymentMethodOptionId: Yup.number().nullable(),
281
283
  termsAndConditions: Yup.boolean().isTrue(t('form.validation.terms_and_conditions')),
284
+ ticketInsurance: Yup.boolean(),
285
+ smsNotification: Yup.boolean(),
282
286
  extraFields: Yup.array().of(
283
287
  Yup.object().shape({
284
288
  value: Yup.string().test('is-required', function (value) {
@@ -336,8 +340,6 @@ const TicketForm: React.FC<Props> = ({
336
340
  itemName: item.itemName,
337
341
  products: item.products,
338
342
  extraFields: item.extraFields,
339
- eventTimeslotId: item.eventTimeslotId,
340
- location: item.location,
341
343
  }));
342
344
  return acc;
343
345
  },
@@ -515,9 +517,7 @@ const TicketForm: React.FC<Props> = ({
515
517
  <Step active>
516
518
  <StepLabel>{t('event.tickets.stepper.1.title')}</StepLabel>
517
519
  <StepContent>
518
- {event.mapId && seatingIframeUrl ? (
519
- <TicketSelectionMap event={event} />
520
- ) : event.hasMerchandise ? (
520
+ {event.hasMerchandise ? (
521
521
  <TicketWithMerchandiseSelection event={event} />
522
522
  ) : (
523
523
  <TicketSelection event={event} />
@@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react';
2
2
  import { useFormContext, useWatch } from 'react-hook-form';
3
3
  import {
4
4
  Box,
5
- Button,
6
5
  Divider,
7
6
  Grid,
8
7
  IconButton,
@@ -27,7 +27,6 @@ import { csCZ, enUS, ukUA, esES, deDE, skSK } from '@mui/x-date-pickers/locales'
27
27
  export interface OrderFormProps {
28
28
  eventSlug: string;
29
29
  apiUrl: string;
30
- seatingIframeUrl?: string;
31
30
  callbacks: IGlobalContext['callbacks'];
32
31
  links: IGlobalContext['links'];
33
32
  lang?: Languages;
@@ -43,7 +42,6 @@ export interface OrderFormProps {
43
42
  const ClientRender: React.FC<OrderFormProps> = ({
44
43
  eventSlug,
45
44
  apiUrl,
46
- seatingIframeUrl,
47
45
  lang,
48
46
  slots,
49
47
  options,
@@ -102,7 +100,6 @@ const ClientRender: React.FC<OrderFormProps> = ({
102
100
  links={links}
103
101
  options={options}
104
102
  content={content}
105
- seatingIframeUrl={seatingIframeUrl}
106
103
  >
107
104
  {!data || !!error ? (
108
105
  <TicketFormSkeleton />
@@ -0,0 +1,87 @@
1
+ import React, { JSX, useState } from 'react';
2
+ import {
3
+ Dialog,
4
+ DialogContent,
5
+ DialogTitle,
6
+ IconButton,
7
+ Link,
8
+ Stack,
9
+ Typography,
10
+ } from '@mui/material';
11
+ import { RHFCheckbox } from '@components/hook-form';
12
+ import useGlobal from '@hooks/useGlobal.ts';
13
+ import { Iconify } from '@components';
14
+
15
+ interface Props {
16
+ checkboxName: string;
17
+ label: string;
18
+ value: string | JSX.Element;
19
+ modal: {
20
+ title: string;
21
+ description: string | JSX.Element;
22
+ };
23
+ }
24
+
25
+ const PaymentOverviewCheckbox: React.FC<Props> = ({ checkboxName, label, value, modal }) => {
26
+ const { t } = useGlobal();
27
+ const [open, setOpen] = useState(false);
28
+
29
+ const handleOpen = (e: React.MouseEvent<HTMLAnchorElement>) => {
30
+ e.preventDefault();
31
+ e.stopPropagation();
32
+ setOpen(true);
33
+ };
34
+ const handleClose = () => setOpen(false);
35
+
36
+ return (
37
+ <>
38
+ <RHFCheckbox
39
+ name={checkboxName}
40
+ label={
41
+ <Stack
42
+ direction="row"
43
+ justifyContent="space-between"
44
+ alignItems="center"
45
+ spacing={1}
46
+ sx={{ width: '100%' }}
47
+ >
48
+ <Typography variant="caption" sx={{ flex: 1 }}>
49
+ {label}
50
+ </Typography>
51
+ <Stack alignItems="flex-end">
52
+ <Typography variant="caption" fontWeight="600">
53
+ {value}
54
+ </Typography>
55
+ <Link variant="caption" onClick={handleOpen}>
56
+ {t('more_info')}
57
+ </Link>
58
+ </Stack>
59
+ </Stack>
60
+ }
61
+ sx={{
62
+ width: 'calc(100% + 11px)',
63
+ mb: 0.5,
64
+ '& > .MuiTypography-root': {
65
+ width: '100%',
66
+ },
67
+ }}
68
+ />
69
+
70
+ <Dialog open={open} onClose={handleClose} maxWidth="sm" fullWidth>
71
+ <DialogTitle
72
+ sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}
73
+ >
74
+ {modal.title}
75
+ <IconButton onClick={handleClose} size="small">
76
+ <Iconify icon="carbon:close" />
77
+ </IconButton>
78
+ </DialogTitle>
79
+ <DialogContent>
80
+ <Typography variant="body2">{modal.description}</Typography>
81
+ </DialogContent>
82
+ </Dialog>
83
+ </>
84
+ );
85
+ };
86
+
87
+ export default PaymentOverviewCheckbox;
@@ -15,6 +15,7 @@ const cs = {
15
15
  go_home: 'Přejít na úvodní stránku',
16
16
  apple_wallet: 'Stáhnout do Apple Wallet',
17
17
  google_wallet: 'Stáhnout do Google Wallet',
18
+ more_info: 'Více informací',
18
19
  shipping_method: {
19
20
  types: {
20
21
  PACKETA: 'Zásilkovna',
@@ -42,6 +43,7 @@ const cs = {
42
43
  with_fee: 'vč. servisního poplatku',
43
44
  service_fee: 'Servisní poplatek',
44
45
  shipping_fee: 'Doprava',
46
+ ticket_insurance: 'Pojištění vstupenek',
45
47
  price_including_service_fee: 'Cena zahrnuje servisní poplatek v hodnotě {{fee}}.',
46
48
  price_including_service_fee_percentage:
47
49
  'Cena zahrnuje servisní poplatek v výši {{percentage}} z celkové částky.',
@@ -49,7 +51,7 @@ const cs = {
49
51
  original_price: 'Původní cena',
50
52
  ticket: 'Vstupenka',
51
53
  category: 'Kategorie',
52
- open_map: 'Otevřít mapu',
54
+ sms_notification: 'SMS notifikace',
53
55
  },
54
56
  validation: {
55
57
  required: 'Toto pole je povinné.',
@@ -102,6 +104,25 @@ const cs = {
102
104
  },
103
105
  terms_and_conditions:
104
106
  'Odesláním objednávky souhlasím s <0>Obchodními podmínkami</0> {{termsAndConditionsCompanies}} a beru na vědomí <1>Zásady soukromí</1>.',
107
+ insurance: {
108
+ label: 'Pojištění vstupenek',
109
+ per_ticket: 'ks',
110
+ modal: {
111
+ description:
112
+ 'Pojištění vstupenek Vám poskytuje ochranu v případě, že se nebudete moci zúčastnit akce z důvodu nemoci, úrazu nebo jiných nepředvídatelných událostí.',
113
+ coverage:
114
+ 'Pojištění pokrývá: nemoc, úraz, náhlá hospitalizace, karanténa nebo jiné nepředvídatelné události, které Vám zabrání v účasti na akci.',
115
+ price: 'Cena pojištění',
116
+ },
117
+ },
118
+ sms_notification: {
119
+ label: 'SMS připomenutí termínu akce',
120
+ modal: {
121
+ description:
122
+ 'Připomínka akce den předem: SMS vás upozorní na blížící se událost, abyste na ni nezapomněli a stihli se včas připravit.',
123
+ price: 'Cena SMS připomenutí termínu akce',
124
+ },
125
+ },
105
126
  order_success: {
106
127
  title: 'Vstupenky byly úspěšně zarezervovány. Teď už zbývá jenom zaplatit.',
107
128
  description:
@@ -15,6 +15,7 @@ const en = {
15
15
  go_home: 'Go to homepage',
16
16
  apple_wallet: 'Download to Apple Wallet',
17
17
  google_wallet: 'Download to Google Wallet',
18
+ more_info: 'More information',
18
19
  shipping_method: {
19
20
  types: {
20
21
  PACKETA: 'Packeta',
@@ -42,6 +43,7 @@ const en = {
42
43
  with_fee: 'incl. service fee',
43
44
  service_fee: 'Service fee',
44
45
  shipping_fee: 'Shipping',
46
+ ticket_insurance: 'Ticket insurance',
45
47
  price_including_service_fee: 'The price includes a service fee of {{fee}}.',
46
48
  price_including_service_fee_percentage:
47
49
  'The price includes a service fee of {{percentage}} of the total amount.',
@@ -49,7 +51,6 @@ const en = {
49
51
  original_price: 'Original price',
50
52
  ticket: 'Ticket',
51
53
  category: 'Category',
52
- open_map: 'Open map',
53
54
  },
54
55
  validation: {
55
56
  required: 'This field is required.',
@@ -102,6 +103,18 @@ const en = {
102
103
  },
103
104
  terms_and_conditions:
104
105
  'By submitting the order, I agree to the <0>Terms and Conditions</0> of {{termsAndConditionsCompanies}} and acknowledge the <1>Privacy Policy</1>.',
106
+ insurance: {
107
+ label: 'Ticket insurance',
108
+ per_ticket: 'pc',
109
+ modal: {
110
+ title: 'Ticket Insurance',
111
+ description:
112
+ 'Ticket insurance provides you with protection in case you cannot attend the event due to illness, injury, or other unforeseen circumstances.',
113
+ coverage:
114
+ 'Insurance covers: illness, injury, sudden hospitalization, quarantine, or other unforeseen events that prevent you from attending the event.',
115
+ price: 'Insurance price',
116
+ },
117
+ },
105
118
  order_success: {
106
119
  title: 'Tickets have been successfully reserved. Now you just need to pay.',
107
120
  description:
@@ -15,6 +15,7 @@ const es = {
15
15
  go_home: 'Ir a la página principal',
16
16
  apple_wallet: 'Descargar en Apple Wallet',
17
17
  google_wallet: 'Descargar en Google Wallet',
18
+ more_info: 'Más información',
18
19
  shipping_method: {
19
20
  types: {
20
21
  PACKETA: 'Packeta',
@@ -42,6 +43,7 @@ const es = {
42
43
  with_fee: 'incl. tarifa de servicio',
43
44
  service_fee: 'Tarifa de servicio',
44
45
  shipping_fee: 'Envío',
46
+ ticket_insurance: 'Seguro de entrada',
45
47
  price_including_service_fee: 'El precio incluye una tarifa de servicio de {{fee}}.',
46
48
  price_including_service_fee_percentage:
47
49
  'El precio incluye una tarifa de servicio del {{percentage}} del importe total.',
@@ -49,7 +51,6 @@ const es = {
49
51
  original_price: 'Precio original',
50
52
  ticket: 'Entrada',
51
53
  category: 'Categoría',
52
- open_map: 'Abrir mapa',
53
54
  },
54
55
  validation: {
55
56
  required: 'Este campo es obligatorio.',
@@ -102,6 +103,18 @@ const es = {
102
103
  },
103
104
  terms_and_conditions:
104
105
  'Al enviar el pedido, acepto los <0>Términos y Condiciones</0> de {{termsAndConditionsCompanies}} y reconozco la <1>Política de Privacidad</1>.',
106
+ insurance: {
107
+ label: 'Seguro de entrada',
108
+ per_ticket: 'pc',
109
+ modal: {
110
+ title: 'Seguro de entrada',
111
+ description:
112
+ 'El seguro de entradas te ofrece protección en caso de que no puedas asistir al evento debido a enfermedad, lesión u otras circunstancias imprevistas.',
113
+ coverage:
114
+ 'El seguro cubre: enfermedad, lesión, hospitalización repentina, cuarentena u otros acontecimientos imprevistos que te impidan asistir al evento.',
115
+ price: 'Precio del seguro',
116
+ },
117
+ },
105
118
  order_success: {
106
119
  title: 'Las entradas han sido reservadas con éxito. Ahora solo tienes que pagar.',
107
120
  description:
@@ -15,6 +15,7 @@ const pl = {
15
15
  go_home: 'Przejdź do strony głównej',
16
16
  apple_wallet: 'Pobierz do Apple Wallet',
17
17
  google_wallet: 'Pobierz do Google Wallet',
18
+ more_info: 'Więcej informacji',
18
19
  shipping_method: {
19
20
  types: {
20
21
  PACKETA: 'Packeta',
@@ -42,6 +43,7 @@ const pl = {
42
43
  with_fee: 'z opłatą serwisową',
43
44
  service_fee: 'Opłata serwisowa',
44
45
  shipping_fee: 'Wysyłka',
46
+ ticket_insurance: 'Ubezpieczenie biletu',
45
47
  price_including_service_fee: 'Cena zawiera opłatę serwisową {{fee}}.',
46
48
  price_including_service_fee_percentage:
47
49
  'Cena zawiera opłatę serwisową w wysokości {{percentage}} całkowitej kwoty.',
@@ -49,7 +51,6 @@ const pl = {
49
51
  original_price: 'Cena oryginalna',
50
52
  ticket: 'Bilet',
51
53
  category: 'Kategoria',
52
- open_map: 'Otwórz mapę',
53
54
  },
54
55
  validation: {
55
56
  required: 'To pole jest wymagane.',
@@ -102,6 +103,18 @@ const pl = {
102
103
  },
103
104
  terms_and_conditions:
104
105
  'Składając zamówienie, akceptuję <0>Regulamin</0> {{termsAndConditionsCompanies}} oraz potwierdzam <1>Politykę prywatności</1>.',
106
+ insurance: {
107
+ label: 'Ubezpieczenie biletu',
108
+ per_ticket: 'pc',
109
+ modal: {
110
+ title: 'Ubezpieczenie biletów',
111
+ description:
112
+ 'Ubezpieczenie biletów zapewnia ochronę w przypadku, gdy nie będziesz mógł wziąć udziału w wydarzeniu z powodu choroby, kontuzji lub innych nieprzewidzianych okoliczności.',
113
+ coverage:
114
+ 'Ubezpieczenie obejmuje: chorobę, kontuzję, nagłe hospitalizacje, kwarantannę lub inne nieprzewidziane zdarzenia uniemożliwiające uczestnictwo w wydarzeniu.',
115
+ price: 'Cena ubezpieczenia',
116
+ },
117
+ },
105
118
  order_success: {
106
119
  title: 'Bilety zostały pomyślnie zarezerwowane. Teraz wystarczy zapłacić.',
107
120
  description: