@licklist/design 0.58.11-dev.0 → 0.58.11
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/bitbucket-pipelines.yml +8 -0
- package/dist/assets/iframe/calendar.svg +2 -2
- package/dist/assets/iframe/calendar.svg.js +1 -1
- package/dist/assets/iframe/ticket.svg +2 -2
- package/dist/assets/iframe/ticket.svg.js +1 -1
- package/dist/calendar/Calendar.d.ts +1 -1
- package/dist/calendar/Calendar.d.ts.map +1 -1
- package/dist/calendar/Calendar.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/iframe/event/event-card/IframeEventCard.d.ts +1 -2
- 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 +2 -2
- 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/BookingSummaryAccordion/BookingSummaryAccordion.d.ts +2 -4
- package/dist/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.d.ts +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.d.ts +2 -4
- package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.d.ts.map +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 +0 -4
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
- package/dist/iframe/page/components/PageBody/constants.d.ts +0 -1
- package/dist/iframe/page/components/PageBody/constants.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/constants.js +1 -1
- package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.js +1 -1
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.js +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.js +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.js +1 -1
- package/dist/product-set/control/DateInput.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts +1 -4
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.d.ts +0 -1
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
- package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +1 -3
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
- package/dist/recurring-date-picker-input/utils.d.ts +0 -9
- package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/utils.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/setting/admin/AdminSettingForm.d.ts +2 -2
- package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
- package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
- package/dist/static/manual-date-picker/constants/index.d.ts +1 -4
- package/dist/static/manual-date-picker/constants/index.d.ts.map +1 -1
- package/dist/static/manual-date-picker/constants/index.js +1 -1
- package/dist/static/manual-date-picker/utils/index.d.ts +0 -4
- package/dist/static/manual-date-picker/utils/index.d.ts.map +1 -1
- package/dist/static/manual-date-picker/utils/index.js +1 -1
- package/dist/styles/iframe-events/Card.scss +8 -24
- package/dist/styles/iframe-events/PoweredBy.scss +2 -2
- package/dist/styles/iframe-order-process/IframeOrderProcess.scss +20 -57
- package/dist/styles/iframe-page/Page.scss +0 -1
- package/dist/styles/iframe-page/PageBody.scss +12 -34
- package/dist/styles/iframe-page/PageHeader.scss +39 -41
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +2 -125
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/zone/form/utils/dates.d.ts.map +1 -1
- package/jest.config.js +29 -0
- package/package.json +35 -10
- package/src/assets/iframe/calendar.svg +2 -2
- package/src/assets/iframe/ticket.svg +2 -2
- package/src/calendar/Calendar.stories.tsx +0 -23
- package/src/calendar/Calendar.tsx +5 -5
- package/src/calendar/components/CalendarDates/CalendarDates.tsx +5 -0
- package/src/iframe/event/event-card/IframeEventCard.stories.tsx +0 -1
- package/src/iframe/event/event-card/IframeEventCard.tsx +8 -7
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.stories.tsx +0 -9
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +7 -58
- package/src/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.tsx +0 -8
- package/src/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.tsx +4 -4
- package/src/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.tsx +10 -63
- package/src/iframe/order-process/components/BookingSummary/types/index.ts +0 -4
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +1 -1
- package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +1 -3
- package/src/iframe/page/components/PageBody/constants.ts +0 -2
- package/src/iframe/page/components/PageBody/hooks/useResizePageBody.ts +0 -10
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +6 -6
- package/src/iframe/payment/payment-page/PaymentPage.stories.tsx +6 -546
- package/src/iframe/payment/payment-page/PaymentPage.tsx +29 -38
- package/src/iframe/ryft/RyftPaymentForm.tsx +5 -11
- package/src/product-set/control/DateAndRecurrenceInput.tsx +1 -2
- package/src/product-set/control/DateInput.tsx +3 -1
- package/src/product-set/form/ProductCategoriesControl.tsx +1 -1
- package/src/product-set/form/ProductSetForm.tsx +1 -5
- package/src/product-set/hooks/useSortableTreeFunctions.ts +0 -2
- package/src/product-set/product/ProductControl.tsx +3 -6
- package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +2 -0
- package/src/product-set/product-category/ProductCategoryControl.tsx +43 -105
- package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +18 -4
- package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +1 -0
- package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +1 -11
- package/src/recurring-date-picker-input/utils.ts +0 -75
- package/src/sales/booking/results/BookingResults.stories.tsx +2 -3
- package/src/sales/booking/results/components/ResultCard.tsx +5 -2
- package/src/setting/admin/AdminSettingForm.tsx +2 -2
- package/src/sortable-tree/SortableTreeItem.tsx +1 -1
- package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
- package/src/static/manual-date-picker/constants/index.ts +2 -6
- package/src/static/manual-date-picker/utils/index.ts +0 -11
- package/src/static/switch/BooleanSwitch.tsx +1 -1
- package/src/styles/iframe-events/Card.scss +8 -24
- package/src/styles/iframe-events/PoweredBy.scss +2 -2
- package/src/styles/iframe-order-process/IframeOrderProcess.scss +20 -57
- package/src/styles/iframe-page/Page.scss +0 -1
- package/src/styles/iframe-page/PageBody.scss +12 -34
- package/src/styles/iframe-page/PageHeader.scss +39 -41
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +2 -125
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/zone/form/utils/dates.ts +10 -9
- package/tests/Auth/Authorizer.test.tsx +194 -0
- package/tests/Auth/Layout/UserNavDropDown.test.tsx +43 -0
- package/tests/Auth/Layout/UserNavDropDownToggle.test.tsx +33 -0
- package/tests/Auth/Login/LoginComponent.test.tsx +246 -0
- package/tests/Auth/Login/LoginFormComponent.test.tsx +182 -0
- package/tests/Auth/Register/RegisterComponent.test.tsx +285 -0
- package/tests/Auth/Register/RegisterFormComponent.test.tsx +170 -0
- package/tests/Auth/Settings/Dashboard/IpInput.test.tsx +130 -0
- package/tests/Auth/Social/SocialCallbackComponent.test.tsx +133 -0
- package/tests/Auth/Social/SocialFormComponent.test.tsx +118 -0
- package/tests/FileUpload/FileUpload.test.tsx +42 -0
- package/tests/Notification/EmailTemplate.test.tsx +82 -0
- package/tests/ProductSet/ProductSetPopover.test.tsx +40 -0
- package/tests/Report/Report.test.tsx +48 -0
- package/tests/Sales/Coupon.test.tsx +51 -0
- package/tests/Sales/SalesAndVIews.test.tsx +63 -0
- package/tests/SnippetTemplates/SnippetTemplates.test.tsx +56 -0
- package/tests/Table/FilterHelperComponent.test.tsx +88 -0
- package/tests/Table/PaginationHelperComponent.test.tsx +109 -0
- package/tests/Table/PerPageHelperComponent.test.tsx +34 -0
- package/tests/Table/TableHelperComponent.test.tsx +295 -0
- package/tests/TipTapEditor/TipTapEditor.test.tsx +28 -0
- package/tests/__mock__/hooks/useAuthApi.ts +13 -0
- package/tests/__mock__/hooks/useAuthMock.ts +13 -0
- package/tests/__mock__/hooks/useFormMock.ts +27 -0
- package/tests/__mock__/hooks/useNotificationMock.ts +13 -0
- package/tests/__mock__/hooks/useQueryMock.ts +16 -0
- package/tests/__mock__/hooks/useSocialApiMock.ts +20 -0
- package/tests/__mock__/hooks/useTranslationMock.ts +17 -0
- package/tests/__mock__/hooks/useUserApiMock.ts +18 -0
- package/tests/__mock__/hooks/useUserMock.ts +13 -0
- package/tests/__mock__/styleMock.js +1 -0
- package/tests/__mock__/windowMock.ts +5 -0
- package/tests/packages/react-query.tsx +28 -0
- package/tests/setupTests.ts +10 -0
- package/dist/iframe/ryft/utils/ryft-form.d.ts +0 -5
- package/dist/iframe/ryft/utils/ryft-form.d.ts.map +0 -1
- package/dist/iframe/ryft/utils/ryft-form.js +0 -1
- package/src/iframe/ryft/utils/ryft-form.ts +0 -47
|
@@ -29,7 +29,6 @@ interface IframeEventCardProps {
|
|
|
29
29
|
titleId?: string;
|
|
30
30
|
descriptionId?: string;
|
|
31
31
|
imageClassName?: string;
|
|
32
|
-
showMoreInfo?: boolean;
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
export function IframeEventCard({
|
|
@@ -47,7 +46,6 @@ export function IframeEventCard({
|
|
|
47
46
|
titleId,
|
|
48
47
|
descriptionId,
|
|
49
48
|
imageClassName,
|
|
50
|
-
showMoreInfo,
|
|
51
49
|
}: IframeEventCardProps) {
|
|
52
50
|
const { formatNumber } = useIntl();
|
|
53
51
|
const { t } = useTranslation("Design");
|
|
@@ -72,7 +70,6 @@ export function IframeEventCard({
|
|
|
72
70
|
)}
|
|
73
71
|
onClick={goToDetails ? onClick : undefined}
|
|
74
72
|
>
|
|
75
|
-
{showMoreInfo && <div className="iframe-event-card__info-icon">i</div>}
|
|
76
73
|
{imageSrc && (
|
|
77
74
|
<Card.Img
|
|
78
75
|
className={imageClassName ?? "card-image"}
|
|
@@ -94,8 +91,12 @@ export function IframeEventCard({
|
|
|
94
91
|
<div className="icon-wrapper">
|
|
95
92
|
<CalendarSvg />
|
|
96
93
|
</div>
|
|
97
|
-
<p className="m-0 list-view-hided">
|
|
98
|
-
|
|
94
|
+
<p className="iframe-event-card__bold m-0 list-view-hided">
|
|
95
|
+
{date}
|
|
96
|
+
</p>
|
|
97
|
+
<p className="iframe-event-card__bold m-0 grid-view-hided">
|
|
98
|
+
{shortDate}
|
|
99
|
+
</p>
|
|
99
100
|
</div>
|
|
100
101
|
</Card.Text>
|
|
101
102
|
|
|
@@ -105,7 +106,7 @@ export function IframeEventCard({
|
|
|
105
106
|
<div className="icon-wrapper">
|
|
106
107
|
<ClockSvg />
|
|
107
108
|
</div>
|
|
108
|
-
<p className="m-0">{type}</p>
|
|
109
|
+
<p className="iframe-event-card__bold m-0">{type}</p>
|
|
109
110
|
</div>
|
|
110
111
|
</Card.Text>
|
|
111
112
|
)}
|
|
@@ -116,7 +117,7 @@ export function IframeEventCard({
|
|
|
116
117
|
<div className="icon-wrapper">
|
|
117
118
|
<TicketSvg />
|
|
118
119
|
</div>
|
|
119
|
-
<p className="m-0">
|
|
120
|
+
<p className="iframe-event-card__bold m-0">
|
|
120
121
|
{t("from")}{" "}
|
|
121
122
|
{formatNumber(cost, { style: "currency", currency: "GBP" })}
|
|
122
123
|
</p>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Meta } from "@storybook/react";
|
|
3
3
|
import { BookingSummary } from "./BookingSummary";
|
|
4
|
-
import { SummaryTotalBlock } from "./components/SummaryTotal";
|
|
5
4
|
|
|
6
5
|
export default {
|
|
7
6
|
title: "Iframe/Order-Process/BookingSummary",
|
|
@@ -139,14 +138,6 @@ export function Default() {
|
|
|
139
138
|
<div className="payment-process">
|
|
140
139
|
<div className="col-lg-4">
|
|
141
140
|
<BookingSummary
|
|
142
|
-
isPaymentPage
|
|
143
|
-
eventName="new Event"
|
|
144
|
-
footer={
|
|
145
|
-
<div className="d-flex flex-column justify-content-between">
|
|
146
|
-
<SummaryTotalBlock label={"Total"} amount={2} />
|
|
147
|
-
<SummaryTotalBlock label={"Total with discount"} amount={1} />
|
|
148
|
-
</div>
|
|
149
|
-
}
|
|
150
141
|
date="29 Sept 2022 at 09:00"
|
|
151
142
|
menuSteps={menuSteps as any}
|
|
152
143
|
peopleAmount={5}
|
|
@@ -8,8 +8,6 @@ import { ProductsByMenuStep } from "./components/ProductsByMenuStep";
|
|
|
8
8
|
import { BookingSummaryProps } from "./types";
|
|
9
9
|
import { SummaryTotal } from "./components/SummaryTotal";
|
|
10
10
|
import { BookingSummaryAccordion } from "./components/BookingSummaryAccordion";
|
|
11
|
-
import { ReactComponent as TicketIcon } from "../../../../assets/iframe/ticket.svg";
|
|
12
|
-
import { ReactComponent as CalendarIcon } from "../../../../assets/iframe/calendar.svg";
|
|
13
11
|
|
|
14
12
|
export const BookingSummary = ({
|
|
15
13
|
date,
|
|
@@ -24,10 +22,6 @@ export const BookingSummary = ({
|
|
|
24
22
|
hasPeopleInput,
|
|
25
23
|
isPaymentLink,
|
|
26
24
|
peopleAmount,
|
|
27
|
-
footer,
|
|
28
|
-
headerComponent,
|
|
29
|
-
// TODO Remove this, when all iframe pages will be ready
|
|
30
|
-
isPaymentPage,
|
|
31
25
|
}: Omit<BookingSummaryProps, "totallWithDiscount">) => {
|
|
32
26
|
const { t } = useTranslation("Design");
|
|
33
27
|
const { formatNumber } = useIntl();
|
|
@@ -42,18 +36,11 @@ export const BookingSummary = ({
|
|
|
42
36
|
|
|
43
37
|
return (
|
|
44
38
|
<div className="payment-booking-summary">
|
|
45
|
-
<BookingSummaryAccordion
|
|
46
|
-
isPaymentPage={isPaymentPage}
|
|
47
|
-
hasPeopleInput={hasPeopleInput}
|
|
48
|
-
headerComponent={headerComponent}
|
|
49
|
-
>
|
|
39
|
+
<BookingSummaryAccordion hasPeopleInput={hasPeopleInput}>
|
|
50
40
|
<div className="event-info">
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
date={date}
|
|
55
|
-
time={time}
|
|
56
|
-
/>
|
|
41
|
+
<p className="m-0 title event-name">{eventName}</p>
|
|
42
|
+
<p className="m-0">{date}</p>
|
|
43
|
+
{time && <p className="m-0">{time}</p>}
|
|
57
44
|
</div>
|
|
58
45
|
<hr />
|
|
59
46
|
|
|
@@ -75,8 +62,8 @@ export const BookingSummary = ({
|
|
|
75
62
|
{!shouldHidePeopleAmount && peopleAmount > 0 && (
|
|
76
63
|
<>
|
|
77
64
|
<hr />
|
|
78
|
-
<div className="d-flex justify-content-between mt-3
|
|
79
|
-
<p className="m-0
|
|
65
|
+
<div className="d-flex justify-content-between mt-3">
|
|
66
|
+
<p className="m-0">{t("people")}:</p>
|
|
80
67
|
<p className="price">{peopleAmount}</p>
|
|
81
68
|
</div>
|
|
82
69
|
</>
|
|
@@ -86,9 +73,7 @@ export const BookingSummary = ({
|
|
|
86
73
|
<>
|
|
87
74
|
<hr />
|
|
88
75
|
<div className="d-flex justify-content-between mt-3">
|
|
89
|
-
<p className="m-0
|
|
90
|
-
{t("transactionFee")}:
|
|
91
|
-
</p>
|
|
76
|
+
<p className="m-0">{t("transactionFee")}:</p>
|
|
92
77
|
<p className="price">
|
|
93
78
|
{formatNumber(transactionFee, {
|
|
94
79
|
style: "currency",
|
|
@@ -99,7 +84,6 @@ export const BookingSummary = ({
|
|
|
99
84
|
</>
|
|
100
85
|
)}
|
|
101
86
|
</div>
|
|
102
|
-
{footer}
|
|
103
87
|
</div>
|
|
104
88
|
) : (
|
|
105
89
|
<div className="cart-items">
|
|
@@ -113,38 +97,3 @@ export const BookingSummary = ({
|
|
|
113
97
|
|
|
114
98
|
BookingSummary.SummaryTotal = SummaryTotal;
|
|
115
99
|
BookingSummary.Accordion = BookingSummaryAccordion;
|
|
116
|
-
|
|
117
|
-
const EventInfo = ({
|
|
118
|
-
isPaymentPage,
|
|
119
|
-
eventName,
|
|
120
|
-
date,
|
|
121
|
-
time,
|
|
122
|
-
}: Pick<
|
|
123
|
-
BookingSummaryProps,
|
|
124
|
-
"date" | "time" | "eventName" | "isPaymentPage"
|
|
125
|
-
>) => {
|
|
126
|
-
if (isPaymentPage) {
|
|
127
|
-
return (
|
|
128
|
-
<>
|
|
129
|
-
<div className="d-flex align-items-center mb-5">
|
|
130
|
-
<TicketIcon height={16} width={20} fill="black" />
|
|
131
|
-
<div className="m-0 pl-2 title event-name metadata">{eventName}</div>
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
<div className="d-flex align-items-center mb-5">
|
|
135
|
-
<CalendarIcon height={16} width={20} fill="black" />
|
|
136
|
-
<div className="m-0 pl-2 metadata">{date}</div>
|
|
137
|
-
</div>
|
|
138
|
-
{time && <div className="mb-5 metadata">{time}</div>}
|
|
139
|
-
</>
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return (
|
|
144
|
-
<>
|
|
145
|
-
<p className="m-0 title event-name">{eventName}</p>
|
|
146
|
-
<p className="m-0">{date}</p>
|
|
147
|
-
{time && <p className="m-0">{time}</p>}
|
|
148
|
-
</>
|
|
149
|
-
);
|
|
150
|
-
};
|
|
@@ -3,7 +3,6 @@ import React, {
|
|
|
3
3
|
useCallback,
|
|
4
4
|
PropsWithChildren,
|
|
5
5
|
useEffect,
|
|
6
|
-
ReactElement,
|
|
7
6
|
} from "react";
|
|
8
7
|
import { Accordion } from "react-bootstrap";
|
|
9
8
|
import { useWindowDimensions } from "@licklist/plugins/dist/hooks/Media/useWindowDimensions";
|
|
@@ -21,9 +20,6 @@ export type BookingSummaryAccordionProps = PropsWithChildren<{
|
|
|
21
20
|
title?: string;
|
|
22
21
|
showTitleOnlyOnMobile?: boolean;
|
|
23
22
|
hasPeopleInput?: boolean;
|
|
24
|
-
// TODO Remove this, when all iframe pages will be ready
|
|
25
|
-
isPaymentPage?: boolean;
|
|
26
|
-
headerComponent?: ReactElement;
|
|
27
23
|
}>;
|
|
28
24
|
|
|
29
25
|
export const BookingSummaryAccordion = ({
|
|
@@ -31,8 +27,6 @@ export const BookingSummaryAccordion = ({
|
|
|
31
27
|
title,
|
|
32
28
|
showTitleOnlyOnMobile = false,
|
|
33
29
|
hasPeopleInput,
|
|
34
|
-
isPaymentPage,
|
|
35
|
-
headerComponent,
|
|
36
30
|
}: BookingSummaryAccordionProps) => {
|
|
37
31
|
const { width } = useWindowDimensions();
|
|
38
32
|
const [isExpanded, setIsExpanded] = useState(width <= MOBILE_WIDTH);
|
|
@@ -74,12 +68,10 @@ export const BookingSummaryAccordion = ({
|
|
|
74
68
|
return (
|
|
75
69
|
<Accordion defaultActiveKey={ACCORDION_KEY} onSelect={onSelect}>
|
|
76
70
|
<ToggleHeader
|
|
77
|
-
isPaymentPage={isPaymentPage}
|
|
78
71
|
showExpandButton={showExpandButton}
|
|
79
72
|
isExpanded={isExpanded}
|
|
80
73
|
title={title}
|
|
81
74
|
hideComponent={!showToggleHeader}
|
|
82
|
-
headerComponent={headerComponent}
|
|
83
75
|
/>
|
|
84
76
|
<Accordion.Collapse
|
|
85
77
|
eventKey={ACCORDION_KEY}
|
|
@@ -3,7 +3,7 @@ import { useIntl } from "react-intl";
|
|
|
3
3
|
import * as Config from "@licklist/core/dist/Config";
|
|
4
4
|
|
|
5
5
|
export type SummaryTotalBlockProps = {
|
|
6
|
-
label
|
|
6
|
+
label: string;
|
|
7
7
|
amount: number;
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -15,13 +15,13 @@ export const SummaryTotalBlock = ({
|
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
17
|
<div className="total">
|
|
18
|
-
|
|
19
|
-
<
|
|
18
|
+
<p className="m-0">{label}</p>
|
|
19
|
+
<p className="m-0 price">
|
|
20
20
|
{formatNumber(amount, {
|
|
21
21
|
style: "currency",
|
|
22
22
|
currency: Config.Currency.GBP,
|
|
23
23
|
})}
|
|
24
|
-
</
|
|
24
|
+
</p>
|
|
25
25
|
</div>
|
|
26
26
|
);
|
|
27
27
|
};
|
package/src/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useContext, useEffect } from "react";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
3
|
import { useAccordionToggle } from "react-bootstrap/AccordionToggle";
|
|
4
4
|
import AccordionContext from "react-bootstrap/AccordionContext";
|
|
@@ -11,23 +11,15 @@ type ToggleHeaderProps = {
|
|
|
11
11
|
isExpanded: boolean;
|
|
12
12
|
title?: string;
|
|
13
13
|
hideComponent?: boolean;
|
|
14
|
-
headerComponent?: ReactElement;
|
|
15
|
-
isPaymentPage: boolean;
|
|
16
14
|
};
|
|
17
15
|
|
|
18
|
-
interface HeaderContentProps
|
|
19
|
-
extends Omit<ToggleHeaderProps, "hideComponent" | "isExpanded"> {
|
|
20
|
-
currentEventKey: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
16
|
export const ToggleHeader = ({
|
|
24
17
|
showExpandButton,
|
|
25
18
|
isExpanded,
|
|
26
19
|
title,
|
|
27
20
|
hideComponent,
|
|
28
|
-
isPaymentPage,
|
|
29
|
-
headerComponent,
|
|
30
21
|
}: ToggleHeaderProps) => {
|
|
22
|
+
const { t } = useTranslation("Design");
|
|
31
23
|
const currentEventKey = useContext(AccordionContext);
|
|
32
24
|
|
|
33
25
|
const decoratedOnClick = useAccordionToggle(ACCORDION_KEY);
|
|
@@ -54,41 +46,14 @@ export const ToggleHeader = ({
|
|
|
54
46
|
onKeyPress={(event) => showExpandButton && decoratedOnClick(event)}
|
|
55
47
|
role="button"
|
|
56
48
|
tabIndex={0}
|
|
57
|
-
className=
|
|
58
|
-
"d-flex flex-column",
|
|
59
|
-
isPaymentPage && "payment-page-toggle"
|
|
60
|
-
)}
|
|
49
|
+
className="d-flex flex-column"
|
|
61
50
|
>
|
|
62
51
|
<h6 className={clsx("title", showExpandButton && "pointer")}>
|
|
63
52
|
<div className="d-flex w-100 align-content-center justify-content-between">
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
currentEventKey={currentEventKey}
|
|
68
|
-
isPaymentPage={isPaymentPage}
|
|
69
|
-
headerComponent={headerComponent}
|
|
70
|
-
/>
|
|
71
|
-
</div>
|
|
72
|
-
</h6>
|
|
73
|
-
{isExpanded && <hr className="mt-3" />}
|
|
74
|
-
</div>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
53
|
+
<div className="d-flex">
|
|
54
|
+
<p className="m-0">{title || t("yourBooking")}</p>
|
|
55
|
+
</div>
|
|
77
56
|
|
|
78
|
-
const HeaderContent = ({
|
|
79
|
-
title,
|
|
80
|
-
showExpandButton,
|
|
81
|
-
currentEventKey,
|
|
82
|
-
isPaymentPage,
|
|
83
|
-
headerComponent,
|
|
84
|
-
}: HeaderContentProps) => {
|
|
85
|
-
const { t } = useTranslation("Design");
|
|
86
|
-
|
|
87
|
-
if (isPaymentPage) {
|
|
88
|
-
return (
|
|
89
|
-
<>
|
|
90
|
-
<div className="d-flex">
|
|
91
|
-
<p className="m-0 mr-2 toggle-title">{title || t("yourBooking")}</p>
|
|
92
57
|
{showExpandButton && (
|
|
93
58
|
<div className="expand-button">
|
|
94
59
|
<Icon
|
|
@@ -97,31 +62,13 @@ const HeaderContent = ({
|
|
|
97
62
|
? "chevron-up"
|
|
98
63
|
: "chevron-down"
|
|
99
64
|
}
|
|
100
|
-
width="
|
|
65
|
+
width="1rem"
|
|
101
66
|
/>
|
|
102
67
|
</div>
|
|
103
68
|
)}
|
|
104
69
|
</div>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
return (
|
|
110
|
-
<>
|
|
111
|
-
<div className="d-flex">
|
|
112
|
-
<p className="m-0">{title || t("yourBooking")}</p>
|
|
113
|
-
</div>
|
|
114
|
-
|
|
115
|
-
{showExpandButton && (
|
|
116
|
-
<div className="expand-button">
|
|
117
|
-
<Icon
|
|
118
|
-
type={
|
|
119
|
-
currentEventKey === ACCORDION_KEY ? "chevron-up" : "chevron-down"
|
|
120
|
-
}
|
|
121
|
-
width="1rem"
|
|
122
|
-
/>
|
|
123
|
-
</div>
|
|
124
|
-
)}
|
|
125
|
-
</>
|
|
70
|
+
</h6>
|
|
71
|
+
{isExpanded && <hr className="mt-3" />}
|
|
72
|
+
</div>
|
|
126
73
|
);
|
|
127
74
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
2
2
|
import { OrderItems } from "@licklist/plugins/dist/types/context/Iframe/orderItems";
|
|
3
3
|
import { MenuStep } from "@licklist/plugins/dist/types/context/sale/menuSteps";
|
|
4
|
-
import { ReactElement } from "react";
|
|
5
4
|
|
|
6
5
|
export const MOBILE_WIDTH = 576;
|
|
7
6
|
export const ACCORDION_KEY = "booking-summary";
|
|
@@ -21,7 +20,4 @@ export type BookingSummaryProps = {
|
|
|
21
20
|
isLoading?: boolean;
|
|
22
21
|
peopleAmount: number;
|
|
23
22
|
isPaymentLink?: boolean;
|
|
24
|
-
isPaymentPage?: boolean;
|
|
25
|
-
headerComponent?: ReactElement;
|
|
26
|
-
footer?: ReactElement;
|
|
27
23
|
};
|
package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx
CHANGED
|
@@ -90,7 +90,7 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
90
90
|
type="number"
|
|
91
91
|
onChange={(e) => handleChangeValue(Number(e.target.value))}
|
|
92
92
|
value={value}
|
|
93
|
-
min={
|
|
93
|
+
min={min}
|
|
94
94
|
max={max}
|
|
95
95
|
defaultValue={defaultValue}
|
|
96
96
|
placeholder={placeholder}
|
|
@@ -25,6 +25,4 @@ export const COLLAPSE_MARGIN = 36;
|
|
|
25
25
|
|
|
26
26
|
export const PAGE_LEFT_BLOCK_CONTAINER_ID = "page-left-block-container";
|
|
27
27
|
export const PAGE_CALENDAR_SELECT_WRAPPER = "calendar-select-wrapper";
|
|
28
|
-
export const PAGE_BODY_WITH_SCROLL = "page-body-with-scroll";
|
|
29
|
-
|
|
30
28
|
export const PAGE_LEFT_BLOCK_MAP_DEFAULT_SIZE = 300;
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
PAGE_LEFT_BLOCK_CONTAINER_ID,
|
|
17
17
|
PAGE_LEFT_BLOCK_MAP_DEFAULT_SIZE,
|
|
18
18
|
PAGE_CALENDAR_SELECT_WRAPPER,
|
|
19
|
-
PAGE_BODY_WITH_SCROLL,
|
|
20
19
|
} from "../constants";
|
|
21
20
|
import { ChangeRightBlockHeightEvent } from "../types";
|
|
22
21
|
|
|
@@ -47,19 +46,10 @@ export const useResizePageBody = () => {
|
|
|
47
46
|
const calenderWrapper = document.getElementById(
|
|
48
47
|
PAGE_CALENDAR_SELECT_WRAPPER
|
|
49
48
|
);
|
|
50
|
-
|
|
51
49
|
const CALENDAR_WRAPPER_HEIGHT = calenderWrapper
|
|
52
50
|
? calenderWrapper.clientHeight
|
|
53
51
|
: 0;
|
|
54
52
|
|
|
55
|
-
const paymentLinkPageBody = document.getElementById(PAGE_BODY_WITH_SCROLL);
|
|
56
|
-
if (paymentLinkPageBody) {
|
|
57
|
-
paymentLinkPageBody.scroll({
|
|
58
|
-
top: -height,
|
|
59
|
-
behavior: "smooth",
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
53
|
return {
|
|
64
54
|
maxHeight:
|
|
65
55
|
height -
|
|
@@ -63,7 +63,7 @@ const processedPaymentSummary = ({
|
|
|
63
63
|
const total = calculateTotalPrice(order, externalPaymentDetail);
|
|
64
64
|
|
|
65
65
|
const totalDiscount = calculateTotalDiscount(order.payments);
|
|
66
|
-
|
|
66
|
+
const totalWithDiscount = total - Number(totalDiscount);
|
|
67
67
|
let summaryItems: SummaryItem[] = [
|
|
68
68
|
{
|
|
69
69
|
translateKey: AMOUNT_TOTAL,
|
|
@@ -74,7 +74,7 @@ const processedPaymentSummary = ({
|
|
|
74
74
|
if (totalDiscount) {
|
|
75
75
|
summaryItems.push({
|
|
76
76
|
translateKey: AMOUNT_WITH_DISCOUNT,
|
|
77
|
-
price:
|
|
77
|
+
price: totalWithDiscount < 0 ? 0 : totalWithDiscount,
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -84,17 +84,17 @@ const processedPaymentSummary = ({
|
|
|
84
84
|
|
|
85
85
|
summaryItems.push({
|
|
86
86
|
translateKey: TOTAL_PAID,
|
|
87
|
-
price: order.
|
|
87
|
+
price: totalWithDiscount <= 0 ? 0 : order.totalAmount,
|
|
88
88
|
});
|
|
89
|
-
if (
|
|
89
|
+
if (totalWithDiscount <= 0) {
|
|
90
90
|
return summaryItems;
|
|
91
91
|
}
|
|
92
92
|
summaryItems = [...summaryItems, ...externalPaymentDetail];
|
|
93
93
|
|
|
94
|
-
if (order.
|
|
94
|
+
if (totalWithDiscount > order.totalAmount) {
|
|
95
95
|
summaryItems.push({
|
|
96
96
|
translateKey: REMAINING_TO_PAY,
|
|
97
|
-
price: order.
|
|
97
|
+
price: totalWithDiscount - order.totalAmount,
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
return summaryItems;
|