@licklist/design 0.68.2 → 0.68.5-dev.0
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/affiliate/form/AffiliateForm.d.ts.map +1 -1
- package/dist/auth/Login/LoginComponent.js +2 -1
- package/dist/calendar/components/CalendarButtons/CalendarButtons.d.ts.map +1 -1
- package/dist/calendar/components/CalendarButtons/CalendarButtons.js +35 -40
- package/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
- package/dist/events/edit-event-modal/IntervalInput.js +7 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +0 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +24 -23
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +0 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.js +2 -2
- 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 +2 -0
- package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.js +0 -1
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/layout/DropDown.d.ts +2 -1
- package/dist/layout/DropDown.d.ts.map +1 -1
- package/dist/modals/confirmation/ConfirmModal.d.ts +3 -1
- package/dist/modals/confirmation/ConfirmModal.d.ts.map +1 -1
- package/dist/modals/confirmation/ConfirmModal.js +172 -8
- package/dist/product-set/card/ProductSetCard.d.ts +6 -2
- package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
- package/dist/product-set/card/ProductSetCard.js +30 -11
- package/dist/product-set/control/DateInput.d.ts.map +1 -1
- package/dist/product-set/control/DateInput.js +2 -2
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +48 -2
- package/dist/product-set/form/ProductSetForm.d.ts +4 -1
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +59 -1
- package/dist/product-set/form/ProductSetNameControl.d.ts +6 -0
- package/dist/product-set/form/ProductSetNameControl.d.ts.map +1 -0
- package/dist/product-set/form/ProductSetNameControl.js +35 -0
- package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductZonesControl.js +0 -2
- package/dist/product-set/form/SelectCategoryModal.d.ts +12 -0
- package/dist/product-set/form/SelectCategoryModal.d.ts.map +1 -1
- package/dist/product-set/form/SelectCategoryModal.js +1 -1
- package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/SubProductsControl.js +0 -3
- package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
- package/dist/product-set/form/VenueMapsControl.js +0 -3
- package/dist/product-set/form/index.d.ts +1 -0
- package/dist/product-set/form/index.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/utils/index.d.ts +7 -0
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.js +10 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +0 -2
- package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.js +6 -0
- package/dist/sortable-tree/SortableTreeItem.d.ts +2 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.js +10 -4
- package/dist/styles/iframe-events/Calendar.scss +0 -1
- package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/dist/styles/iframe-page/PageBody.scss +1 -1
- package/dist/styles/product-set/ProductSetForm.scss +22 -0
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/tiptap-editor/TipTapMenu/extensions/constants.d.ts +2 -0
- package/dist/tiptap-editor/TipTapMenu/extensions/constants.d.ts.map +1 -0
- package/dist/tiptap-editor/TipTapMenu/extensions/constants.js +3 -0
- package/dist/tiptap-editor/TipTapMenu/extensions/utils.d.ts +1 -1
- package/dist/tiptap-editor/TipTapMenu/extensions/utils.d.ts.map +1 -1
- package/dist/tiptap-editor/TipTapMenu/extensions/utils.js +3 -1
- package/dist/typeahead/Typeahead.d.ts +5 -1
- package/dist/typeahead/Typeahead.d.ts.map +1 -1
- package/dist/typeahead/Typeahead.js +9 -2
- package/package.json +8 -6
- package/src/affiliate/form/AffiliateForm.tsx +1 -0
- package/src/auth/Login/LoginComponent.tsx +1 -1
- package/src/calendar/components/CalendarButtons/CalendarButtons.tsx +29 -28
- package/src/events/edit-event-modal/IntervalInput.tsx +8 -1
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +0 -1
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +82 -85
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +0 -1
- package/src/iframe/event/event-card/IframeEventCard.tsx +30 -29
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +1 -0
- package/src/iframe/page/components/PageBody/hooks/useResizePageBody.ts +0 -1
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -0
- package/src/layout/DropDown.tsx +2 -1
- package/src/modals/confirmation/ConfirmModal.tsx +19 -3
- package/src/product-set/card/ProductSetCard.tsx +47 -8
- package/src/product-set/control/DateInput.tsx +2 -1
- package/src/product-set/form/ProductCategoriesControl.tsx +37 -1
- package/src/product-set/form/ProductSetForm.tsx +17 -2
- package/src/product-set/form/ProductSetNameControl.tsx +27 -0
- package/src/product-set/form/ProductZonesControl.tsx +1 -4
- package/src/product-set/form/SelectCategoryModal.tsx +2 -2
- package/src/product-set/form/SubProductsControl.tsx +0 -3
- package/src/product-set/form/VenueMapsControl.tsx +0 -3
- package/src/product-set/form/index.ts +1 -0
- package/src/product-set/product/ProductControl.tsx +0 -1
- package/src/product-set/product/advanced-options/AdvancedOptions.tsx +1 -1
- package/src/product-set/product-zone/ProductZoneControl.tsx +1 -1
- package/src/product-set/utils/index.ts +11 -0
- package/src/sales/booking/results/components/ResultCard.tsx +0 -2
- package/src/snippet/snippet-template/preview/Preview.tsx +6 -0
- package/src/sortable-tree/SortableTreeItem.tsx +6 -0
- package/src/styles/iframe-events/Calendar.scss +0 -1
- package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/src/styles/iframe-page/PageBody.scss +1 -1
- package/src/styles/product-set/ProductSetForm.scss +22 -0
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/tiptap-editor/TipTapMenu/extensions/constants.ts +1 -0
- package/src/tiptap-editor/TipTapMenu/extensions/utils.ts +4 -1
- package/src/typeahead/Typeahead.tsx +15 -1
- package/yarn.lock +59 -33
- package/dist/assets/iframe/selectArrow.svg.js +0 -17
|
@@ -2,7 +2,7 @@ import { useCallback, useMemo } from 'react'
|
|
|
2
2
|
import { Button } from 'react-bootstrap'
|
|
3
3
|
import { useTranslation } from 'react-i18next'
|
|
4
4
|
import { range } from 'lodash'
|
|
5
|
-
import {
|
|
5
|
+
import { DateTime } from 'luxon'
|
|
6
6
|
import { CalendarSelect } from '../CalendarSelect'
|
|
7
7
|
import { CalendarProps } from '../../Calendar'
|
|
8
8
|
|
|
@@ -26,15 +26,21 @@ export const CalendarButtons = ({
|
|
|
26
26
|
}: CalendarButtonsProps) => {
|
|
27
27
|
const { t } = useTranslation('Design')
|
|
28
28
|
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const onSelectMonth = useCallback(
|
|
30
|
+
(value: string) => {
|
|
31
|
+
const selectedMonth = Number(value)
|
|
32
|
+
const nextDateTime = currentDate.set({ month: selectedMonth })
|
|
33
|
+
|
|
34
|
+
if (nextDateTime <= initialDate) {
|
|
35
|
+
setCurrentDate(initialDate)
|
|
36
|
+
return
|
|
37
|
+
}
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
setCurrentDate(nextDateTime)
|
|
40
|
+
},
|
|
36
41
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
37
|
-
|
|
42
|
+
[setCurrentDate, currentDate],
|
|
43
|
+
)
|
|
38
44
|
|
|
39
45
|
const yearOptions = useMemo(
|
|
40
46
|
() =>
|
|
@@ -45,10 +51,16 @@ export const CalendarButtons = ({
|
|
|
45
51
|
[initialDate],
|
|
46
52
|
)
|
|
47
53
|
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
const monthOptions = useMemo(() => {
|
|
55
|
+
const initialMonth =
|
|
56
|
+
currentDate.year > initialDate.year ? 1 : initialDate.month
|
|
57
|
+
return range(initialMonth, 13).map((monthNumber) => ({
|
|
58
|
+
label: DateTime.fromObject({ month: monthNumber }).toLocaleString({
|
|
59
|
+
month: 'long',
|
|
60
|
+
}),
|
|
61
|
+
value: monthNumber,
|
|
62
|
+
}))
|
|
63
|
+
}, [initialDate, currentDate])
|
|
52
64
|
|
|
53
65
|
const onSelectYear = (value: string) => {
|
|
54
66
|
const selectedYear = Number(value)
|
|
@@ -110,22 +122,11 @@ export const CalendarButtons = ({
|
|
|
110
122
|
<hr />
|
|
111
123
|
<div className="calendar-buttons">
|
|
112
124
|
<div className="buttons-wrapper">
|
|
113
|
-
<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
>
|
|
119
|
-
<SelectArrow />
|
|
120
|
-
</Button>
|
|
121
|
-
<div className="month-title">{currentDate.toFormat('MMMM')}</div>
|
|
122
|
-
<Button
|
|
123
|
-
className="calendar-button"
|
|
124
|
-
onClick={onSelectNextMonth}
|
|
125
|
-
variant="link"
|
|
126
|
-
>
|
|
127
|
-
<SelectArrow />
|
|
128
|
-
</Button>
|
|
125
|
+
<CalendarSelect
|
|
126
|
+
options={monthOptions}
|
|
127
|
+
onChange={onSelectMonth}
|
|
128
|
+
value={currentDate.month}
|
|
129
|
+
/>
|
|
129
130
|
</div>
|
|
130
131
|
<CalendarSelect
|
|
131
132
|
options={yearOptions}
|
|
@@ -89,6 +89,13 @@ export function IntervalInput({
|
|
|
89
89
|
trigger('end')
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
const onChangeRecurrent = (checked: boolean) => {
|
|
93
|
+
setRecurrent(checked)
|
|
94
|
+
if (!checked) {
|
|
95
|
+
setValue('rrule', null)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
92
99
|
return (
|
|
93
100
|
<>
|
|
94
101
|
<Form.Row className="interval-container">
|
|
@@ -144,7 +151,7 @@ export function IntervalInput({
|
|
|
144
151
|
custom
|
|
145
152
|
checked={recurrent}
|
|
146
153
|
onChange={({ target: { checked } }) => {
|
|
147
|
-
|
|
154
|
+
onChangeRecurrent(checked)
|
|
148
155
|
}}
|
|
149
156
|
disabled={disabled || Boolean(editedProductSet)}
|
|
150
157
|
/>
|
package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx
CHANGED
|
@@ -5,9 +5,11 @@ import { useId } from '@react-aria/utils'
|
|
|
5
5
|
import { Controller, useFormContext } from 'react-hook-form'
|
|
6
6
|
import { HasPermissionProp } from '@licklist/plugins/dist/types/permission/Permission'
|
|
7
7
|
import { ProductSet } from '@licklist/core/dist/DataMapper/Product/ProductSetDataMapper'
|
|
8
|
+
import { getTypeHeadItemsFromMenus } from '../../../../product-set/utils'
|
|
8
9
|
import { ConfirmModal } from '../../../../modals/confirmation/ConfirmModal'
|
|
9
10
|
import { EditEventFormValues } from '../EditEventForm/EditEventForm'
|
|
10
11
|
import { EditEventProductSet } from './component/EditEventProductSet'
|
|
12
|
+
import { Typeahead } from '../../../../typeahead'
|
|
11
13
|
|
|
12
14
|
interface SelectEventProductSetProps extends HasPermissionProp {
|
|
13
15
|
productSets?: ProductSet[]
|
|
@@ -42,6 +44,21 @@ export const SelectEventProductSet = ({
|
|
|
42
44
|
const productSetId = watch('productSetId')
|
|
43
45
|
const editedProductSet = watch('editedProductSet')
|
|
44
46
|
|
|
47
|
+
const typeheadValues = getTypeHeadItemsFromMenus(
|
|
48
|
+
editedProductSet
|
|
49
|
+
? productSets.map((productSet) => {
|
|
50
|
+
if (productSet.id === editedProductSet.id) {
|
|
51
|
+
return editedProductSet
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return productSet
|
|
55
|
+
})
|
|
56
|
+
: productSets,
|
|
57
|
+
)
|
|
58
|
+
const selectedProductSetTypeheadValue = productSetId
|
|
59
|
+
? typeheadValues?.find((typeheadValue) => typeheadValue.id === productSetId)
|
|
60
|
+
: undefined
|
|
61
|
+
|
|
45
62
|
const onEditProductSet = useCallback(
|
|
46
63
|
() => {
|
|
47
64
|
setEditProductSetId(String(productSetId))
|
|
@@ -95,6 +112,7 @@ export const SelectEventProductSet = ({
|
|
|
95
112
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
96
113
|
const onSubmit = (value: EditEventFormValues['editedProductSet']) => {
|
|
97
114
|
setShowEditProductSet(false)
|
|
115
|
+
setValue('productSetId', value.id)
|
|
98
116
|
setValue('editedProductSet', value)
|
|
99
117
|
}
|
|
100
118
|
|
|
@@ -110,93 +128,72 @@ export const SelectEventProductSet = ({
|
|
|
110
128
|
<Controller
|
|
111
129
|
control={control}
|
|
112
130
|
name="productSetId"
|
|
113
|
-
render={(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
</Button>
|
|
172
|
-
)}
|
|
173
|
-
{showEditProductSet && (
|
|
174
|
-
<Button
|
|
175
|
-
variant=""
|
|
176
|
-
className="btn product-set-button"
|
|
177
|
-
onClick={revertEditProductSet}
|
|
178
|
-
>
|
|
179
|
-
{t('cancelAndRevert')}
|
|
180
|
-
</Button>
|
|
181
|
-
)}
|
|
182
|
-
{!showEditProductSet && editedProductSet && (
|
|
183
|
-
<Button
|
|
184
|
-
variant=""
|
|
185
|
-
className="btn product-set-button ml-4 text-danger"
|
|
186
|
-
onClick={revertEditProductSet}
|
|
187
|
-
>
|
|
188
|
-
{t('undoChanges')}
|
|
189
|
-
</Button>
|
|
190
|
-
)}
|
|
191
|
-
</div>
|
|
131
|
+
render={() => (
|
|
132
|
+
<>
|
|
133
|
+
<div className="d-flex align-items-center flex-row w-100">
|
|
134
|
+
<ConfirmModal>
|
|
135
|
+
{(confirm) => (
|
|
136
|
+
<Typeahead
|
|
137
|
+
name="productSetId"
|
|
138
|
+
value={selectedProductSetTypeheadValue}
|
|
139
|
+
containerStyles={{ width: '100%' }}
|
|
140
|
+
onChangeValue={(typeheadValue) => {
|
|
141
|
+
onChangeProductSet(Number(typeheadValue.id), confirm)
|
|
142
|
+
}}
|
|
143
|
+
options={typeheadValues}
|
|
144
|
+
placeholder={t('Design:choose')}
|
|
145
|
+
noOptionsMessage={t('Design:noAvailableProductSets')}
|
|
146
|
+
/>
|
|
147
|
+
)}
|
|
148
|
+
</ConfirmModal>
|
|
149
|
+
|
|
150
|
+
<div className="buttons-container">
|
|
151
|
+
{!showEditProductSet && !editedProductSet && (
|
|
152
|
+
<Button
|
|
153
|
+
variant=""
|
|
154
|
+
className="btn product-set-button mr-4"
|
|
155
|
+
onClick={handleCreateProductSet}
|
|
156
|
+
>
|
|
157
|
+
{t('addNewProductSet')}
|
|
158
|
+
</Button>
|
|
159
|
+
)}
|
|
160
|
+
{showOverrideProductSet && (
|
|
161
|
+
<Button
|
|
162
|
+
variant=""
|
|
163
|
+
className="btn product-set-button "
|
|
164
|
+
onClick={onEditProductSet}
|
|
165
|
+
>
|
|
166
|
+
{isOverrideProductSet
|
|
167
|
+
? t('editOverrides')
|
|
168
|
+
: t('editProductSet')}
|
|
169
|
+
</Button>
|
|
170
|
+
)}
|
|
171
|
+
{showEditProductSet && (
|
|
172
|
+
<Button
|
|
173
|
+
variant=""
|
|
174
|
+
className="btn product-set-button"
|
|
175
|
+
onClick={revertEditProductSet}
|
|
176
|
+
>
|
|
177
|
+
{t('cancelAndRevert')}
|
|
178
|
+
</Button>
|
|
179
|
+
)}
|
|
180
|
+
{!showEditProductSet && editedProductSet && (
|
|
181
|
+
<Button
|
|
182
|
+
variant=""
|
|
183
|
+
className="btn product-set-button ml-4 text-danger"
|
|
184
|
+
onClick={revertEditProductSet}
|
|
185
|
+
>
|
|
186
|
+
{t('undoChanges')}
|
|
187
|
+
</Button>
|
|
188
|
+
)}
|
|
192
189
|
</div>
|
|
190
|
+
</div>
|
|
193
191
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}}
|
|
192
|
+
<Form.Control.Feedback type="invalid">
|
|
193
|
+
{errors?.productSetId?.message}
|
|
194
|
+
</Form.Control.Feedback>
|
|
195
|
+
</>
|
|
196
|
+
)}
|
|
200
197
|
/>
|
|
201
198
|
</Form.Group>
|
|
202
199
|
</div>
|
|
@@ -71,56 +71,56 @@ export function IframeEventCard({
|
|
|
71
71
|
className,
|
|
72
72
|
)}
|
|
73
73
|
onClick={
|
|
74
|
-
goToDetails || !snippetSetting
|
|
74
|
+
goToDetails || !snippetSetting?.displayBookingButtonOnEventList
|
|
75
75
|
? onClick
|
|
76
76
|
: undefined
|
|
77
77
|
}
|
|
78
78
|
>
|
|
79
|
-
{showMoreInfo && <div className=
|
|
79
|
+
{showMoreInfo && <div className='iframe-event-card__info-icon'>i</div>}
|
|
80
80
|
{imageSrc && (
|
|
81
81
|
<Card.Img
|
|
82
82
|
className={imageClassName ?? 'card-image'}
|
|
83
|
-
variant=
|
|
84
|
-
as=
|
|
83
|
+
variant='top'
|
|
84
|
+
as='div'
|
|
85
85
|
style={{ backgroundImage: `url("${imageSrc}")` }}
|
|
86
86
|
/>
|
|
87
87
|
)}
|
|
88
88
|
<Card.Body
|
|
89
89
|
className={clsx('d-flex', 'flex-column', !imageSrc && 'no-image')}
|
|
90
90
|
>
|
|
91
|
-
<Card.Title className=
|
|
91
|
+
<Card.Title className='iframe-event-card__title' id={titleId}>
|
|
92
92
|
{title}
|
|
93
93
|
</Card.Title>
|
|
94
94
|
|
|
95
|
-
<div className=
|
|
96
|
-
<Card.Text as=
|
|
97
|
-
<div className=
|
|
98
|
-
<div className=
|
|
95
|
+
<div className='flex-grow-1 iframe-event-card__description'>
|
|
96
|
+
<Card.Text as='div'>
|
|
97
|
+
<div className='d-flex align-items-center mb-3'>
|
|
98
|
+
<div className='icon-wrapper'>
|
|
99
99
|
<CalendarSvg />
|
|
100
100
|
</div>
|
|
101
|
-
<p className=
|
|
102
|
-
<p className=
|
|
101
|
+
<p className='m-0 list-view-hided'>{date}</p>
|
|
102
|
+
<p className='m-0 grid-view-hided'>{shortDate}</p>
|
|
103
103
|
</div>
|
|
104
104
|
</Card.Text>
|
|
105
105
|
|
|
106
106
|
{type && (
|
|
107
|
-
<Card.Text as=
|
|
108
|
-
<div className=
|
|
109
|
-
<div className=
|
|
107
|
+
<Card.Text as='div' className='list-view-hided'>
|
|
108
|
+
<div className='d-flex align-items-center mb-3'>
|
|
109
|
+
<div className='icon-wrapper'>
|
|
110
110
|
<ClockSvg />
|
|
111
111
|
</div>
|
|
112
|
-
<p className=
|
|
112
|
+
<p className='m-0'>{type}</p>
|
|
113
113
|
</div>
|
|
114
114
|
</Card.Text>
|
|
115
115
|
)}
|
|
116
116
|
|
|
117
117
|
{typeof cost === 'number' && (
|
|
118
|
-
<Card.Text as=
|
|
119
|
-
<div className=
|
|
120
|
-
<div className=
|
|
118
|
+
<Card.Text as='div'>
|
|
119
|
+
<div className='d-flex align-items-center mb-3'>
|
|
120
|
+
<div className='icon-wrapper'>
|
|
121
121
|
<TicketSvg />
|
|
122
122
|
</div>
|
|
123
|
-
<p className=
|
|
123
|
+
<p className='m-0'>
|
|
124
124
|
{t('from')}{' '}
|
|
125
125
|
{formatNumber(cost, { style: 'currency', currency: 'GBP' })}
|
|
126
126
|
</p>
|
|
@@ -129,7 +129,7 @@ export function IframeEventCard({
|
|
|
129
129
|
)}
|
|
130
130
|
|
|
131
131
|
{description && (
|
|
132
|
-
<Card.Text as=
|
|
132
|
+
<Card.Text as='div' className='list-view-hided'>
|
|
133
133
|
<TipTapEditor
|
|
134
134
|
viewMode
|
|
135
135
|
disabled
|
|
@@ -138,15 +138,16 @@ export function IframeEventCard({
|
|
|
138
138
|
/>
|
|
139
139
|
</Card.Text>
|
|
140
140
|
)}
|
|
141
|
-
{!!snippetSetting
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
141
|
+
{!!snippetSetting?.displayBookingButtonOnEventList &&
|
|
142
|
+
showMoreInfo && (
|
|
143
|
+
<Button
|
|
144
|
+
className='step-save-btn w-25 mt-4'
|
|
145
|
+
type='button'
|
|
146
|
+
onClick={onClick}
|
|
147
|
+
>
|
|
148
|
+
{t('book')}
|
|
149
|
+
</Button>
|
|
150
|
+
)}
|
|
150
151
|
</div>
|
|
151
152
|
</Card.Body>
|
|
152
153
|
</Card>
|
package/src/layout/DropDown.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { forwardRef } from 'react'
|
|
1
|
+
import React, { forwardRef } from 'react'
|
|
2
2
|
|
|
3
3
|
interface Props {
|
|
4
4
|
children?: React.ReactNode | React.ReactNode[]
|
|
@@ -24,4 +24,5 @@ const DropDown = forwardRef((props: Props, ref: any) => {
|
|
|
24
24
|
})
|
|
25
25
|
|
|
26
26
|
DropDown.displayName = 'DropDown'
|
|
27
|
+
|
|
27
28
|
export default DropDown
|
|
@@ -20,6 +20,9 @@ export type ConfirmModalTypes =
|
|
|
20
20
|
export interface ConfirmModalProps {
|
|
21
21
|
type?: ConfirmModalTypes
|
|
22
22
|
children?: (confirm: (action: ConfirmAction) => void) => ReactNode
|
|
23
|
+
// confirm function memoize the callback function. It's an alternative function
|
|
24
|
+
confirmationHandler?: () => Promise<boolean | undefined>
|
|
25
|
+
disabledButtons?: boolean
|
|
23
26
|
title?: string
|
|
24
27
|
content?: string | ReactNode
|
|
25
28
|
onClose?: () => void
|
|
@@ -37,7 +40,9 @@ export function ConfirmModal({
|
|
|
37
40
|
type = 'default',
|
|
38
41
|
children,
|
|
39
42
|
onClose,
|
|
43
|
+
confirmationHandler,
|
|
40
44
|
title,
|
|
45
|
+
disabledButtons,
|
|
41
46
|
content,
|
|
42
47
|
hideButtons = false,
|
|
43
48
|
}: ConfirmModalProps) {
|
|
@@ -52,10 +57,16 @@ export function ConfirmModal({
|
|
|
52
57
|
setIsOpen(() => true)
|
|
53
58
|
}
|
|
54
59
|
|
|
55
|
-
const handleConfirmation = (e) => {
|
|
60
|
+
const handleConfirmation = async (e) => {
|
|
56
61
|
e.stopPropagation()
|
|
57
|
-
if (!actionRef.current) return
|
|
58
|
-
|
|
62
|
+
if (!actionRef.current && !confirmationHandler) return
|
|
63
|
+
if (confirmationHandler) {
|
|
64
|
+
const res = await confirmationHandler()
|
|
65
|
+
if (res) {
|
|
66
|
+
setIsOpen(() => false)
|
|
67
|
+
}
|
|
68
|
+
return
|
|
69
|
+
}
|
|
59
70
|
actionRef.current()
|
|
60
71
|
setIsOpen(() => false)
|
|
61
72
|
}
|
|
@@ -88,6 +99,7 @@ export function ConfirmModal({
|
|
|
88
99
|
<Button
|
|
89
100
|
variant="danger"
|
|
90
101
|
className="btn-sm rounded"
|
|
102
|
+
disabled={disabledButtons}
|
|
91
103
|
onClick={handleClose}
|
|
92
104
|
data-id={CONFIRM_MODAL_ACTION_DECLINE}
|
|
93
105
|
>
|
|
@@ -105,12 +117,14 @@ export function ConfirmModal({
|
|
|
105
117
|
variant="outline"
|
|
106
118
|
className="cancel-button"
|
|
107
119
|
onClick={handleClose}
|
|
120
|
+
disabled={disabledButtons}
|
|
108
121
|
data-id={CONFIRM_MODAL_ACTION_DECLINE}
|
|
109
122
|
>
|
|
110
123
|
{t('cancel')}
|
|
111
124
|
</Button>
|
|
112
125
|
<Button
|
|
113
126
|
variant="danger"
|
|
127
|
+
disabled={disabledButtons}
|
|
114
128
|
onClick={handleConfirmation}
|
|
115
129
|
data-id={CONFIRM_MODAL_ACTION_CONFIRM}
|
|
116
130
|
>
|
|
@@ -121,6 +135,7 @@ export function ConfirmModal({
|
|
|
121
135
|
<>
|
|
122
136
|
<Button
|
|
123
137
|
variant="danger"
|
|
138
|
+
disabled={disabledButtons}
|
|
124
139
|
onClick={handleClose}
|
|
125
140
|
data-id={CONFIRM_MODAL_ACTION_DECLINE}
|
|
126
141
|
>
|
|
@@ -128,6 +143,7 @@ export function ConfirmModal({
|
|
|
128
143
|
</Button>
|
|
129
144
|
<Button
|
|
130
145
|
variant="success"
|
|
146
|
+
disabled={disabledButtons}
|
|
131
147
|
onClick={handleConfirmation}
|
|
132
148
|
data-id={CONFIRM_MODAL_ACTION_CONFIRM}
|
|
133
149
|
>
|