ordering-ui-external 1.8.9 → 1.9.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.
Files changed (51) hide show
  1. package/_bundles/{0.ordering-ui.b6cdd549ac5beb984576.js → 0.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  2. package/_bundles/{1.ordering-ui.b6cdd549ac5beb984576.js → 1.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  3. package/_bundles/{2.ordering-ui.b6cdd549ac5beb984576.js → 2.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  4. package/_bundles/{4.ordering-ui.b6cdd549ac5beb984576.js → 4.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  5. package/_bundles/{5.ordering-ui.b6cdd549ac5beb984576.js → 5.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  6. package/_bundles/{6.ordering-ui.b6cdd549ac5beb984576.js → 6.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  7. package/_bundles/{7.ordering-ui.b6cdd549ac5beb984576.js → 7.ordering-ui.557d300459c7f7dc486b.js} +1 -1
  8. package/_bundles/{7.ordering-ui.b6cdd549ac5beb984576.js.LICENSE.txt → 7.ordering-ui.557d300459c7f7dc486b.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.b6cdd549ac5beb984576.js → 8.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  10. package/_bundles/{9.ordering-ui.b6cdd549ac5beb984576.js → 9.ordering-ui.557d300459c7f7dc486b.js} +0 -0
  11. package/_bundles/{ordering-ui.b6cdd549ac5beb984576.js → ordering-ui.557d300459c7f7dc486b.js} +2 -2
  12. package/_bundles/{ordering-ui.b6cdd549ac5beb984576.js.LICENSE.txt → ordering-ui.557d300459c7f7dc486b.js.LICENSE.txt} +0 -0
  13. package/_modules/components/PaymentOptions/index.js +2 -2
  14. package/_modules/themes/five/index.js +7 -0
  15. package/_modules/themes/five/src/components/BusinessInformation/index.js +7 -6
  16. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +3 -1
  17. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +2 -2
  18. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +5 -3
  19. package/_modules/themes/five/src/components/Header/index.js +17 -1
  20. package/_modules/themes/five/src/components/Header/styles.js +7 -5
  21. package/_modules/themes/five/src/components/OrderDetails/OrderBillSection.js +12 -12
  22. package/_modules/themes/five/src/components/OrderDetails/index.js +4 -2
  23. package/_modules/themes/five/src/components/OrdersOption/index.js +4 -2
  24. package/_modules/themes/five/src/components/ProductOption/index.js +1 -1
  25. package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +1 -1
  26. package/_modules/themes/five/src/components/ReviewProduct/index.js +2 -0
  27. package/_modules/themes/five/src/components/ScheduleAccordion/index.js +49 -0
  28. package/_modules/themes/five/src/components/ScheduleAccordion/styles.js +23 -0
  29. package/_modules/themes/five/src/components/SearchBar/index.js +4 -2
  30. package/_modules/themes/five/src/components/SearchBar/styles.js +12 -8
  31. package/_modules/themes/five/src/components/ServiceForm/index.js +17 -8
  32. package/package.json +2 -2
  33. package/src/components/PaymentOptions/index.js +22 -22
  34. package/src/themes/five/index.js +2 -0
  35. package/src/themes/five/src/components/BusinessInformation/index.js +7 -23
  36. package/src/themes/five/src/components/BusinessProductsListing/index.js +3 -1
  37. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +2 -2
  38. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +5 -1
  39. package/src/themes/five/src/components/Header/index.js +18 -3
  40. package/src/themes/five/src/components/Header/styles.js +20 -4
  41. package/src/themes/five/src/components/OrderDetails/OrderBillSection.js +6 -6
  42. package/src/themes/five/src/components/OrderDetails/index.js +5 -2
  43. package/src/themes/five/src/components/OrdersOption/index.js +10 -9
  44. package/src/themes/five/src/components/ProductOption/index.js +1 -1
  45. package/src/themes/five/src/components/ProductOptionSubOption/index.js +1 -1
  46. package/src/themes/five/src/components/ReviewProduct/index.js +2 -0
  47. package/src/themes/five/src/components/ScheduleAccordion/index.js +60 -0
  48. package/src/themes/five/src/components/ScheduleAccordion/styles.js +28 -0
  49. package/src/themes/five/src/components/SearchBar/index.js +3 -1
  50. package/src/themes/five/src/components/SearchBar/styles.js +9 -1
  51. package/src/themes/five/src/components/ServiceForm/index.js +10 -4
@@ -0,0 +1,60 @@
1
+ import React, { useState } from 'react'
2
+ import { useLanguage } from 'ordering-components-external'
3
+
4
+ import {
5
+ Accordion,
6
+ AccordionSection,
7
+ ClosedSchedule,
8
+ DropdownWrapper,
9
+ HoursWrappers,
10
+ } from './styles'
11
+ import IosArrowDown from '@meronex/icons/ios/IosArrowDown'
12
+
13
+ export const ScheduleAccordion = (props) => {
14
+
15
+ const {
16
+ scheduleFormatted,
17
+ schedule,
18
+ weekIndex
19
+ } = props
20
+
21
+ const [isActive, setActiveState] = useState(false)
22
+ const [, t] = useLanguage()
23
+
24
+ const daysOfWeek = [
25
+ t('DAY7', 'Sunday'),
26
+ t('DAY1', 'Monday'),
27
+ t('DAY2', 'Tuesday'),
28
+ t('DAY3', 'Wednesday'),
29
+ t('DAY4', 'Thursday'),
30
+ t('DAY5', 'Friday'),
31
+ t('DAY6', 'Saturday'),
32
+ ]
33
+
34
+ return (
35
+ <AccordionSection>
36
+ <Accordion
37
+ onClick={() => setActiveState(!isActive)}
38
+ >
39
+ <DropdownWrapper>
40
+ <h4>{daysOfWeek[weekIndex]}</h4>
41
+ <IosArrowDown />
42
+ </DropdownWrapper>
43
+ <HoursWrappers style={{ display: isActive ? 'flex' : 'none', paddingLeft: 60 }}>
44
+ {schedule?.lapses?.map((lapse, i) => (
45
+ schedule?.enabled ?
46
+ <p key={`${i}-${scheduleFormatted(lapse.open)}`}>
47
+ {scheduleFormatted(lapse.open) +
48
+ ' - ' +
49
+ scheduleFormatted(lapse.close)}
50
+ </p>
51
+ :
52
+ <ClosedSchedule>
53
+ {t('CLOSED', 'Closed')}
54
+ </ClosedSchedule>
55
+ ))}
56
+ </HoursWrappers>
57
+ </Accordion>
58
+ </AccordionSection>
59
+ )
60
+ }
@@ -0,0 +1,28 @@
1
+ import styled from 'styled-components'
2
+
3
+ export const AccordionSection = styled.div`
4
+ background: #FFF;
5
+ `
6
+
7
+ export const Accordion = styled.div`
8
+ display: flex;
9
+ flex-direction: column;
10
+ justify-content: space-between;
11
+ `
12
+
13
+ export const DropdownWrapper = styled.div`
14
+ display: flex;
15
+ align-items: center;
16
+ gap: 10px;
17
+ `
18
+ export const HoursWrappers = styled.div`
19
+ flex-direction: column;
20
+
21
+ p {
22
+ margin: 0px 0px 10px 0px;
23
+ }
24
+ `
25
+
26
+ export const ClosedSchedule = styled.p`
27
+ color: ${props => props.theme?.colors?.danger500}
28
+ `
@@ -17,7 +17,8 @@ export const SearchBar = (props) => {
17
17
  lazyLoad,
18
18
  isCustomLayout,
19
19
  handleCustomEnter,
20
- forwardRef
20
+ forwardRef,
21
+ starbucksStyle
21
22
  } = props
22
23
  const [theme] = useTheme()
23
24
  const [, t] = useLanguage()
@@ -84,6 +85,7 @@ export const SearchBar = (props) => {
84
85
  className={!isCustomLayout && 'search-bar'}
85
86
  isCustomLayout={isCustomLayout}
86
87
  hasValue={el.current?.value}
88
+ starbucksStyle={starbucksStyle}
87
89
  >
88
90
  <Input
89
91
  ref={(ref) => {
@@ -30,9 +30,17 @@ export const BusinessSearch = styled.div`
30
30
  transition: width 0.4s ease-in-out;
31
31
  `}
32
32
 
33
+ ${({ starbucksStyle }) => starbucksStyle && css`
34
+ background-color: #F8F9FA;
35
+ border: 1px solid #DEE2E6;
36
+ font-size: 14px;
37
+ color: #000;
38
+ border-radius: 7.6px;
39
+ `}
40
+
33
41
  @media (min-width: 681px) {
34
42
  width: 100%;
35
- ${({ isCustomLayout }) => !isCustomLayout && css`
43
+ ${({ isCustomLayout, starbucksStyle }) => !isCustomLayout && !starbucksStyle && css`
36
44
  width: 50%;
37
45
  `}
38
46
  }
@@ -144,9 +144,15 @@ const ServiceFormUI = (props) => {
144
144
 
145
145
  const isBusyTime = (professional) => {
146
146
  if (professional?.busy_times?.length === 0 || !dateSelected) return false
147
- const valid = professional?.busy_times.some(item => {
148
- return moment(item?.start).valueOf() <= moment(dateSelected).valueOf() &&
149
- moment(dateSelected).valueOf() <= moment(item?.end).valueOf()
147
+ const duration = product?.duration ?? 0
148
+ const busyTimes = isCartProduct
149
+ ? professional?.busy_times.filter(item => !(item.start === productCart?.calendar_event?.start && item.end === productCart?.calendar_event?.end))
150
+ : [...professional?.busy_times]
151
+ const valid = busyTimes.some(item => {
152
+ return (moment.utc(item?.start).local().valueOf() <= moment(dateSelected).valueOf() &&
153
+ moment(dateSelected).valueOf() <= moment.utc(item?.end).local().valueOf()) ||
154
+ (moment.utc(item?.start).local().valueOf() <= moment(dateSelected).add(duration, 'minutes').valueOf() &&
155
+ moment(dateSelected).add(duration, 'minutes').valueOf() <= moment.utc(item?.end).local().valueOf())
150
156
  })
151
157
  return valid
152
158
  }
@@ -304,7 +310,7 @@ const ServiceFormUI = (props) => {
304
310
  ) : <FaUserAlt />}
305
311
  <NameWrapper>
306
312
  <p>{currentProfessional?.name} {currentProfessional?.lastname}</p>
307
- <StatusInfo available={!isBusyTime()}>
313
+ <StatusInfo available={!isBusyTime(currentProfessional)}>
308
314
  {isBusyTime(currentProfessional) ? (
309
315
  <>
310
316
  <span className='status'>{t('BUSY_ON_SELECTED_TIME', 'Busy on selected time')}</span>