@eventlook/sdk 1.4.49-beta.4 → 1.4.49-beta.6
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.
- package/dist/cjs/form/PaymentOverviewBox.js +5 -4
- package/dist/cjs/form/PaymentOverviewBox.js.map +1 -1
- package/dist/cjs/form/PaymentOverviewDrawer.js +220 -60
- package/dist/cjs/form/PaymentOverviewDrawer.js.map +1 -1
- package/dist/cjs/form/Shipping.js +13 -10
- package/dist/cjs/form/Shipping.js.map +1 -1
- package/dist/cjs/form/TicketForm.js +5 -8
- package/dist/cjs/form/TicketForm.js.map +1 -1
- package/dist/cjs/form/product/ProductCard.js +45 -38
- package/dist/cjs/form/product/ProductCard.js.map +1 -1
- package/dist/cjs/form/product/ProductVariantsDialog.js +13 -4
- package/dist/cjs/form/product/ProductVariantsDialog.js.map +1 -1
- package/dist/cjs/form/style.js +6 -1
- package/dist/cjs/form/style.js.map +1 -1
- package/dist/cjs/form/tickets/TicketQuantityControl.js +5 -3
- package/dist/cjs/form/tickets/TicketQuantityControl.js.map +1 -1
- package/dist/cjs/hooks/useScrollToFirstError.js +19 -10
- package/dist/cjs/hooks/useScrollToFirstError.js.map +1 -1
- package/dist/cjs/locales/cs.js +7 -0
- package/dist/cjs/locales/cs.js.map +1 -1
- package/dist/cjs/locales/en.js +7 -0
- package/dist/cjs/locales/en.js.map +1 -1
- package/dist/cjs/locales/es.js +7 -0
- package/dist/cjs/locales/es.js.map +1 -1
- package/dist/cjs/locales/pl.js +7 -0
- package/dist/cjs/locales/pl.js.map +1 -1
- package/dist/cjs/locales/sk.js +7 -0
- package/dist/cjs/locales/sk.js.map +1 -1
- package/dist/cjs/locales/uk.js +7 -0
- package/dist/cjs/locales/uk.js.map +1 -1
- package/dist/esm/form/PaymentOverviewBox.js +5 -4
- package/dist/esm/form/PaymentOverviewBox.js.map +1 -1
- package/dist/esm/form/PaymentOverviewDrawer.js +220 -60
- package/dist/esm/form/PaymentOverviewDrawer.js.map +1 -1
- package/dist/esm/form/Shipping.js +13 -10
- package/dist/esm/form/Shipping.js.map +1 -1
- package/dist/esm/form/TicketForm.js +6 -9
- package/dist/esm/form/TicketForm.js.map +1 -1
- package/dist/esm/form/product/ProductCard.js +46 -39
- package/dist/esm/form/product/ProductCard.js.map +1 -1
- package/dist/esm/form/product/ProductVariantsDialog.js +13 -4
- package/dist/esm/form/product/ProductVariantsDialog.js.map +1 -1
- package/dist/esm/form/style.js +6 -1
- package/dist/esm/form/style.js.map +1 -1
- package/dist/esm/form/tickets/TicketQuantityControl.js +5 -3
- package/dist/esm/form/tickets/TicketQuantityControl.js.map +1 -1
- package/dist/esm/hooks/useScrollToFirstError.js +19 -10
- package/dist/esm/hooks/useScrollToFirstError.js.map +1 -1
- package/dist/esm/locales/cs.js +7 -0
- package/dist/esm/locales/cs.js.map +1 -1
- package/dist/esm/locales/en.js +7 -0
- package/dist/esm/locales/en.js.map +1 -1
- package/dist/esm/locales/es.js +7 -0
- package/dist/esm/locales/es.js.map +1 -1
- package/dist/esm/locales/pl.js +7 -0
- package/dist/esm/locales/pl.js.map +1 -1
- package/dist/esm/locales/sk.js +7 -0
- package/dist/esm/locales/sk.js.map +1 -1
- package/dist/esm/locales/uk.js +7 -0
- package/dist/esm/locales/uk.js.map +1 -1
- package/package.json +1 -3
- package/rollup.config.mjs +0 -1
- package/src/form/PaymentOverviewBox.tsx +19 -13
- package/src/form/PaymentOverviewDrawer.tsx +314 -106
- package/src/form/Shipping.tsx +19 -16
- package/src/form/TicketForm.tsx +7 -8
- package/src/form/product/ProductCard.tsx +75 -70
- package/src/form/product/ProductVariantsDialog.tsx +19 -2
- package/src/form/style.ts +7 -1
- package/src/form/tickets/TicketQuantityControl.tsx +6 -0
- package/src/hooks/useScrollToFirstError.ts +22 -17
- package/src/locales/cs.tsx +7 -0
- package/src/locales/en.tsx +7 -0
- package/src/locales/es.tsx +7 -0
- package/src/locales/pl.tsx +7 -0
- package/src/locales/sk.tsx +7 -0
- package/src/locales/uk.tsx +7 -0
- package/src/hooks/useConsentScrollOnDrawerOpen.ts +0 -73
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
Typography,
|
|
13
13
|
} from '@mui/material';
|
|
14
14
|
import Image from '@components/Image';
|
|
15
|
+
import { Iconify } from '@components/iconify';
|
|
15
16
|
import { IEventProduct } from '@utils/types/event-product.type';
|
|
16
17
|
import React, { useMemo, useState } from 'react';
|
|
17
18
|
import ProductVariantsDialog from '@form/product/ProductVariantsDialog';
|
|
@@ -115,6 +116,72 @@ const ProductCard: React.FC<Props> = ({ eventProduct, eventId, isOnlyMerchandise
|
|
|
115
116
|
});
|
|
116
117
|
};
|
|
117
118
|
|
|
119
|
+
const simpleProductQuantityControl =
|
|
120
|
+
simpleProductQuantity > 0 ? (
|
|
121
|
+
<Stack direction="row" spacing={1} alignItems="center" width="100%">
|
|
122
|
+
<IconButton
|
|
123
|
+
onClick={() => onChangeSimpleProductQuantity(simpleProductQuantity - 1)}
|
|
124
|
+
disabled={simpleProductQuantity <= 0}
|
|
125
|
+
sx={{
|
|
126
|
+
flex: '1 1 0',
|
|
127
|
+
height: 36,
|
|
128
|
+
p: 0,
|
|
129
|
+
borderRadius: 1,
|
|
130
|
+
border: '1px solid',
|
|
131
|
+
borderColor: 'grey.300',
|
|
132
|
+
display: 'flex',
|
|
133
|
+
alignItems: 'center',
|
|
134
|
+
justifyContent: 'center',
|
|
135
|
+
}}
|
|
136
|
+
>
|
|
137
|
+
<Iconify icon="eva:minus-fill" width={18} height={18} />
|
|
138
|
+
</IconButton>
|
|
139
|
+
<Box
|
|
140
|
+
sx={{
|
|
141
|
+
flex: '1 1 0',
|
|
142
|
+
height: 36,
|
|
143
|
+
borderRadius: 1,
|
|
144
|
+
border: '1px solid',
|
|
145
|
+
borderColor: 'grey.300',
|
|
146
|
+
display: 'flex',
|
|
147
|
+
alignItems: 'center',
|
|
148
|
+
justifyContent: 'center',
|
|
149
|
+
fontWeight: 700,
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
{simpleProductQuantity}
|
|
153
|
+
</Box>
|
|
154
|
+
<IconButton
|
|
155
|
+
onClick={() => onChangeSimpleProductQuantity(simpleProductQuantity + 1)}
|
|
156
|
+
disabled={simpleProductQuantity >= 10 || simpleProductMaxAvailable <= 0}
|
|
157
|
+
sx={{
|
|
158
|
+
flex: '1 1 0',
|
|
159
|
+
height: 36,
|
|
160
|
+
p: 0,
|
|
161
|
+
borderRadius: 1,
|
|
162
|
+
bgcolor: 'primary.main',
|
|
163
|
+
color: 'primary.contrastText',
|
|
164
|
+
'&:hover': { bgcolor: 'primary.dark' },
|
|
165
|
+
'&.Mui-disabled': {
|
|
166
|
+
bgcolor: 'action.disabledBackground',
|
|
167
|
+
color: 'action.disabled',
|
|
168
|
+
},
|
|
169
|
+
}}
|
|
170
|
+
>
|
|
171
|
+
<Iconify icon="eva:plus-fill" width={18} height={18} />
|
|
172
|
+
</IconButton>
|
|
173
|
+
</Stack>
|
|
174
|
+
) : (
|
|
175
|
+
<Button
|
|
176
|
+
variant="contained"
|
|
177
|
+
onClick={() => onChangeSimpleProductQuantity(1)}
|
|
178
|
+
disabled={simpleProductMaxAvailable <= 0}
|
|
179
|
+
fullWidth
|
|
180
|
+
>
|
|
181
|
+
{t('add')}
|
|
182
|
+
</Button>
|
|
183
|
+
);
|
|
184
|
+
|
|
118
185
|
return (
|
|
119
186
|
<>
|
|
120
187
|
<Card
|
|
@@ -152,67 +219,7 @@ const ProductCard: React.FC<Props> = ({ eventProduct, eventId, isOnlyMerchandise
|
|
|
152
219
|
)}
|
|
153
220
|
</Stack>
|
|
154
221
|
{isSimpleProduct ? (
|
|
155
|
-
|
|
156
|
-
<Stack direction="row" spacing={1} alignItems="center" width="100%">
|
|
157
|
-
<IconButton
|
|
158
|
-
onClick={() => onChangeSimpleProductQuantity(simpleProductQuantity - 1)}
|
|
159
|
-
disabled={simpleProductQuantity <= 0}
|
|
160
|
-
sx={{
|
|
161
|
-
flex: '1 1 0',
|
|
162
|
-
height: 36,
|
|
163
|
-
p: 0,
|
|
164
|
-
borderRadius: 1,
|
|
165
|
-
border: '1px solid',
|
|
166
|
-
borderColor: 'grey.300',
|
|
167
|
-
}}
|
|
168
|
-
>
|
|
169
|
-
-
|
|
170
|
-
</IconButton>
|
|
171
|
-
<Box
|
|
172
|
-
sx={{
|
|
173
|
-
flex: '1 1 0',
|
|
174
|
-
height: 36,
|
|
175
|
-
borderRadius: 1,
|
|
176
|
-
border: '1px solid',
|
|
177
|
-
borderColor: 'grey.300',
|
|
178
|
-
display: 'flex',
|
|
179
|
-
alignItems: 'center',
|
|
180
|
-
justifyContent: 'center',
|
|
181
|
-
fontWeight: 700,
|
|
182
|
-
}}
|
|
183
|
-
>
|
|
184
|
-
{simpleProductQuantity}
|
|
185
|
-
</Box>
|
|
186
|
-
<IconButton
|
|
187
|
-
onClick={() => onChangeSimpleProductQuantity(simpleProductQuantity + 1)}
|
|
188
|
-
disabled={simpleProductQuantity >= 10 || simpleProductMaxAvailable <= 0}
|
|
189
|
-
sx={{
|
|
190
|
-
flex: '1 1 0',
|
|
191
|
-
height: 36,
|
|
192
|
-
p: 0,
|
|
193
|
-
borderRadius: 1,
|
|
194
|
-
bgcolor: 'primary.main',
|
|
195
|
-
color: 'primary.contrastText',
|
|
196
|
-
'&:hover': { bgcolor: 'primary.dark' },
|
|
197
|
-
'&.Mui-disabled': {
|
|
198
|
-
bgcolor: 'action.disabledBackground',
|
|
199
|
-
color: 'action.disabled',
|
|
200
|
-
},
|
|
201
|
-
}}
|
|
202
|
-
>
|
|
203
|
-
+
|
|
204
|
-
</IconButton>
|
|
205
|
-
</Stack>
|
|
206
|
-
) : (
|
|
207
|
-
<Button
|
|
208
|
-
variant="contained"
|
|
209
|
-
onClick={() => onChangeSimpleProductQuantity(1)}
|
|
210
|
-
disabled={simpleProductMaxAvailable <= 0}
|
|
211
|
-
fullWidth
|
|
212
|
-
>
|
|
213
|
-
{t('add')}
|
|
214
|
-
</Button>
|
|
215
|
-
)
|
|
222
|
+
simpleProductQuantityControl
|
|
216
223
|
) : (
|
|
217
224
|
<Button
|
|
218
225
|
variant={eventNotEmpty ? 'contained' : 'outlined'}
|
|
@@ -270,18 +277,16 @@ const ProductCard: React.FC<Props> = ({ eventProduct, eventId, isOnlyMerchandise
|
|
|
270
277
|
</DialogContent>
|
|
271
278
|
<DialogActions sx={{ px: 3, pb: 3 }}>
|
|
272
279
|
<Stack spacing={1} width="100%">
|
|
280
|
+
{simpleProductQuantityControl}
|
|
273
281
|
<Button
|
|
274
|
-
variant="
|
|
275
|
-
onClick={() =>
|
|
276
|
-
onChangeSimpleProductQuantity(simpleProductQuantity + 1);
|
|
277
|
-
setOpenSimpleProductDialog(false);
|
|
278
|
-
}}
|
|
279
|
-
disabled={simpleProductQuantity >= 10 || simpleProductMaxAvailable <= 0}
|
|
282
|
+
variant="outlined"
|
|
283
|
+
onClick={() => setOpenSimpleProductDialog(false)}
|
|
280
284
|
fullWidth
|
|
285
|
+
sx={{
|
|
286
|
+
color: 'inherit',
|
|
287
|
+
borderColor: (theme) => theme.palette.grey[300],
|
|
288
|
+
}}
|
|
281
289
|
>
|
|
282
|
-
{t('add')}
|
|
283
|
-
</Button>
|
|
284
|
-
<Button variant="outlined" onClick={() => setOpenSimpleProductDialog(false)} fullWidth>
|
|
285
290
|
{t('close')}
|
|
286
291
|
</Button>
|
|
287
292
|
</Stack>
|
|
@@ -63,7 +63,11 @@ const ProductVariantsDialog: React.FC<Props> = ({
|
|
|
63
63
|
.map((variant) => {
|
|
64
64
|
const quantity = draftQuantities[variant.id] ?? 0;
|
|
65
65
|
const selectedQty = selectedQuantityByVariant?.[variant.id] ?? 0;
|
|
66
|
-
if (
|
|
66
|
+
if (canAddOnlyOneAtATime) {
|
|
67
|
+
if (quantity <= 0) return null;
|
|
68
|
+
} else if (quantity <= 0 && selectedQty <= 0) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
67
71
|
return {
|
|
68
72
|
eventProductVariantId: variant.id,
|
|
69
73
|
productVariantId: variant.productVariant.id,
|
|
@@ -290,6 +294,7 @@ const ProductVariantsDialog: React.FC<Props> = ({
|
|
|
290
294
|
<Button
|
|
291
295
|
variant="outlined"
|
|
292
296
|
onClick={() => handleRemoveQuantity(variant)}
|
|
297
|
+
aria-label={t('components.product_variant_dialog.decrease_quantity')}
|
|
293
298
|
disabled={draftQty < 1}
|
|
294
299
|
sx={{
|
|
295
300
|
minWidth: 0,
|
|
@@ -324,6 +329,7 @@ const ProductVariantsDialog: React.FC<Props> = ({
|
|
|
324
329
|
<Button
|
|
325
330
|
variant="contained"
|
|
326
331
|
onClick={() => handleAddQuantity(variant)}
|
|
332
|
+
aria-label={t('components.product_variant_dialog.increase_quantity')}
|
|
327
333
|
disabled={draftQty >= 10 || draftQty >= maxAvailable}
|
|
328
334
|
sx={{ minWidth: 0, height: 36, borderRadius: 1, fontWeight: 700 }}
|
|
329
335
|
>
|
|
@@ -375,7 +381,18 @@ const ProductVariantsDialog: React.FC<Props> = ({
|
|
|
375
381
|
{t('remove')}
|
|
376
382
|
</Button>
|
|
377
383
|
)}
|
|
378
|
-
{onClose &&
|
|
384
|
+
{onClose && (
|
|
385
|
+
<Button
|
|
386
|
+
onClick={onClose}
|
|
387
|
+
sx={{
|
|
388
|
+
border: 1,
|
|
389
|
+
color: 'inherit',
|
|
390
|
+
borderColor: (theme) => theme.palette.grey[300],
|
|
391
|
+
}}
|
|
392
|
+
>
|
|
393
|
+
{t('cancel')}
|
|
394
|
+
</Button>
|
|
395
|
+
)}
|
|
379
396
|
<Button variant="contained" onClick={handleOnAdd} disabled={!hasDraftSelection}>
|
|
380
397
|
{t('confirm')}
|
|
381
398
|
</Button>
|
package/src/form/style.ts
CHANGED
|
@@ -5,6 +5,12 @@ export const OverviewCard = styled(Card)<{ stickyHeaderTop: number }>(
|
|
|
5
5
|
({ theme, stickyHeaderTop }) => ({
|
|
6
6
|
position: 'sticky',
|
|
7
7
|
top: stickyHeaderTop,
|
|
8
|
+
borderRadius: theme.spacing(2),
|
|
9
|
+
|
|
10
|
+
[theme.breakpoints.down('sm')]: {
|
|
11
|
+
borderRadius: theme.spacing(1),
|
|
12
|
+
boxShadow: 'none',
|
|
13
|
+
},
|
|
8
14
|
})
|
|
9
15
|
);
|
|
10
16
|
|
|
@@ -21,7 +27,7 @@ export const ShippingMethodItem = styled(Box, {
|
|
|
21
27
|
}`,
|
|
22
28
|
marginTop: theme.spacing(1),
|
|
23
29
|
width: '100%',
|
|
24
|
-
padding: `0 ${theme.spacing(2)}`,
|
|
30
|
+
padding: `0 0 0 ${theme.spacing(2)}`,
|
|
25
31
|
transitionDuration: '.3s',
|
|
26
32
|
|
|
27
33
|
'& > .MuiFormControlLabel-root': {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Box, Button, IconButton, Stack } from '@mui/material';
|
|
3
3
|
import { Iconify } from '@components/iconify';
|
|
4
|
+
import useGlobal from '@hooks/useGlobal';
|
|
4
5
|
|
|
5
6
|
interface TicketQuantityControlProps {
|
|
6
7
|
quantity: number;
|
|
@@ -23,11 +24,14 @@ const TicketQuantityControl: React.FC<TicketQuantityControlProps> = ({
|
|
|
23
24
|
onIncrement,
|
|
24
25
|
onAddFirst,
|
|
25
26
|
}) => {
|
|
27
|
+
const { t } = useGlobal();
|
|
28
|
+
|
|
26
29
|
if (quantity > 0) {
|
|
27
30
|
return (
|
|
28
31
|
<Stack direction="row" spacing={{ xs: 0.5, md: 1 }} alignItems="center">
|
|
29
32
|
<IconButton
|
|
30
33
|
onClick={onDecrement}
|
|
34
|
+
aria-label={t('form.labels.ticket_quantity_decrease')}
|
|
31
35
|
disabled={isDisabled || quantity <= 0}
|
|
32
36
|
sx={{
|
|
33
37
|
width: { xs: 36, md: 40 },
|
|
@@ -56,6 +60,7 @@ const TicketQuantityControl: React.FC<TicketQuantityControlProps> = ({
|
|
|
56
60
|
</Box>
|
|
57
61
|
<IconButton
|
|
58
62
|
onClick={onIncrement}
|
|
63
|
+
aria-label={t('form.labels.ticket_quantity_increase')}
|
|
59
64
|
disabled={isDisabled || !canAddMore}
|
|
60
65
|
sx={{
|
|
61
66
|
width: { xs: 36, md: 40 },
|
|
@@ -76,6 +81,7 @@ const TicketQuantityControl: React.FC<TicketQuantityControlProps> = ({
|
|
|
76
81
|
<Button
|
|
77
82
|
variant="contained"
|
|
78
83
|
onClick={onAddFirst}
|
|
84
|
+
aria-label={addLabel}
|
|
79
85
|
disabled={isDisabled || !canAddFirst}
|
|
80
86
|
sx={{
|
|
81
87
|
height: { xs: 36, md: 40 },
|
|
@@ -53,22 +53,23 @@ const getFirstError = <T extends FieldValues>(
|
|
|
53
53
|
return null;
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
const escapeSelectorValue = (value: string) => {
|
|
56
|
+
const escapeSelectorValue = (value: string): string => {
|
|
57
57
|
if (typeof CSS !== 'undefined' && typeof CSS.escape === 'function') {
|
|
58
58
|
return CSS.escape(value);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
// Fallback: escape all CSS special characters manually
|
|
62
|
+
return value.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, '\\$1');
|
|
62
63
|
};
|
|
63
64
|
|
|
64
65
|
type ScrollToFirstErrorMethods<T extends FieldValues> = Pick<
|
|
65
|
-
UseFormReturn<T,
|
|
66
|
+
UseFormReturn<T, object, undefined>,
|
|
66
67
|
'setFocus'
|
|
67
68
|
>;
|
|
68
69
|
|
|
69
|
-
export default function useScrollToFirstError<T extends FieldValues>(
|
|
70
|
-
|
|
71
|
-
) {
|
|
70
|
+
export default function useScrollToFirstError<T extends FieldValues>({
|
|
71
|
+
setFocus,
|
|
72
|
+
}: ScrollToFirstErrorMethods<T>) {
|
|
72
73
|
return useCallback(
|
|
73
74
|
(errors: FieldErrors<T>) => {
|
|
74
75
|
const firstError = getFirstError(errors);
|
|
@@ -76,19 +77,23 @@ export default function useScrollToFirstError<T extends FieldValues>(
|
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
// Re-query the DOM instead of relying on potentially stale refs
|
|
81
|
+
const fieldName = String(firstError.name);
|
|
81
82
|
const scrollTarget =
|
|
82
|
-
|
|
83
|
-
document.
|
|
84
|
-
`[name="${escapeSelectorValue(String(firstError.name))}"]`
|
|
85
|
-
);
|
|
83
|
+
document.querySelector<HTMLElement>(`[name="${escapeSelectorValue(fieldName)}"]`) ||
|
|
84
|
+
document.getElementById(fieldName);
|
|
86
85
|
|
|
87
|
-
scrollTarget
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
if (scrollTarget) {
|
|
87
|
+
scrollTarget.scrollIntoView({
|
|
88
|
+
behavior: 'smooth',
|
|
89
|
+
block: 'center',
|
|
90
|
+
});
|
|
91
|
+
scrollTarget.focus({ preventScroll: true });
|
|
92
|
+
} else {
|
|
93
|
+
// Fallback to RHF's setFocus if no DOM element found
|
|
94
|
+
setFocus(firstError.name);
|
|
95
|
+
}
|
|
91
96
|
},
|
|
92
|
-
[
|
|
97
|
+
[setFocus]
|
|
93
98
|
);
|
|
94
99
|
}
|
package/src/locales/cs.tsx
CHANGED
|
@@ -57,6 +57,8 @@ const cs = {
|
|
|
57
57
|
open_map: 'Otevřít mapu',
|
|
58
58
|
payment_overview_open: 'Otevřít přehled platby',
|
|
59
59
|
payment_overview_close: 'Zavřít přehled platby',
|
|
60
|
+
ticket_quantity_decrease: 'Snížit počet vstupenek',
|
|
61
|
+
ticket_quantity_increase: 'Zvýšit počet vstupenek',
|
|
60
62
|
},
|
|
61
63
|
validation: {
|
|
62
64
|
required: 'Toto pole je povinné.',
|
|
@@ -142,6 +144,9 @@ const cs = {
|
|
|
142
144
|
services: {
|
|
143
145
|
add_tickets_first: 'Nejdříve prosím přidejte vstupenky',
|
|
144
146
|
},
|
|
147
|
+
shipping: {
|
|
148
|
+
choose_address: 'Vybrat adresu',
|
|
149
|
+
},
|
|
145
150
|
order_success: {
|
|
146
151
|
title: 'Vstupenky byly úspěšně zarezervovány. Teď už zbývá jenom zaplatit.',
|
|
147
152
|
description:
|
|
@@ -176,6 +181,8 @@ const cs = {
|
|
|
176
181
|
components: {
|
|
177
182
|
product_variant_dialog: {
|
|
178
183
|
select_variant: 'Musíte vybrat variantu produktu.',
|
|
184
|
+
decrease_quantity: 'Snížit množství varianty produktu',
|
|
185
|
+
increase_quantity: 'Zvýšit množství varianty produktu',
|
|
179
186
|
},
|
|
180
187
|
},
|
|
181
188
|
};
|
package/src/locales/en.tsx
CHANGED
|
@@ -57,6 +57,8 @@ const en = {
|
|
|
57
57
|
open_map: 'Open map',
|
|
58
58
|
payment_overview_open: 'Open payment overview',
|
|
59
59
|
payment_overview_close: 'Close payment overview',
|
|
60
|
+
ticket_quantity_decrease: 'Decrease ticket quantity',
|
|
61
|
+
ticket_quantity_increase: 'Increase ticket quantity',
|
|
60
62
|
},
|
|
61
63
|
validation: {
|
|
62
64
|
required: 'This field is required.',
|
|
@@ -143,6 +145,9 @@ const en = {
|
|
|
143
145
|
services: {
|
|
144
146
|
add_tickets_first: 'Please add tickets first',
|
|
145
147
|
},
|
|
148
|
+
shipping: {
|
|
149
|
+
choose_address: 'Choose address',
|
|
150
|
+
},
|
|
146
151
|
order_success: {
|
|
147
152
|
title: 'Tickets have been successfully reserved. Now you just need to pay.',
|
|
148
153
|
description:
|
|
@@ -177,6 +182,8 @@ const en = {
|
|
|
177
182
|
components: {
|
|
178
183
|
product_variant_dialog: {
|
|
179
184
|
select_variant: 'You must select a product variant',
|
|
185
|
+
decrease_quantity: 'Decrease product variant quantity',
|
|
186
|
+
increase_quantity: 'Increase product variant quantity',
|
|
180
187
|
},
|
|
181
188
|
},
|
|
182
189
|
};
|
package/src/locales/es.tsx
CHANGED
|
@@ -57,6 +57,8 @@ const es = {
|
|
|
57
57
|
open_map: 'Abrir mapa',
|
|
58
58
|
payment_overview_open: 'Abrir resumen de pago',
|
|
59
59
|
payment_overview_close: 'Cerrar resumen de pago',
|
|
60
|
+
ticket_quantity_decrease: 'Disminuir cantidad de entradas',
|
|
61
|
+
ticket_quantity_increase: 'Aumentar cantidad de entradas',
|
|
60
62
|
},
|
|
61
63
|
validation: {
|
|
62
64
|
required: 'Este campo es obligatorio.',
|
|
@@ -143,6 +145,9 @@ const es = {
|
|
|
143
145
|
services: {
|
|
144
146
|
add_tickets_first: 'Por favor, agregue entradas primero',
|
|
145
147
|
},
|
|
148
|
+
shipping: {
|
|
149
|
+
choose_address: 'Elegir dirección',
|
|
150
|
+
},
|
|
146
151
|
order_success: {
|
|
147
152
|
title: 'Las entradas han sido reservadas con éxito. Ahora solo tienes que pagar.',
|
|
148
153
|
description:
|
|
@@ -178,6 +183,8 @@ const es = {
|
|
|
178
183
|
components: {
|
|
179
184
|
product_variant_dialog: {
|
|
180
185
|
select_variant: 'Debes seleccionar una variante de producto',
|
|
186
|
+
decrease_quantity: 'Disminuir cantidad de variante de producto',
|
|
187
|
+
increase_quantity: 'Aumentar cantidad de variante de producto',
|
|
181
188
|
},
|
|
182
189
|
},
|
|
183
190
|
};
|
package/src/locales/pl.tsx
CHANGED
|
@@ -57,6 +57,8 @@ const pl = {
|
|
|
57
57
|
open_map: 'Otwórz mapę',
|
|
58
58
|
payment_overview_open: 'Otwórz podsumowanie płatności',
|
|
59
59
|
payment_overview_close: 'Zamknij podsumowanie płatności',
|
|
60
|
+
ticket_quantity_decrease: 'Zmniejsz liczbę biletów',
|
|
61
|
+
ticket_quantity_increase: 'Zwiększ liczbę biletów',
|
|
60
62
|
},
|
|
61
63
|
validation: {
|
|
62
64
|
required: 'To pole jest wymagane.',
|
|
@@ -143,6 +145,9 @@ const pl = {
|
|
|
143
145
|
services: {
|
|
144
146
|
add_tickets_first: 'Najpierw dodaj bilety',
|
|
145
147
|
},
|
|
148
|
+
shipping: {
|
|
149
|
+
choose_address: 'Wybierz adres',
|
|
150
|
+
},
|
|
146
151
|
order_success: {
|
|
147
152
|
title: 'Bilety zostały pomyślnie zarezerwowane. Teraz wystarczy zapłacić.',
|
|
148
153
|
description:
|
|
@@ -176,6 +181,8 @@ const pl = {
|
|
|
176
181
|
components: {
|
|
177
182
|
product_variant_dialog: {
|
|
178
183
|
select_variant: 'Musisz wybrać wariant produktu',
|
|
184
|
+
decrease_quantity: 'Zmniejsz ilość wariantu produktu',
|
|
185
|
+
increase_quantity: 'Zwiększ ilość wariantu produktu',
|
|
179
186
|
},
|
|
180
187
|
},
|
|
181
188
|
};
|
package/src/locales/sk.tsx
CHANGED
|
@@ -57,6 +57,8 @@ const sk = {
|
|
|
57
57
|
open_map: 'Otvoriť mapu',
|
|
58
58
|
payment_overview_open: 'Otvoriť prehľad platby',
|
|
59
59
|
payment_overview_close: 'Zavrieť prehľad platby',
|
|
60
|
+
ticket_quantity_decrease: 'Znížiť počet vstupeniek',
|
|
61
|
+
ticket_quantity_increase: 'Zvýšiť počet vstupeniek',
|
|
60
62
|
},
|
|
61
63
|
validation: {
|
|
62
64
|
required: 'Toto pole je povinné.',
|
|
@@ -143,6 +145,9 @@ const sk = {
|
|
|
143
145
|
services: {
|
|
144
146
|
add_tickets_first: 'Najskôr prosím pridajte lístky',
|
|
145
147
|
},
|
|
148
|
+
shipping: {
|
|
149
|
+
choose_address: 'Vybrať adresu',
|
|
150
|
+
},
|
|
146
151
|
order_success: {
|
|
147
152
|
title: 'Vstupenky boli úspešne rezervované. Teraz už len zaplatiť.',
|
|
148
153
|
description:
|
|
@@ -177,6 +182,8 @@ const sk = {
|
|
|
177
182
|
components: {
|
|
178
183
|
product_variant_dialog: {
|
|
179
184
|
select_variant: 'Musíte vybrať variant produktu',
|
|
185
|
+
decrease_quantity: 'Znížiť množstvo variantu produktu',
|
|
186
|
+
increase_quantity: 'Zvýšiť množstvo variantu produktu',
|
|
180
187
|
},
|
|
181
188
|
},
|
|
182
189
|
};
|
package/src/locales/uk.tsx
CHANGED
|
@@ -57,6 +57,8 @@ const uk = {
|
|
|
57
57
|
open_map: 'Відкрити карту',
|
|
58
58
|
payment_overview_open: 'Відкрити огляд платежу',
|
|
59
59
|
payment_overview_close: 'Закрити огляд платежу',
|
|
60
|
+
ticket_quantity_decrease: 'Зменшити кількість квитків',
|
|
61
|
+
ticket_quantity_increase: 'Збільшити кількість квитків',
|
|
60
62
|
},
|
|
61
63
|
validation: {
|
|
62
64
|
required: "Це поле обов'язкове.",
|
|
@@ -143,6 +145,9 @@ const uk = {
|
|
|
143
145
|
services: {
|
|
144
146
|
add_tickets_first: 'Будь ласка, спочатку додайте квитки',
|
|
145
147
|
},
|
|
148
|
+
shipping: {
|
|
149
|
+
choose_address: 'Вибрати адресу',
|
|
150
|
+
},
|
|
146
151
|
order_success: {
|
|
147
152
|
title: 'Квитки успішно зарезервовані. Тепер залишилося оплатити.',
|
|
148
153
|
description:
|
|
@@ -177,6 +182,8 @@ const uk = {
|
|
|
177
182
|
components: {
|
|
178
183
|
product_variant_dialog: {
|
|
179
184
|
select_variant: 'Ви повинні вибрати варіант продукту',
|
|
185
|
+
decrease_quantity: 'Зменшити кількість варіанту продукту',
|
|
186
|
+
increase_quantity: 'Збільшити кількість варіанту продукту',
|
|
180
187
|
},
|
|
181
188
|
},
|
|
182
189
|
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { RefObject, useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
interface UseConsentScrollOnDrawerOpenProps {
|
|
4
|
-
isDrawerOpen: boolean;
|
|
5
|
-
consentRef: RefObject<HTMLElement | null>;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export default function useConsentScrollOnDrawerOpen({
|
|
9
|
-
isDrawerOpen,
|
|
10
|
-
consentRef,
|
|
11
|
-
}: UseConsentScrollOnDrawerOpenProps) {
|
|
12
|
-
const [isNearConsentSection, setIsNearConsentSection] = useState(false);
|
|
13
|
-
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
const consentElement = consentRef.current;
|
|
16
|
-
if (!consentElement) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (!('IntersectionObserver' in window)) {
|
|
21
|
-
setIsNearConsentSection(true);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const observer = new IntersectionObserver(
|
|
26
|
-
(entries) => {
|
|
27
|
-
const entry = entries[0];
|
|
28
|
-
setIsNearConsentSection(entry.isIntersecting);
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
root: null,
|
|
32
|
-
threshold: 0,
|
|
33
|
-
rootMargin: '0px 0px 140px 0px',
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
observer.observe(consentElement);
|
|
38
|
-
|
|
39
|
-
return () => {
|
|
40
|
-
observer.disconnect();
|
|
41
|
-
};
|
|
42
|
-
}, [consentRef]);
|
|
43
|
-
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (!isDrawerOpen) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (window.matchMedia('(min-width:900px)').matches) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (!isNearConsentSection) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
let frameId = 0;
|
|
58
|
-
let frameId2 = 0;
|
|
59
|
-
frameId = window.requestAnimationFrame(() => {
|
|
60
|
-
frameId2 = window.requestAnimationFrame(() => {
|
|
61
|
-
consentRef.current?.scrollIntoView({
|
|
62
|
-
behavior: 'smooth',
|
|
63
|
-
block: 'center',
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
return () => {
|
|
69
|
-
window.cancelAnimationFrame(frameId);
|
|
70
|
-
window.cancelAnimationFrame(frameId2);
|
|
71
|
-
};
|
|
72
|
-
}, [consentRef, isDrawerOpen, isNearConsentSection]);
|
|
73
|
-
}
|