@licklist/design 0.52.0 → 0.53.0-dev.1
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/calendar/Calendar.d.ts +3 -8
- package/dist/calendar/Calendar.d.ts.map +1 -1
- package/dist/calendar/Calendar.js +1 -1
- package/dist/calendar/components/CalendarButtons/CalendarButtons.d.ts +2 -2
- package/dist/calendar/components/CalendarButtons/CalendarButtons.d.ts.map +1 -1
- package/dist/calendar/components/CalendarButtons/CalendarButtons.js +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts +2 -2
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.js +1 -1
- package/dist/calendar/utils/index.d.ts +0 -2
- package/dist/calendar/utils/index.d.ts.map +1 -1
- package/dist/calendar/utils/index.js +1 -1
- package/dist/date-time-button/DateTimeButton.d.ts +3 -3
- package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
- package/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
- package/dist/events/edit-event-modal/IntervalInput.js +1 -1
- package/dist/events/edit-event-modal/hooks/index.d.ts +3 -0
- package/dist/events/edit-event-modal/hooks/index.d.ts.map +1 -0
- package/dist/events/edit-event-modal/hooks/useFormattedDuration.d.ts +2 -0
- package/dist/events/edit-event-modal/hooks/useFormattedDuration.d.ts.map +1 -0
- package/dist/events/edit-event-modal/hooks/useFormattedDuration.js +1 -0
- package/dist/events/edit-event-modal/hooks/useValidationOptions.d.ts +11 -0
- package/dist/events/edit-event-modal/hooks/useValidationOptions.d.ts.map +1 -0
- package/dist/events/edit-event-modal/hooks/useValidationOptions.js +1 -0
- package/dist/events/event-venue-map/components/Scrollbars/Scrollbars.js +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts +2 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts +2 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts +2 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +1 -0
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +2 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +1 -1
- package/dist/index.js +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.js +1 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +1 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.d.ts +2 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.d.ts.map +1 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.js +1 -1
- package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.js +1 -1
- package/dist/static/date-range-input/DateRangeInput.d.ts.map +1 -1
- package/dist/static/date-range-input/DateRangeInput.js +1 -1
- package/dist/styles/resources-blocking/_index.scss +6 -0
- package/dist/styles/sales/BookingFilter.scss +18 -0
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/styles/sales/BookingTabs.scss +63 -5
- package/dist/styles/sales/LifeTimeSales.scss +1 -0
- package/dist/styles/sales/ManualBooking.scss +62 -3
- package/dist/styles/sales/SourceOfSales.scss +3 -0
- package/dist/styles/snippet-templates/SnippetTemplate.scss +17 -11
- package/dist/styles/snippet-templates/SnippetTemplateCard.scss +3 -2
- package/dist/styles/static/Tabs.scss +6 -0
- package/dist/styles/themes/bookedit/_index.scss +9 -8
- package/package.json +3 -3
- package/src/calendar/Calendar.tsx +9 -16
- package/src/calendar/components/CalendarButtons/CalendarButtons.tsx +8 -5
- package/src/calendar/components/CalendarDates/CalendarDates.tsx +12 -13
- package/src/calendar/utils/index.ts +0 -19
- package/src/date-time-button/DateTimeButton.tsx +3 -3
- package/src/events/edit-event-modal/IntervalInput.tsx +8 -80
- package/src/events/edit-event-modal/hooks/index.ts +2 -0
- package/src/events/edit-event-modal/hooks/useFormattedDuration.tsx +40 -0
- package/src/events/edit-event-modal/hooks/useValidationOptions.tsx +36 -0
- package/src/iframe/event/event-card/IframeEventCard.tsx +3 -1
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +2 -0
- package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +12 -6
- package/src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx +3 -0
- package/src/iframe/order-process/components/BookingSummary/types/index.ts +1 -0
- package/src/iframe/order-process/components/BookingSummary/utils/index.ts +2 -4
- package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +13 -23
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +10 -3
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +9 -3
- package/src/notification/email-template/control/EmailTemplateControl.tsx +5 -15
- package/src/sales/booking/results/components/ResultCard.tsx +6 -4
- package/src/sales/manual-booking/summary/ManualBookingSummary.tsx +9 -1
- package/src/snippet/snippet-template/preview/Preview.tsx +3 -0
- package/src/static/date-range-input/DateRangeInput.tsx +23 -2
- package/src/static/switch/BooleanSwitch.tsx +1 -1
- package/src/styles/resources-blocking/_index.scss +6 -0
- package/src/styles/sales/BookingFilter.scss +18 -0
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/styles/sales/BookingTabs.scss +63 -5
- package/src/styles/sales/LifeTimeSales.scss +1 -0
- package/src/styles/sales/ManualBooking.scss +62 -3
- package/src/styles/sales/SourceOfSales.scss +3 -0
- package/src/styles/snippet-templates/SnippetTemplate.scss +17 -11
- package/src/styles/snippet-templates/SnippetTemplateCard.scss +3 -2
- package/src/styles/static/Tabs.scss +6 -0
- package/src/styles/themes/bookedit/_index.scss +9 -8
|
@@ -8,21 +8,27 @@ type ProductSummaryProps = {
|
|
|
8
8
|
name?: string;
|
|
9
9
|
productQuantityError?: string;
|
|
10
10
|
orderProduct: OrderItem;
|
|
11
|
+
isPaymentLink?: boolean;
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export const ProductSummary = ({
|
|
14
15
|
name,
|
|
15
16
|
productQuantityError,
|
|
16
17
|
orderProduct,
|
|
18
|
+
isPaymentLink,
|
|
17
19
|
}: ProductSummaryProps) => {
|
|
18
20
|
const { t } = useTranslation("Design");
|
|
19
21
|
const { formatNumber } = useIntl();
|
|
20
22
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
orderProduct?.
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const priceForOneProduct =
|
|
24
|
+
!isPaymentLink && orderProduct?.hasDeposit
|
|
25
|
+
? orderProduct?.deposit
|
|
26
|
+
: orderProduct?.price;
|
|
27
|
+
|
|
28
|
+
const fullPrice = formatNumber(priceForOneProduct * orderProduct?.quantity, {
|
|
29
|
+
style: "currency",
|
|
30
|
+
currency: Config.Currency.GBP,
|
|
31
|
+
});
|
|
26
32
|
|
|
27
33
|
return (
|
|
28
34
|
<div className="product">
|
|
@@ -32,7 +38,7 @@ export const ProductSummary = ({
|
|
|
32
38
|
{t("shortQuantity")}: {orderProduct?.quantity}
|
|
33
39
|
</p>
|
|
34
40
|
|
|
35
|
-
<p className="price">{
|
|
41
|
+
<p className="price">{fullPrice}</p>
|
|
36
42
|
</div>
|
|
37
43
|
|
|
38
44
|
{productQuantityError && (
|
|
@@ -29,12 +29,14 @@ export type ProductsByMenuStepsProps = {
|
|
|
29
29
|
orderItems: OrderItems;
|
|
30
30
|
step: MenuStep;
|
|
31
31
|
productsWithErrors?: QuantityCheckProductInfo[];
|
|
32
|
+
isPaymentLink?: boolean;
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
export const ProductsByMenuStep = ({
|
|
35
36
|
orderItems,
|
|
36
37
|
step,
|
|
37
38
|
productsWithErrors = [],
|
|
39
|
+
isPaymentLink,
|
|
38
40
|
}: ProductsByMenuStepsProps) => {
|
|
39
41
|
const { productCategories } = step;
|
|
40
42
|
|
|
@@ -62,6 +64,7 @@ export const ProductsByMenuStep = ({
|
|
|
62
64
|
|
|
63
65
|
return (
|
|
64
66
|
<ProductSummary
|
|
67
|
+
isPaymentLink={isPaymentLink}
|
|
65
68
|
key={orderItem.id}
|
|
66
69
|
name={orderItem.name}
|
|
67
70
|
productQuantityError={productQuantityError}
|
|
@@ -7,10 +7,8 @@ export const cartSumByOrderProducts = (orderProducts?: OrderItem[]) => {
|
|
|
7
7
|
}
|
|
8
8
|
return orderProducts.reduce((prevSumValue: number, product) => {
|
|
9
9
|
if (!product) return 0;
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
prevSumValue + (product?.deposit || product?.price) * product.quantity
|
|
13
|
-
);
|
|
10
|
+
const price = product?.hasDeposit ? product?.deposit : product?.price;
|
|
11
|
+
return prevSumValue + price * product.quantity;
|
|
14
12
|
}, 0);
|
|
15
13
|
};
|
|
16
14
|
|
|
@@ -42,18 +42,6 @@ export const CategoryProduct = ({
|
|
|
42
42
|
return error?.message;
|
|
43
43
|
}, [productsWithErrors, product.id]);
|
|
44
44
|
|
|
45
|
-
const deposit = useMemo(() => {
|
|
46
|
-
if (
|
|
47
|
-
!category.allowDeposits ||
|
|
48
|
-
!product.deposit ||
|
|
49
|
-
product?.isSoldOut ||
|
|
50
|
-
product.deposit >= product.price
|
|
51
|
-
) {
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
return product.deposit;
|
|
55
|
-
}, [category, product]);
|
|
56
|
-
|
|
57
45
|
const checkIfSoldOutProduct = () => {
|
|
58
46
|
if (!soldOutProducts || product?.isSoldOut) {
|
|
59
47
|
return undefined;
|
|
@@ -146,10 +134,13 @@ export const CategoryProduct = ({
|
|
|
146
134
|
</div>
|
|
147
135
|
<div className="iframe-event__product-price-wrapper">
|
|
148
136
|
<span className="product-price">
|
|
149
|
-
{formatNumber(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
137
|
+
{formatNumber(
|
|
138
|
+
category.allowDeposits ? product?.deposit : product.price,
|
|
139
|
+
{
|
|
140
|
+
style: "currency",
|
|
141
|
+
currency: Config.Currency.GBP,
|
|
142
|
+
}
|
|
143
|
+
)}
|
|
153
144
|
</span>
|
|
154
145
|
<ProductQuantityInput
|
|
155
146
|
onChange={onChange}
|
|
@@ -162,17 +153,16 @@ export const CategoryProduct = ({
|
|
|
162
153
|
}}
|
|
163
154
|
category={category}
|
|
164
155
|
invalid={invalid}
|
|
165
|
-
deposit={deposit}
|
|
166
156
|
/>
|
|
167
157
|
</div>
|
|
168
|
-
{
|
|
158
|
+
{category.allowDeposits && !category?.remainderExpireAfter && (
|
|
169
159
|
<div className="mt-4">
|
|
170
160
|
{t("Design:payNowAndUponArrival", {
|
|
171
|
-
deposit: formatNumber(deposit, {
|
|
161
|
+
deposit: formatNumber(product?.deposit, {
|
|
172
162
|
style: "currency",
|
|
173
163
|
currency: Config.Currency.GBP,
|
|
174
164
|
}),
|
|
175
|
-
remainder: formatNumber(product.price - deposit, {
|
|
165
|
+
remainder: formatNumber(product.price - product?.deposit, {
|
|
176
166
|
style: "currency",
|
|
177
167
|
currency: Config.Currency.GBP,
|
|
178
168
|
}),
|
|
@@ -180,14 +170,14 @@ export const CategoryProduct = ({
|
|
|
180
170
|
</div>
|
|
181
171
|
)}
|
|
182
172
|
|
|
183
|
-
{
|
|
173
|
+
{category.allowDeposits && category?.remainderExpireAfter > 0 && (
|
|
184
174
|
<div className="mt-4">
|
|
185
175
|
{t("Design:payNowAndReminderDays", {
|
|
186
|
-
deposit: formatNumber(deposit, {
|
|
176
|
+
deposit: formatNumber(product?.deposit, {
|
|
187
177
|
style: "currency",
|
|
188
178
|
currency: Config.Currency.GBP,
|
|
189
179
|
}),
|
|
190
|
-
remainder: formatNumber(product.price - deposit, {
|
|
180
|
+
remainder: formatNumber(product.price - product?.deposit, {
|
|
191
181
|
style: "currency",
|
|
192
182
|
currency: Config.Currency.GBP,
|
|
193
183
|
}),
|
package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx
CHANGED
|
@@ -31,8 +31,11 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
31
31
|
},
|
|
32
32
|
ref
|
|
33
33
|
) => {
|
|
34
|
+
const minusButtonGreyedOut = !value;
|
|
35
|
+
const plusButtonGreyedOut = max !== undefined && value === max;
|
|
36
|
+
|
|
34
37
|
const handleArrowUpClick = () => {
|
|
35
|
-
if (max !== undefined && value < max) {
|
|
38
|
+
if (max !== undefined && (value || 0) < max) {
|
|
36
39
|
onArrowUp(value + 1);
|
|
37
40
|
}
|
|
38
41
|
if (max === undefined) {
|
|
@@ -56,7 +59,9 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
56
59
|
<button
|
|
57
60
|
type="button"
|
|
58
61
|
onClick={handleArrowDownClick}
|
|
59
|
-
className=
|
|
62
|
+
className={`payment-number-input__btn-down ${
|
|
63
|
+
minusButtonGreyedOut && "disabled-number-input-button"
|
|
64
|
+
}`}
|
|
60
65
|
disabled={disabled}
|
|
61
66
|
>
|
|
62
67
|
−
|
|
@@ -76,7 +81,9 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
76
81
|
<button
|
|
77
82
|
type="button"
|
|
78
83
|
onClick={handleArrowUpClick}
|
|
79
|
-
className=
|
|
84
|
+
className={`payment-number-input__btn-up ${
|
|
85
|
+
plusButtonGreyedOut && "disabled-number-input-button"
|
|
86
|
+
}`}
|
|
80
87
|
disabled={disabled}
|
|
81
88
|
>
|
|
82
89
|
+
|
|
@@ -15,6 +15,7 @@ interface FormOrderItem {
|
|
|
15
15
|
name: string;
|
|
16
16
|
price: number;
|
|
17
17
|
productCategoryId: number;
|
|
18
|
+
hasDeposit?: boolean;
|
|
18
19
|
zoneId?: Zone["id"];
|
|
19
20
|
deposit?: number | null;
|
|
20
21
|
quantity: number;
|
|
@@ -40,19 +41,23 @@ export const ProductQuantityInput = ({
|
|
|
40
41
|
refCallback,
|
|
41
42
|
productInfo,
|
|
42
43
|
invalid,
|
|
43
|
-
deposit,
|
|
44
44
|
}: ProductQuantityInputProps) => {
|
|
45
45
|
const { t } = useTranslation("Design");
|
|
46
46
|
|
|
47
47
|
const onChange = (quantity: number | null) => {
|
|
48
|
+
let productQuantity = quantity;
|
|
49
|
+
if (product?.maxAmount && quantity > product?.maxAmount) {
|
|
50
|
+
productQuantity = product?.maxAmount;
|
|
51
|
+
}
|
|
48
52
|
_onChange({
|
|
49
53
|
id: product.id,
|
|
50
54
|
name: product.name,
|
|
51
|
-
deposit,
|
|
55
|
+
deposit: product?.deposit,
|
|
56
|
+
hasDeposit: category.allowDeposits,
|
|
52
57
|
price: product.price,
|
|
53
58
|
productCategoryId: category.id,
|
|
54
59
|
zoneId: category.zone?.id,
|
|
55
|
-
quantity,
|
|
60
|
+
quantity: productQuantity,
|
|
56
61
|
capacity: product?.capacity,
|
|
57
62
|
});
|
|
58
63
|
};
|
|
@@ -99,6 +104,7 @@ export const ProductQuantityInput = ({
|
|
|
99
104
|
clearErrors(`${product.id}` as const);
|
|
100
105
|
}}
|
|
101
106
|
min={0}
|
|
107
|
+
max={product?.maxAmount ? Number(product?.maxAmount) : undefined}
|
|
102
108
|
placeholder="0"
|
|
103
109
|
disabled={product.isSoldOut}
|
|
104
110
|
value={productInfo?.quantity}
|
|
@@ -201,15 +201,7 @@ export const EmailTemplateControl = React.forwardRef(
|
|
|
201
201
|
return (
|
|
202
202
|
<>
|
|
203
203
|
<Row>
|
|
204
|
-
<Form.Group
|
|
205
|
-
as={Col}
|
|
206
|
-
controlId="type"
|
|
207
|
-
xs
|
|
208
|
-
sm={12}
|
|
209
|
-
md={8}
|
|
210
|
-
lg={10}
|
|
211
|
-
xl={12}
|
|
212
|
-
>
|
|
204
|
+
<Form.Group as={Col} controlId="type" sm={12}>
|
|
213
205
|
<Form.Label>{t("type")}</Form.Label>
|
|
214
206
|
<Form.Control
|
|
215
207
|
as="select"
|
|
@@ -372,9 +364,7 @@ export const EmailTemplateControl = React.forwardRef(
|
|
|
372
364
|
if (option.type === OPTION_TYPE.checkbox) {
|
|
373
365
|
return (
|
|
374
366
|
<Form.Check
|
|
375
|
-
{...register(
|
|
376
|
-
`templateOptionValues.${option?.id}.value` as any
|
|
377
|
-
)}
|
|
367
|
+
{...register(`templateOptionValues.${option?.id}.value`)}
|
|
378
368
|
type="checkbox"
|
|
379
369
|
label={t(`Design:${option.name}`)}
|
|
380
370
|
id={option.name + option.id}
|
|
@@ -397,7 +387,7 @@ export const EmailTemplateControl = React.forwardRef(
|
|
|
397
387
|
onChange={() => {
|
|
398
388
|
setIsIncludePDF(!isIncludePDF);
|
|
399
389
|
setValue(
|
|
400
|
-
`templateOptionValues.${option.id}.value
|
|
390
|
+
`templateOptionValues.${option.id}.value`,
|
|
401
391
|
""
|
|
402
392
|
);
|
|
403
393
|
}}
|
|
@@ -413,7 +403,7 @@ export const EmailTemplateControl = React.forwardRef(
|
|
|
413
403
|
<Form.Control
|
|
414
404
|
as="select"
|
|
415
405
|
{...register(
|
|
416
|
-
`templateOptionValues.${option.id}.value`
|
|
406
|
+
`templateOptionValues.${option.id}.value`
|
|
417
407
|
)}
|
|
418
408
|
defaultValue={option.selectedValue || ""}
|
|
419
409
|
>
|
|
@@ -442,7 +432,7 @@ export const EmailTemplateControl = React.forwardRef(
|
|
|
442
432
|
</Form.Label>
|
|
443
433
|
<Form.Control
|
|
444
434
|
{...register(
|
|
445
|
-
`templateOptionValues.${option?.id}.value`
|
|
435
|
+
`templateOptionValues.${option?.id}.value`
|
|
446
436
|
)}
|
|
447
437
|
type="number"
|
|
448
438
|
placeholder={t(`Design:${option.name}`)}
|
|
@@ -12,7 +12,7 @@ import { TIME_FORMAT } from "@licklist/core/dist/Config";
|
|
|
12
12
|
import * as Config from "@licklist/core/dist/Config";
|
|
13
13
|
import { formatDateStringForEvent } from "@licklist/plugins/dist/utils/formatDate";
|
|
14
14
|
import { getOrderSourceTitle } from "@licklist/plugins/dist/utils/sourceTitle";
|
|
15
|
-
|
|
15
|
+
import { calculateTotalDiscount } from "../../../../iframe/payment/order-items-table/utils";
|
|
16
16
|
import Icon from "../../../../static/Icon";
|
|
17
17
|
|
|
18
18
|
export type ResultCardProps = {
|
|
@@ -22,8 +22,6 @@ export type ResultCardProps = {
|
|
|
22
22
|
onCardClick?: (id: number) => void;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
// @TODO integrate when API will be available
|
|
26
|
-
// activity and staff keys
|
|
27
25
|
export const ResultCard = ({
|
|
28
26
|
order,
|
|
29
27
|
className,
|
|
@@ -45,10 +43,14 @@ export const ResultCard = ({
|
|
|
45
43
|
event,
|
|
46
44
|
menu,
|
|
47
45
|
remainingToPay,
|
|
46
|
+
payments,
|
|
48
47
|
} = order;
|
|
49
48
|
|
|
49
|
+
const discount = calculateTotalDiscount(payments);
|
|
50
|
+
|
|
50
51
|
const productList = products.map((product) => product.name)?.join(", ") || "";
|
|
51
52
|
const activityName = event?.name || menu?.name || "";
|
|
53
|
+
const totalAmountWithDiscount = totalAmount - discount;
|
|
52
54
|
|
|
53
55
|
const onClick = () => {
|
|
54
56
|
if (!onCardClick) return;
|
|
@@ -108,7 +110,7 @@ export const ResultCard = ({
|
|
|
108
110
|
)}
|
|
109
111
|
<p>
|
|
110
112
|
{t("paidAmount")}:{" "}
|
|
111
|
-
{formatNumber(
|
|
113
|
+
{formatNumber(totalAmountWithDiscount, {
|
|
112
114
|
style: "currency",
|
|
113
115
|
currency: Config.Currency.GBP,
|
|
114
116
|
})}
|
|
@@ -24,6 +24,7 @@ export interface ManualBookingSummaryProps {
|
|
|
24
24
|
isFeeFetching: boolean;
|
|
25
25
|
orderDate: string;
|
|
26
26
|
relyOnPeopleType?: RelyOnPeopleType | null;
|
|
27
|
+
isMobileView?: boolean;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export const ManualBookingSummary = ({
|
|
@@ -35,6 +36,7 @@ export const ManualBookingSummary = ({
|
|
|
35
36
|
orderDate,
|
|
36
37
|
relyOnPeopleType,
|
|
37
38
|
hasBookingCategory,
|
|
39
|
+
isMobileView,
|
|
38
40
|
}: ManualBookingSummaryProps) => {
|
|
39
41
|
const { t } = useTranslation(["Design", "Sale"]);
|
|
40
42
|
const { formatNumber } = useIntl();
|
|
@@ -44,7 +46,13 @@ export const ManualBookingSummary = ({
|
|
|
44
46
|
const date = currentDate.toFormat(DATE_TIME_MANUAL_BOOKING_FORMAT);
|
|
45
47
|
const time = currentDate.toFormat(TIME_FORMAT);
|
|
46
48
|
return (
|
|
47
|
-
<div
|
|
49
|
+
<div
|
|
50
|
+
className={
|
|
51
|
+
isMobileView
|
|
52
|
+
? "manual-booking-summary-mobile"
|
|
53
|
+
: "manual-booking-summary"
|
|
54
|
+
}
|
|
55
|
+
>
|
|
48
56
|
<div className="receipt-title">{t("Sale:receipt")}</div>
|
|
49
57
|
<div className="event-name border-summary-item">{eventName}</div>
|
|
50
58
|
<div className="border-summary-item">{date}</div>
|
|
@@ -11,10 +11,13 @@ import {
|
|
|
11
11
|
rangeDatesToStringDates,
|
|
12
12
|
stringDatesToInputValue,
|
|
13
13
|
} from "./utils";
|
|
14
|
+
import { MOBILE_WIDTH } from "../../iframe/order-process/components/BookingSummary/types";
|
|
14
15
|
|
|
15
16
|
import "react-date-range/dist/styles.css";
|
|
16
17
|
import "react-date-range/dist/theme/default.css";
|
|
17
18
|
|
|
19
|
+
type DateRangeDirection = "vertical" | "horizontal";
|
|
20
|
+
|
|
18
21
|
type DateRangeInputProps = {
|
|
19
22
|
placeholder: string;
|
|
20
23
|
startDate?: string;
|
|
@@ -33,7 +36,7 @@ export const DateRangeInput = ({
|
|
|
33
36
|
disabled,
|
|
34
37
|
}: DateRangeInputProps) => {
|
|
35
38
|
const { t } = useTranslation("Design");
|
|
36
|
-
|
|
39
|
+
const [direction, setDirection] = useState<DateRangeDirection>("horizontal");
|
|
37
40
|
const [state, setState] = useState<Range[]>([
|
|
38
41
|
{
|
|
39
42
|
startDate: new Date(),
|
|
@@ -82,6 +85,24 @@ export const DateRangeInput = ({
|
|
|
82
85
|
}
|
|
83
86
|
}, [startDate, endDate]);
|
|
84
87
|
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
const resizeBodyInMobile = () => {
|
|
90
|
+
if (window.innerWidth > MOBILE_WIDTH) {
|
|
91
|
+
setDirection("horizontal");
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
setDirection("vertical");
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
resizeBodyInMobile();
|
|
99
|
+
window.addEventListener("resize", resizeBodyInMobile);
|
|
100
|
+
|
|
101
|
+
return () => {
|
|
102
|
+
window.removeEventListener("resize", resizeBodyInMobile);
|
|
103
|
+
};
|
|
104
|
+
}, []);
|
|
105
|
+
|
|
85
106
|
return (
|
|
86
107
|
<div>
|
|
87
108
|
<OverlayTrigger
|
|
@@ -94,7 +115,7 @@ export const DateRangeInput = ({
|
|
|
94
115
|
moveRangeOnFirstSelection={false}
|
|
95
116
|
ranges={state}
|
|
96
117
|
months={months}
|
|
97
|
-
direction=
|
|
118
|
+
direction={direction}
|
|
98
119
|
/>
|
|
99
120
|
<div className="mt-3 d-flex justify-content-end">
|
|
100
121
|
<Button onClick={onReset} variant="link">
|
|
@@ -23,7 +23,7 @@ export function BooleanSwitch({
|
|
|
23
23
|
const { t } = useTranslation("Design");
|
|
24
24
|
|
|
25
25
|
const options: SelectItem[] = [
|
|
26
|
-
{ id: 1, value: firstValueTitle ??
|
|
26
|
+
{ id: 1, value: firstValueTitle ?? t("yes") },
|
|
27
27
|
{ id: 0, value: secondValueTitle ?? t("no") },
|
|
28
28
|
];
|
|
29
29
|
|
|
@@ -157,6 +157,19 @@
|
|
|
157
157
|
margin-bottom: 0;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
+
|
|
161
|
+
.apply-container{
|
|
162
|
+
display: flex;
|
|
163
|
+
justify-content: space-around;
|
|
164
|
+
column-gap: 2rem;
|
|
165
|
+
margin-left: 3rem;
|
|
166
|
+
|
|
167
|
+
@include media-breakpoint-down(sm) {
|
|
168
|
+
flex-direction: row;
|
|
169
|
+
margin-left: 0rem;
|
|
170
|
+
column-gap: 1rem;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
160
173
|
}
|
|
161
174
|
|
|
162
175
|
.additional-filter-container {
|
|
@@ -230,6 +243,11 @@
|
|
|
230
243
|
transform: rotate(45deg);
|
|
231
244
|
}
|
|
232
245
|
}
|
|
246
|
+
|
|
247
|
+
@include media-breakpoint-down(sm) {
|
|
248
|
+
flex-direction: column;
|
|
249
|
+
justify-content: flex-start;
|
|
250
|
+
}
|
|
233
251
|
}
|
|
234
252
|
}
|
|
235
253
|
}
|
|
@@ -1,24 +1,49 @@
|
|
|
1
1
|
.booking-tabs-pane {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
|
+
justify-content: space-between;
|
|
4
5
|
align-items: center;
|
|
5
6
|
height: 2.75rem;
|
|
6
7
|
background-color: $white;
|
|
7
8
|
|
|
8
9
|
.booking-tabs {
|
|
9
10
|
svg {
|
|
10
|
-
g
|
|
11
|
-
fill: $white;
|
|
11
|
+
g>rect:first-child {
|
|
12
|
+
fill: $white;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
|
|
15
16
|
.active {
|
|
16
17
|
svg {
|
|
17
|
-
g
|
|
18
|
-
fill: $blue;
|
|
18
|
+
g>rect:first-child {
|
|
19
|
+
fill: $blue;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
}
|
|
23
|
+
|
|
24
|
+
@include media-breakpoint-down(sm) {
|
|
25
|
+
width: 4rem;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.content {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
width: 85%;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
|
|
35
|
+
@include media-breakpoint-down(sm) {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
align-items: start;
|
|
39
|
+
height: 4rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.booking {
|
|
43
|
+
@include media-breakpoint-down(sm) {
|
|
44
|
+
height: 13rem;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
22
47
|
}
|
|
23
48
|
|
|
24
49
|
.separator {
|
|
@@ -29,6 +54,12 @@
|
|
|
29
54
|
.children {
|
|
30
55
|
flex: 1;
|
|
31
56
|
margin-left: 1rem;
|
|
57
|
+
|
|
58
|
+
@include media-breakpoint-down(sm) {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
align-items: start;
|
|
62
|
+
}
|
|
32
63
|
}
|
|
33
64
|
|
|
34
65
|
.buttons {
|
|
@@ -61,6 +92,33 @@
|
|
|
61
92
|
border-radius: 0.625rem;
|
|
62
93
|
margin-right: 0.5rem;
|
|
63
94
|
}
|
|
95
|
+
@include media-breakpoint-down(sm) {
|
|
96
|
+
width: 12.5rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@include media-breakpoint-down(sm) {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
align-items: start;
|
|
105
|
+
gap: .5rem;
|
|
106
|
+
margin-top: .5rem;
|
|
107
|
+
white-space: nowrap;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@include media-breakpoint-down(sm) {
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: start;
|
|
114
|
+
gap: 1rem;
|
|
115
|
+
margin-top: 1rem;
|
|
116
|
+
height: 100%;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.booking {
|
|
120
|
+
@include media-breakpoint-down(sm) {
|
|
121
|
+
height: 13rem;
|
|
64
122
|
}
|
|
65
123
|
}
|
|
66
124
|
}
|