@licklist/design 0.69.3 → 0.69.5
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/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +2 -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 +3 -2
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts +2 -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 +31 -28
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts +2 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +14 -3
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +3 -1
- package/dist/iframe/activity-card/ActivityCard.d.ts +5 -4
- package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
- package/dist/iframe/activity-card/ActivityCard.js +52 -40
- package/dist/index.js +1 -0
- 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/ProductSetControl.d.ts +4 -0
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +30 -3
- package/dist/product-set/control/ProductSetImageControl.d.ts +2 -0
- package/dist/product-set/control/ProductSetImageControl.d.ts.map +1 -0
- package/dist/product-set/control/ProductSetImageControl.js +279 -0
- package/dist/product-set/form/MobileFooter.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +8 -0
- 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/index.d.ts +1 -0
- package/dist/product-set/form/index.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/styles/activity-card/{GridActivitiesCard.scss → ActivitiesCard.scss} +19 -5
- package/dist/styles/activity-card/ListActivitiesCard.scss +12 -42
- package/dist/styles/activity-card/_index.scss +1 -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 +5 -5
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +3 -0
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +86 -85
- package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +11 -1
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +2 -0
- package/src/iframe/activity-card/ActivityCard.tsx +35 -24
- package/src/modals/confirmation/ConfirmModal.tsx +19 -3
- package/src/product-set/card/ProductSetCard.tsx +47 -8
- package/src/product-set/control/ProductSetControl.tsx +52 -52
- package/src/product-set/control/ProductSetImageControl.tsx +97 -0
- package/src/product-set/form/MobileFooter.tsx +1 -3
- package/src/product-set/form/ProductSetForm.tsx +10 -0
- package/src/product-set/form/ProductSetNameControl.tsx +27 -0
- package/src/product-set/form/index.ts +1 -0
- package/src/product-set/utils/index.ts +11 -0
- package/src/styles/activity-card/{GridActivitiesCard.scss → ActivitiesCard.scss} +19 -5
- package/src/styles/activity-card/ListActivitiesCard.scss +12 -42
- package/src/styles/activity-card/_index.scss +1 -1
- package/src/typeahead/Typeahead.tsx +15 -1
- package/yarn.lock +63 -45
|
@@ -22,12 +22,11 @@ import HookFormService from '@licklist/plugins/dist/services/Form/HookFormServic
|
|
|
22
22
|
import { ruleForUrlWithProtocol } from '@licklist/plugins/dist/validation/Rules/urlRule'
|
|
23
23
|
import { WorkHour } from '@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper'
|
|
24
24
|
import { checkIfZoneCategory } from '@licklist/plugins'
|
|
25
|
+
import { Image } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
|
|
25
26
|
import { WarningMessage } from '../../static'
|
|
26
27
|
import { SelectItem } from '../../types/generic/SelectItem'
|
|
27
28
|
import {
|
|
28
29
|
DateAndRecurrenceInput,
|
|
29
|
-
// TODO: Show Date Component, when reccurent date bugs are fixed
|
|
30
|
-
// DateAndRecurrenceInput,
|
|
31
30
|
DateAndRecurrenceInputValues,
|
|
32
31
|
} from './DateAndRecurrenceInput'
|
|
33
32
|
import TutorialGifCard from './TutorialGifCard'
|
|
@@ -35,6 +34,7 @@ import { Step } from '../types'
|
|
|
35
34
|
import { StepsControl } from '../form/StepsControl'
|
|
36
35
|
import { Typeahead } from '../../typeahead'
|
|
37
36
|
import { DateInput } from './DateInput'
|
|
37
|
+
import { ProductSetImageControl } from './ProductSetImageControl'
|
|
38
38
|
|
|
39
39
|
const OPERATIONAL_COST_TITLES = {
|
|
40
40
|
[OPERATIONAL_COST_PROVIDER]: 'operationalCostProvider',
|
|
@@ -47,6 +47,8 @@ const RELY_ON_PEOPLE_TYPE_TITLES = {
|
|
|
47
47
|
[RELY_ON_PEOPLE_QUANTITY]: 'peopleQuantity',
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
const MAX_DESCRIPTION_LENGTH = 100
|
|
51
|
+
|
|
50
52
|
export interface TemplateItem {
|
|
51
53
|
id: string
|
|
52
54
|
value: EmailTemplate | SmsTemplate
|
|
@@ -55,6 +57,8 @@ export interface TemplateItem {
|
|
|
55
57
|
|
|
56
58
|
export interface ProductSetControlValues extends DateAndRecurrenceInputValues {
|
|
57
59
|
name: string
|
|
60
|
+
description?: string
|
|
61
|
+
image?: Image
|
|
58
62
|
type: ProductSetType
|
|
59
63
|
termsAndConditions: string
|
|
60
64
|
thankYouPageUrl: string
|
|
@@ -65,6 +69,7 @@ export interface ProductSetControlValues extends DateAndRecurrenceInputValues {
|
|
|
65
69
|
steps: Step[]
|
|
66
70
|
emailTemplates?: TemplateItem[]
|
|
67
71
|
smsTemplates?: TemplateItem[]
|
|
72
|
+
localImageBlobURL?: string
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
export interface ProductSetControlShared {
|
|
@@ -122,6 +127,7 @@ export function ProductSetControl({
|
|
|
122
127
|
const steps = watch('steps')
|
|
123
128
|
|
|
124
129
|
const nameId = useId()
|
|
130
|
+
const descriptionId = useId()
|
|
125
131
|
const termsAndConditionsId = useId()
|
|
126
132
|
const relyOnPeopleTypeId = useId()
|
|
127
133
|
|
|
@@ -174,6 +180,28 @@ export function ProductSetControl({
|
|
|
174
180
|
</Form.Control.Feedback>
|
|
175
181
|
</Form.Group>
|
|
176
182
|
|
|
183
|
+
<Form.Group controlId={descriptionId}>
|
|
184
|
+
<Form.Label>{t('Design:description')}</Form.Label>
|
|
185
|
+
<Form.Control
|
|
186
|
+
{...register('description', {
|
|
187
|
+
maxLength: {
|
|
188
|
+
value: MAX_DESCRIPTION_LENGTH,
|
|
189
|
+
message: t('Validation:fieldMaxLength', {
|
|
190
|
+
attribute: t('description'),
|
|
191
|
+
max: MAX_DESCRIPTION_LENGTH,
|
|
192
|
+
}),
|
|
193
|
+
},
|
|
194
|
+
})}
|
|
195
|
+
as='textarea'
|
|
196
|
+
isInvalid={Boolean(errors.description)}
|
|
197
|
+
/>
|
|
198
|
+
<Form.Control.Feedback type='invalid'>
|
|
199
|
+
{errors.description?.message}
|
|
200
|
+
</Form.Control.Feedback>
|
|
201
|
+
</Form.Group>
|
|
202
|
+
|
|
203
|
+
<ProductSetImageControl />
|
|
204
|
+
|
|
177
205
|
{showDateSelector ? (
|
|
178
206
|
<DateInput
|
|
179
207
|
workHours={isZoneAdded ? workHours : undefined}
|
|
@@ -207,27 +235,6 @@ export function ProductSetControl({
|
|
|
207
235
|
</Col>
|
|
208
236
|
<Col md={6} sm={12}>
|
|
209
237
|
<div className='second-column'>
|
|
210
|
-
{/* <Controller
|
|
211
|
-
control={control}
|
|
212
|
-
name="type"
|
|
213
|
-
render={({ field }) => (
|
|
214
|
-
<Form.Group className="d-flex flex-column flex-grow-1 align-items-start">
|
|
215
|
-
<Form.Label>{t("Design:checkoutType")}</Form.Label>
|
|
216
|
-
<Switch
|
|
217
|
-
name={field.name}
|
|
218
|
-
options={PRODUCT_SET_TYPES.map((type) => ({
|
|
219
|
-
key: type,
|
|
220
|
-
id: type,
|
|
221
|
-
value: t(type),
|
|
222
|
-
}))}
|
|
223
|
-
value={field.value}
|
|
224
|
-
onChange={field.onChange}
|
|
225
|
-
disabled={isLoading}
|
|
226
|
-
/>
|
|
227
|
-
</Form.Group>
|
|
228
|
-
)}
|
|
229
|
-
/> */}
|
|
230
|
-
|
|
231
238
|
<Form.Group>
|
|
232
239
|
<Form.Label className='mb-0'>
|
|
233
240
|
{t('Design:operationalCost')}
|
|
@@ -364,35 +371,28 @@ export function ProductSetControl({
|
|
|
364
371
|
<Controller
|
|
365
372
|
control={control}
|
|
366
373
|
name='fieldSetId'
|
|
367
|
-
render={({ field }) =>
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
</Form.Control>
|
|
390
|
-
<Form.Control.Feedback type='invalid'>
|
|
391
|
-
{HookFormService.getErrors('fieldSetId', errors)}
|
|
392
|
-
</Form.Control.Feedback>
|
|
393
|
-
</>
|
|
394
|
-
)
|
|
395
|
-
}}
|
|
374
|
+
render={({ field }) => (
|
|
375
|
+
<>
|
|
376
|
+
<Form.Label>{t('Design:customFields')}</Form.Label>
|
|
377
|
+
<Form.Control
|
|
378
|
+
onChange={field.onChange}
|
|
379
|
+
value={Number(field.value)}
|
|
380
|
+
as='select'
|
|
381
|
+
disabled={isOverrides}
|
|
382
|
+
isInvalid={HookFormService.isInvalid('fieldSetId', errors)}
|
|
383
|
+
>
|
|
384
|
+
<option value=''>{t('Design:choose')}</option>
|
|
385
|
+
{fieldSets?.map((fieldSet) => (
|
|
386
|
+
<option value={fieldSet.id} key={fieldSet.id}>
|
|
387
|
+
{fieldSet.name}
|
|
388
|
+
</option>
|
|
389
|
+
))}
|
|
390
|
+
</Form.Control>
|
|
391
|
+
<Form.Control.Feedback type='invalid'>
|
|
392
|
+
{HookFormService.getErrors('fieldSetId', errors)}
|
|
393
|
+
</Form.Control.Feedback>
|
|
394
|
+
</>
|
|
395
|
+
)}
|
|
396
396
|
/>
|
|
397
397
|
</Form.Group>
|
|
398
398
|
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { useFormContext } from 'react-hook-form'
|
|
2
|
+
import { HookFormService, useImages } from '@licklist/plugins'
|
|
3
|
+
import { IMAGE_TYPE_IMAGE } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
|
|
4
|
+
import { useCallback, useEffect } from 'react'
|
|
5
|
+
import { Form } from 'react-bootstrap'
|
|
6
|
+
import { FileUpload } from 'src/file-upload'
|
|
7
|
+
import { useTranslation } from 'react-i18next'
|
|
8
|
+
import { isEqual } from 'lodash'
|
|
9
|
+
import { ProductSetControlValues } from '..'
|
|
10
|
+
|
|
11
|
+
export const ProductSetImageControl = () => {
|
|
12
|
+
const { t } = useTranslation('Design')
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
formState: { errors },
|
|
16
|
+
setValue,
|
|
17
|
+
watch,
|
|
18
|
+
clearErrors,
|
|
19
|
+
} = useFormContext<ProductSetControlValues>()
|
|
20
|
+
const currentProductSet: ProductSetControlValues = watch()
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
images,
|
|
24
|
+
handleImageRemove,
|
|
25
|
+
handleImageUploading,
|
|
26
|
+
isLoading: isImageUploading,
|
|
27
|
+
setImages,
|
|
28
|
+
} = useImages(null)
|
|
29
|
+
|
|
30
|
+
const onFilesChange = useCallback(
|
|
31
|
+
async (files: File[]) => {
|
|
32
|
+
const uploadedFiles = await handleImageUploading(files, IMAGE_TYPE_IMAGE)
|
|
33
|
+
|
|
34
|
+
if (!uploadedFiles) return
|
|
35
|
+
|
|
36
|
+
setValue('localImageBlobURL', URL.createObjectURL(files[0]) as never)
|
|
37
|
+
},
|
|
38
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
|
+
[handleImageUploading],
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
const onImageRemove = useCallback(
|
|
43
|
+
(id, path) => {
|
|
44
|
+
handleImageRemove(id, path)
|
|
45
|
+
setValue('localImageBlobURL', undefined as never)
|
|
46
|
+
},
|
|
47
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
+
[handleImageRemove],
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (!currentProductSet || !currentProductSet.image) return
|
|
53
|
+
|
|
54
|
+
setImages([
|
|
55
|
+
{
|
|
56
|
+
...currentProductSet.image,
|
|
57
|
+
url:
|
|
58
|
+
currentProductSet.image.url || currentProductSet?.localImageBlobURL,
|
|
59
|
+
},
|
|
60
|
+
])
|
|
61
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
|
+
}, [currentProductSet?.image])
|
|
63
|
+
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (isEqual(images[0], currentProductSet?.image)) return
|
|
66
|
+
|
|
67
|
+
setValue('image', (images[0] || null) as never)
|
|
68
|
+
|
|
69
|
+
if (images[0]) {
|
|
70
|
+
clearErrors('image')
|
|
71
|
+
}
|
|
72
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
|
+
}, [images])
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<Form.Group controlId='name'>
|
|
77
|
+
<Form.Control
|
|
78
|
+
isInvalid={HookFormService.isInvalid('image', errors)}
|
|
79
|
+
hidden
|
|
80
|
+
/>
|
|
81
|
+
<FileUpload
|
|
82
|
+
onFilesChange={onFilesChange}
|
|
83
|
+
allowedExtensions={['jpeg', 'jpg', 'png']}
|
|
84
|
+
subTitle='.jpeg .jpg .png'
|
|
85
|
+
enablePreview
|
|
86
|
+
onFileRemove={onImageRemove}
|
|
87
|
+
defaultFiles={images}
|
|
88
|
+
isLoading={isImageUploading}
|
|
89
|
+
withIcon
|
|
90
|
+
title={t('Design:addImage')}
|
|
91
|
+
/>
|
|
92
|
+
<Form.Control.Feedback type='invalid'>
|
|
93
|
+
{HookFormService.getErrors('image', errors)}
|
|
94
|
+
</Form.Control.Feedback>
|
|
95
|
+
</Form.Group>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
@@ -6,9 +6,7 @@ export function MobileFooter() {
|
|
|
6
6
|
|
|
7
7
|
return (
|
|
8
8
|
<div className='container product-set-mobile-footer'>
|
|
9
|
-
<div
|
|
10
|
-
className={`d-block d-sm-none bg-white border-top fixed-bottom py-4 px-5 d-flex justify-content-between flex-row-reverse`}
|
|
11
|
-
>
|
|
9
|
+
<div className='d-block d-sm-none bg-white border-top fixed-bottom py-4 px-5 d-flex justify-content-between flex-row-reverse'>
|
|
12
10
|
<Button type='submit'>{t('save')}</Button>
|
|
13
11
|
</div>
|
|
14
12
|
</div>
|
|
@@ -12,6 +12,7 @@ import { isEqual } from 'lodash'
|
|
|
12
12
|
import { ProviderBookingManagementSetting } from '@licklist/core/dist/DataMapper/Provider/ProviderBookingManagementSettingDataMapper'
|
|
13
13
|
import { Zone } from '@licklist/core/dist/DataMapper/Provider/ZoneDataMapper'
|
|
14
14
|
import { WorkHour } from '@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper'
|
|
15
|
+
import { transformErrorToMessage } from '@licklist/plugins'
|
|
15
16
|
import { Dialog, useDialogContext } from '../../modals/dialog'
|
|
16
17
|
import {
|
|
17
18
|
ProductSetControl,
|
|
@@ -121,6 +122,15 @@ export function ProductSetForm({
|
|
|
121
122
|
if (!serverErrors) {
|
|
122
123
|
return
|
|
123
124
|
}
|
|
125
|
+
if (!Array.isArray(serverErrors)) {
|
|
126
|
+
setErrorMessage(transformErrorToMessage(serverErrors))
|
|
127
|
+
return
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (Array.isArray(serverErrors) && serverErrors[0]) {
|
|
131
|
+
setErrorMessage(serverErrors[0])
|
|
132
|
+
}
|
|
133
|
+
|
|
124
134
|
FormErrorService.handleServerErrors(serverErrors, setError)
|
|
125
135
|
}, [serverErrors, setError])
|
|
126
136
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Form } from 'react-bootstrap'
|
|
2
|
+
import { useTranslation } from 'react-i18next'
|
|
3
|
+
|
|
4
|
+
export const ProductSetNameControl = ({
|
|
5
|
+
value,
|
|
6
|
+
onChange,
|
|
7
|
+
error,
|
|
8
|
+
}: {
|
|
9
|
+
value: string
|
|
10
|
+
onChange: (value: string) => void
|
|
11
|
+
error?: string
|
|
12
|
+
}) => {
|
|
13
|
+
const { t } = useTranslation(['Design'])
|
|
14
|
+
return (
|
|
15
|
+
<Form.Group>
|
|
16
|
+
<Form.Label>{t('Design:ProductSetName')}*</Form.Label>
|
|
17
|
+
<Form.Control
|
|
18
|
+
value={value}
|
|
19
|
+
maxLength={255}
|
|
20
|
+
onChange={(e) => onChange(e.target.value)}
|
|
21
|
+
placeholder={t('Design:placeholderProductSetName')}
|
|
22
|
+
isInvalid={Boolean(error)}
|
|
23
|
+
/>
|
|
24
|
+
<Form.Control.Feedback type='invalid'>{error}</Form.Control.Feedback>
|
|
25
|
+
</Form.Group>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -3,6 +3,7 @@ import { SmsTemplate } from '@licklist/core/dist/DataMapper/Notification/SmsTemp
|
|
|
3
3
|
import { TFunction } from 'react-i18next'
|
|
4
4
|
import { UseFormSetError } from 'react-hook-form'
|
|
5
5
|
import { checkIfZoneCategory } from '@licklist/plugins'
|
|
6
|
+
import { ProductSet } from '@licklist/core/dist/DataMapper/Product/ProductSetDataMapper'
|
|
6
7
|
import { TemplateItem } from '../control/ProductSetControl'
|
|
7
8
|
import { ProductSetFormValues } from '../form/ProductSetForm'
|
|
8
9
|
|
|
@@ -12,6 +13,11 @@ interface CheckAvailableTimesErrors {
|
|
|
12
13
|
t: TFunction
|
|
13
14
|
}
|
|
14
15
|
|
|
16
|
+
export interface MenuTypeheadItem {
|
|
17
|
+
id: number
|
|
18
|
+
label: string
|
|
19
|
+
value: number
|
|
20
|
+
}
|
|
15
21
|
export const moveArrayElements = <T>(
|
|
16
22
|
array: T[],
|
|
17
23
|
prevIndex: number,
|
|
@@ -83,3 +89,8 @@ export const checkAvailableTimesErrors = ({
|
|
|
83
89
|
})
|
|
84
90
|
return hasError
|
|
85
91
|
}
|
|
92
|
+
|
|
93
|
+
export const getTypeHeadItemsFromMenus = (
|
|
94
|
+
menus?: (ProductSet | ProductSetFormValues)[],
|
|
95
|
+
): MenuTypeheadItem[] =>
|
|
96
|
+
menus?.map((menu) => ({ id: menu.id, value: menu.id, label: menu.name }))
|
|
@@ -11,10 +11,7 @@
|
|
|
11
11
|
background-color: #fff;
|
|
12
12
|
font-size: 0.8rem;
|
|
13
13
|
background-color: $snippet-product-set-background-color;
|
|
14
|
-
|
|
15
|
-
div {
|
|
16
|
-
text-align: left;
|
|
17
|
-
}
|
|
14
|
+
text-align: left;
|
|
18
15
|
|
|
19
16
|
&.active {
|
|
20
17
|
border: 2px solid #0e8be1;
|
|
@@ -23,7 +20,24 @@
|
|
|
23
20
|
&-title {
|
|
24
21
|
font-weight: 600;
|
|
25
22
|
line-height: 1.25rem;
|
|
26
|
-
cursor: pointer;
|
|
27
23
|
font-size: 0.875rem;
|
|
28
24
|
}
|
|
25
|
+
|
|
26
|
+
img {
|
|
27
|
+
max-height: 100%;
|
|
28
|
+
max-width: 100%;
|
|
29
|
+
object-fit: cover;
|
|
30
|
+
aspect-ratio: 1.2/1;
|
|
31
|
+
margin-bottom: 0.8rem;
|
|
32
|
+
border-radius: 0.5rem;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&-description {
|
|
36
|
+
line-clamp: 5;
|
|
37
|
+
-webkit-line-clamp: 5;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
text-overflow: ellipsis;
|
|
40
|
+
display: -webkit-box;
|
|
41
|
+
-webkit-box-orient: vertical;
|
|
42
|
+
}
|
|
29
43
|
}
|
|
@@ -3,56 +3,26 @@
|
|
|
3
3
|
.list-activity-card {
|
|
4
4
|
display: flex;
|
|
5
5
|
justify-content: space-between;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
height: 6rem;
|
|
9
|
-
padding: 0.375rem;
|
|
10
|
-
border: 2px solid transparent;
|
|
11
|
-
border-radius: 0.5rem;
|
|
12
|
-
background-color: $snippet-product-set-background-color;
|
|
13
|
-
color: $snippet-product-set-font-color;
|
|
14
|
-
transition: $color-transition;
|
|
6
|
+
gap: 0.5rem;
|
|
7
|
+
width: 100%;
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
border: 2px solid #0e8be1;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
p {
|
|
21
|
-
margin-bottom: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.description {
|
|
9
|
+
&-info {
|
|
25
10
|
width: 70%;
|
|
26
11
|
font-size: 0.81rem;
|
|
27
12
|
display: flex;
|
|
28
13
|
flex-direction: column;
|
|
14
|
+
align-items: start;
|
|
29
15
|
}
|
|
30
16
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
font-size: 0.875rem;
|
|
34
|
-
line-height: 1.5rem;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.image-container {
|
|
38
|
-
display: flex;
|
|
39
|
-
justify-content: start;
|
|
17
|
+
img {
|
|
18
|
+
max-width: 120px;
|
|
40
19
|
height: 100%;
|
|
41
|
-
|
|
42
|
-
.
|
|
43
|
-
|
|
44
|
-
align-items: start;
|
|
45
|
-
width: 7rem;
|
|
46
|
-
height: 4rem;
|
|
47
|
-
margin-left: 3rem;
|
|
48
|
-
background-repeat: no-repeat;
|
|
49
|
-
background-size: cover;
|
|
50
|
-
background-position: center;
|
|
51
|
-
border-radius: 0.5rem;
|
|
52
|
-
}
|
|
20
|
+
object-fit: cover;
|
|
21
|
+
aspect-ratio: 1.2/1;
|
|
22
|
+
border-radius: 0.5rem;
|
|
53
23
|
}
|
|
54
|
-
}
|
|
55
24
|
|
|
56
|
-
|
|
57
|
-
|
|
25
|
+
&-hr {
|
|
26
|
+
margin-top: 0;
|
|
27
|
+
}
|
|
58
28
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import './
|
|
1
|
+
@import './ActivitiesCard.scss';
|
|
2
2
|
@import './ListActivitiesCard.scss';
|
|
@@ -12,10 +12,13 @@ export interface TypeaheadProps {
|
|
|
12
12
|
placeholder: string
|
|
13
13
|
isRequired?: boolean
|
|
14
14
|
name: string
|
|
15
|
+
value?: TypeaheadOptions
|
|
15
16
|
isMultipleChoise?: boolean
|
|
16
17
|
noOptionsMessage: string
|
|
17
18
|
isInvalid?: boolean
|
|
18
19
|
isCouponForm?: boolean
|
|
20
|
+
containerStyles?: CSSObjectWithLabel
|
|
21
|
+
onChangeValue?: (value: TypeaheadOptions) => void
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
function Typeahead({
|
|
@@ -24,6 +27,9 @@ function Typeahead({
|
|
|
24
27
|
isRequired = false,
|
|
25
28
|
isMultipleChoise,
|
|
26
29
|
name = '',
|
|
30
|
+
value,
|
|
31
|
+
onChangeValue,
|
|
32
|
+
containerStyles,
|
|
27
33
|
isCouponForm = false,
|
|
28
34
|
noOptionsMessage = '',
|
|
29
35
|
isInvalid,
|
|
@@ -53,15 +59,23 @@ function Typeahead({
|
|
|
53
59
|
render={({ field }) => (
|
|
54
60
|
<Select
|
|
55
61
|
placeholder={placeholder}
|
|
56
|
-
value={field.value}
|
|
62
|
+
value={value ?? field.value}
|
|
57
63
|
isMulti={isMultipleChoise}
|
|
58
64
|
styles={{
|
|
65
|
+
container: (base) => ({
|
|
66
|
+
...base,
|
|
67
|
+
...containerStyles,
|
|
68
|
+
}),
|
|
59
69
|
control: (base) => ({
|
|
60
70
|
...base,
|
|
61
71
|
...getStyle(),
|
|
62
72
|
}),
|
|
63
73
|
}}
|
|
64
74
|
onChange={(value) => {
|
|
75
|
+
if (onChangeValue) {
|
|
76
|
+
onChangeValue(value)
|
|
77
|
+
return
|
|
78
|
+
}
|
|
65
79
|
field.onChange(value)
|
|
66
80
|
}}
|
|
67
81
|
options={options}
|