@licklist/design 0.66.5 → 0.66.7-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.
Files changed (85) hide show
  1. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
  2. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +1 -1
  3. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
  4. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
  5. package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
  6. package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -1
  7. package/dist/iframe/page/components/PageBody/PageBody.d.ts +1 -1
  8. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts +2 -1
  9. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
  10. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
  11. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
  12. package/dist/notification/email-template/card/EmailTemplateCard.d.ts +2 -1
  13. package/dist/notification/email-template/card/EmailTemplateCard.d.ts.map +1 -1
  14. package/dist/notification/email-template/card/EmailTemplateCard.js +1 -1
  15. package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
  16. package/dist/notification/email-template/control/EmailTemplateControl.js +1 -1
  17. package/dist/notification/sms-template/card/SmsTemplateCard.d.ts +2 -1
  18. package/dist/notification/sms-template/card/SmsTemplateCard.d.ts.map +1 -1
  19. package/dist/notification/sms-template/card/SmsTemplateCard.js +1 -1
  20. package/dist/product-set/control/DateAndRecurrenceInput.d.ts +1 -1
  21. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  22. package/dist/product-set/control/DateAndRecurrenceInput.js +1 -1
  23. package/dist/product-set/control/ProductSetControl.d.ts +1 -1
  24. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  25. package/dist/product-set/control/ProductSetControl.js +1 -1
  26. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  27. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  28. package/dist/product-set/form/ProductSetForm.d.ts +4 -1
  29. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  30. package/dist/product-set/form/ProductSetForm.js +1 -1
  31. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
  32. package/dist/product-set/hooks/useSortableTreeFunctions.js +1 -1
  33. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  34. package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
  35. package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
  36. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +3 -1
  37. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
  38. package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
  39. package/dist/recurring-date-picker-input/utils.d.ts +5 -0
  40. package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
  41. package/dist/recurring-date-picker-input/utils.js +1 -1
  42. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  43. package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
  44. package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
  45. package/dist/styles/sales/BookingResults.scss +1 -1
  46. package/dist/styles/snippet-templates/SnippetTemplateCard.scss +3 -0
  47. package/dist/styles/zones/ZoneForm.scss +2 -1
  48. package/dist/zone/form/ZoneForm.d.ts +2 -2
  49. package/dist/zone/form/ZoneForm.d.ts.map +1 -1
  50. package/dist/zone/form/ZoneForm.js +1 -1
  51. package/dist/zone/form/components/ZoneControl.d.ts +2 -2
  52. package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
  53. package/dist/zone/form/components/ZoneControl.js +1 -1
  54. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -4
  55. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
  56. package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
  57. package/dist/zone/form/utils/dates.d.ts.map +1 -1
  58. package/package.json +5 -6
  59. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +6 -8
  60. package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +1 -0
  61. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +0 -1
  62. package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +8 -2
  63. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -0
  64. package/src/notification/email-template/card/EmailTemplateCard.tsx +43 -36
  65. package/src/notification/email-template/control/EmailTemplateControl.tsx +1 -0
  66. package/src/notification/sms-template/card/SmsTemplateCard.tsx +9 -0
  67. package/src/product-set/control/DateAndRecurrenceInput.tsx +3 -4
  68. package/src/product-set/control/ProductSetControl.tsx +8 -3
  69. package/src/product-set/form/ProductCategoriesControl.tsx +3 -2
  70. package/src/product-set/form/ProductSetForm.tsx +10 -2
  71. package/src/product-set/hooks/useSortableTreeFunctions.ts +0 -1
  72. package/src/product-set/product/ProductControl.tsx +1 -1
  73. package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +4 -18
  74. package/src/recurring-date-picker-input/RecurringDatePickerInput.stories.tsx +13 -7
  75. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +12 -1
  76. package/src/recurring-date-picker-input/utils.ts +90 -1
  77. package/src/sales/booking/results/components/ResultCard.tsx +0 -3
  78. package/src/setting/admin/AdminSettingForm.tsx +2 -2
  79. package/src/styles/sales/BookingResults.scss +1 -1
  80. package/src/styles/snippet-templates/SnippetTemplateCard.scss +3 -0
  81. package/src/styles/zones/ZoneForm.scss +2 -1
  82. package/src/zone/form/ZoneForm.tsx +3 -2
  83. package/src/zone/form/components/ZoneControl.tsx +3 -3
  84. package/src/zone/form/components/ZoneRecurrencesControl.tsx +7 -5
  85. package/src/zone/form/utils/dates.ts +9 -10
@@ -1,9 +1,7 @@
1
- import { DateTime } from "luxon";
2
1
  import React from "react";
3
2
  import { Col, Row } from "react-bootstrap";
4
3
  import { useFormContext } from "react-hook-form";
5
4
  import { useTranslation } from "react-i18next";
6
- import { TIME_FORMAT } from "@licklist/core/dist/Config";
7
5
  import { WorkingHoursInputValues } from ".";
8
6
  import { useWeekdays } from "./utils";
9
7
 
@@ -25,22 +23,10 @@ export function WorkingHoursInputDescription() {
25
23
  <Row key={i}>
26
24
  <Col xs="auto">{weekdays[i]}:</Col>
27
25
  <Col>
28
- {weekday?.end
29
- ? weekday.start
30
- ? t("timeInterval", {
31
- start: DateTime.fromISO(weekday.start).toFormat(
32
- TIME_FORMAT
33
- ),
34
- end: DateTime.fromISO(weekday.start).toFormat(
35
- TIME_FORMAT
36
- ),
37
- })
38
- : t("timeFrom", {
39
- start: DateTime.fromISO(weekday.start).toFormat(
40
- TIME_FORMAT
41
- ),
42
- })
43
- : null}
26
+ {t("timeInterval", {
27
+ start: weekday.start,
28
+ end: weekday.end,
29
+ })}
44
30
  </Col>
45
31
  </Row>
46
32
  );
@@ -1,22 +1,19 @@
1
1
  import React from "react";
2
2
  import { Meta, Story } from "@storybook/react";
3
3
  import { Card } from "react-bootstrap";
4
+ import { DateTime } from "luxon";
5
+ import { DATE_FORMAT, TIME_FORMAT } from "@licklist/core/dist/Config/Date";
4
6
  import {
5
7
  RecurringDatePickerInput,
6
8
  RecurringDatePickerInputProps,
7
9
  } from "./RecurringDatePickerInput";
8
- import { DateTime } from "luxon";
9
- import { DATE_FORMAT, TIME_FORMAT } from "@licklist/core/dist/Config/Date";
10
10
 
11
11
  export default {
12
12
  title: "RecurringDatePickerInput",
13
13
  component: RecurringDatePickerInput,
14
14
  } as Meta;
15
15
 
16
- interface DefaultRecurringDatePickerInputProps
17
- extends RecurringDatePickerInputProps {}
18
-
19
- export const Default: Story<DefaultRecurringDatePickerInputProps> = (args) => {
16
+ export const Default: Story<RecurringDatePickerInputProps> = (args) => {
20
17
  return (
21
18
  <Card style={{ maxWidth: "max-content" }}>
22
19
  <Card.Body>
@@ -25,7 +22,7 @@ export const Default: Story<DefaultRecurringDatePickerInputProps> = (args) => {
25
22
  </Card>
26
23
  );
27
24
  };
28
- export const Valid: Story<DefaultRecurringDatePickerInputProps> = (args) => {
25
+ export const Valid: Story<RecurringDatePickerInputProps> = (args) => {
29
26
  return (
30
27
  <Card style={{ maxWidth: "max-content" }}>
31
28
  <Card.Body>
@@ -36,6 +33,15 @@ export const Valid: Story<DefaultRecurringDatePickerInputProps> = (args) => {
36
33
  };
37
34
  Default.args = {
38
35
  onChange: (data) => console.log("onSubmit", data),
36
+ workHours: [
37
+ { start: "20:00", end: "04:00", day: 0, description: "" },
38
+ { start: "20:00", end: "04:00", day: 1, description: "" },
39
+ { start: "20:00", end: "04:00", day: 2, description: "" },
40
+ { start: "20:00", end: "12:00", day: 3, description: "" },
41
+ { start: "20:00", end: "23:00", day: 4, description: "" },
42
+ { start: "08:00", end: "12:00", day: 5, description: "" },
43
+ { start: "10:00", end: "16:00", day: 6, description: "" },
44
+ ],
39
45
  };
40
46
  Valid.args = {
41
47
  onChange: (data) => console.log("onSubmit", data),
@@ -12,9 +12,14 @@ import {
12
12
  import { usePreviousValue } from "@licklist/plugins/dist/hooks/Value/usePreviousValue";
13
13
  import { FormProvider, useForm } from "react-hook-form";
14
14
  import { Form } from "react-bootstrap";
15
+ import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
15
16
  import RecurrenceIntervalAndFrequencyInput from "./RecurrenceIntervalAndFrequencyInput";
16
17
  import RecurrenceWeekdaysInput from "./RecurrenceWeekdaysInput";
17
- import { parseAndValidateRRule, SupportedFrequency } from "./utils";
18
+ import {
19
+ parseAndValidateRRule,
20
+ SupportedFrequency,
21
+ useWorkHoursValidation,
22
+ } from "./utils";
18
23
  import { ConfirmModal } from "../modals";
19
24
  import { DeleteFieldButton } from "../product-set/elements";
20
25
 
@@ -26,6 +31,7 @@ export interface RecurringDatePickerInputProps {
26
31
  initialFrequency?: Frequency;
27
32
  setInitialStartDateAfterSelect?: boolean;
28
33
  minDate?: string;
34
+ workHours: WorkHour[] | undefined;
29
35
  }
30
36
 
31
37
  export interface RecurringDatePickerInputValues {
@@ -51,6 +57,7 @@ export function RecurringDatePickerInput({
51
57
  setInitialStartDateAfterSelect = false,
52
58
  children,
53
59
  minDate,
60
+ workHours,
54
61
  }: PropsWithChildren<RecurringDatePickerInputProps>) {
55
62
  const { t } = useTranslation(["Design"]);
56
63
 
@@ -84,6 +91,8 @@ export function RecurringDatePickerInput({
84
91
  byWeekDay,
85
92
  });
86
93
 
94
+ const validator = useWorkHoursValidation(byWeekDay, workHours);
95
+
87
96
  const onSubmit = (nextState: RecurringDatePickerInputValues) => {
88
97
  const end = getDateTimeObject(endDate, endTime || "23:59:59");
89
98
 
@@ -188,6 +197,8 @@ export function RecurringDatePickerInput({
188
197
  <RecurrenceIntervalAndFrequencyInput
189
198
  disabled={disabled}
190
199
  minDate={minDate}
200
+ startTimeRules={validator}
201
+ endTimeRules={validator}
191
202
  />
192
203
 
193
204
  {children}
@@ -1,4 +1,9 @@
1
- import { DateTime } from "luxon";
1
+ import { TIME_FORMAT, TIME_FULL_FORMAT } from "@licklist/core/dist/Config";
2
+ import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
3
+ import { fromFormat } from "@licklist/plugins/dist/utils/dateTime";
4
+ import { DateTime, Interval } from "luxon";
5
+ import { Validate } from "react-hook-form";
6
+ import { useTranslation } from "react-i18next";
2
7
  import RRule, { Frequency, Weekday } from "rrule";
3
8
 
4
9
  export const getWeekdayForFrequency = ({
@@ -11,6 +16,7 @@ export const getWeekdayForFrequency = ({
11
16
  const parsedDate = DateTime.fromISO(date);
12
17
  return new Weekday(
13
18
  parsedDate.weekday - 1,
19
+ // eslint-disable-next-line no-nested-ternary
14
20
  frequency !== Frequency.MONTHLY
15
21
  ? undefined
16
22
  : parsedDate.day + 7 > parsedDate.daysInMonth
@@ -109,3 +115,86 @@ export const parseAndValidateRRule = ({
109
115
  until: options.until,
110
116
  } as ParsedRRuleOptions;
111
117
  };
118
+
119
+ export const useWorkHoursValidation = (
120
+ byWeekDay: Weekday[] = [],
121
+ workHours: WorkHour[] | undefined
122
+ ): {
123
+ validate?: Validate<string>;
124
+ } => {
125
+ const { t } = useTranslation("Validation");
126
+ if (!workHours) return {};
127
+
128
+ const fromTimeFormat = fromFormat(TIME_FORMAT);
129
+ const fromTimeFullFormat = fromFormat(TIME_FULL_FORMAT);
130
+
131
+ // map every day to array of intervals describing workhours for that day
132
+ let intervalsByDay = workHours.map((workhour, index, self) => {
133
+ const res: Interval[] = [];
134
+
135
+ const startTime = fromTimeFormat(workhour.start);
136
+ const endTime = fromTimeFormat(workhour.end);
137
+
138
+ if (endTime > startTime) {
139
+ res.push(Interval.fromDateTimes(startTime, endTime));
140
+ } else {
141
+ // if end is before start, then it means that end is on the next day
142
+ // so count only to the end of current day
143
+ res.push(Interval.fromDateTimes(startTime, startTime.endOf("day")));
144
+ }
145
+
146
+ const prevIndex = index === 0 ? self.length - 1 : index - 1;
147
+
148
+ const prevStartTime = fromTimeFormat(self[prevIndex].start);
149
+ const prevEndTime = fromTimeFormat(self[prevIndex].end);
150
+
151
+ // if prevStartTime > prevEndTime then it means that prevEndTime is on the current day
152
+ // so we need to add interval from start of current day to prevEndTime
153
+ if (prevStartTime > prevEndTime) {
154
+ res.push(Interval.fromDateTimes(prevEndTime.startOf("day"), prevEndTime));
155
+ }
156
+
157
+ return res;
158
+ });
159
+
160
+ // if length === 0 or length === 7 then all workhours are selected, no need to filter
161
+ if (![0, 7].includes(byWeekDay.length)) {
162
+ intervalsByDay = intervalsByDay.filter((_, index) =>
163
+ byWeekDay.find(({ weekday }) => weekday === index)
164
+ );
165
+ }
166
+
167
+ return {
168
+ validate: (_time: string) => {
169
+ // workaround for issue with form values
170
+ // default values and entered values have different formats
171
+ const time = fromTimeFormat(_time).isValid
172
+ ? fromTimeFormat(_time)
173
+ : fromTimeFullFormat(_time);
174
+
175
+ const notFittingIntervalsByDay = intervalsByDay.reduce<Interval[][]>(
176
+ (acc, intervalsByDay) => {
177
+ if (!intervalsByDay.some((interval) => interval.contains(time))) {
178
+ acc.push(intervalsByDay);
179
+ }
180
+ return acc;
181
+ },
182
+ []
183
+ );
184
+
185
+ const notFittingIntervals = notFittingIntervalsByDay
186
+ .flat()
187
+ .filter((interval) => !interval.contains(time));
188
+
189
+ const attribute = notFittingIntervals
190
+ .map((interval) => interval.toFormat("HH:mm"))
191
+ .join(", ");
192
+
193
+ if (notFittingIntervalsByDay.length !== 0) {
194
+ return t("outsideWorkingHours", { attribute }) as string;
195
+ }
196
+
197
+ return true;
198
+ },
199
+ };
200
+ };
@@ -12,7 +12,6 @@ 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
-
16
15
  import Icon from "../../../../static/Icon";
17
16
 
18
17
  export type ResultCardProps = {
@@ -22,8 +21,6 @@ export type ResultCardProps = {
22
21
  onCardClick?: (id: number) => void;
23
22
  };
24
23
 
25
- // @TODO integrate when API will be available
26
- // activity and staff keys
27
24
  export const ResultCard = ({
28
25
  order,
29
26
  className,
@@ -11,7 +11,7 @@ import Row from "react-bootstrap/Row";
11
11
  import Col from "react-bootstrap/Col";
12
12
  import { Link } from "react-router-dom";
13
13
  import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
14
- import { ProviderType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
14
+ import { ProvidableType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
15
15
  import Icon from "../../static/Icon";
16
16
  import { PaymentFeeForm, PaymentFeeFormFieldValues } from "./PaymentFeeForm";
17
17
  import { Currency } from "../../types/currency";
@@ -33,7 +33,7 @@ export interface AdminSettingFormProps extends HasPermissionProp {
33
33
  providerMetadata: {
34
34
  country?: string;
35
35
  providableId?: number;
36
- providerType?: ProviderType;
36
+ providerType?: ProvidableType;
37
37
  };
38
38
  }
39
39
 
@@ -5,7 +5,7 @@
5
5
  flex-wrap: wrap;
6
6
 
7
7
  .result-card {
8
- height: 14.25rem;
8
+ height: 14rem;
9
9
  border: 1px solid $gray-400;
10
10
  max-width: calc(50% - 0.75rem);
11
11
  flex: 0 0 calc(50% - 0.75rem);
@@ -65,6 +65,9 @@ $snippet-template-card-button-transition: $product-set-card-transition !default;
65
65
  }
66
66
 
67
67
  .snippet-template-card-button {
68
+ display: flex;
69
+ justify-content: center;
70
+ align-items: center;
68
71
  padding: 0;
69
72
  border: none;
70
73
  background: transparent;
@@ -1,4 +1,5 @@
1
1
  .zone-available-times {
2
+ overscroll-behavior: contain;
2
3
  display: flex;
3
4
  flex-wrap: wrap;
4
5
  gap: 1.5rem;
@@ -7,4 +8,4 @@
7
8
  justify-content: start;
8
9
  width: 95%;
9
10
  overflow: scroll;
10
- }
11
+ }
@@ -13,7 +13,7 @@ export type ZoneFormProps = {
13
13
  onSubmit: (values: Partial<Zone>) => void;
14
14
  serverErrors?: ServerError;
15
15
  isLoading?: boolean;
16
- workHours?: WorkHour[];
16
+ workHours: WorkHour[] | undefined;
17
17
  };
18
18
 
19
19
  export type ZoneFormValues = Partial<Zone> & {
@@ -25,6 +25,7 @@ export const ZoneForm = ({
25
25
  onSubmit,
26
26
  serverErrors,
27
27
  isLoading = false,
28
+ workHours,
28
29
  }: ZoneFormProps) => {
29
30
  const { t } = useTranslation("Design");
30
31
  const form = useForm<ZoneFormValues>({
@@ -54,7 +55,7 @@ export const ZoneForm = ({
54
55
  return (
55
56
  <FormProvider {...form}>
56
57
  <Form onSubmit={handleSubmit(onFormSubmit)}>
57
- <ZoneControl isLoading={isLoading} />
58
+ <ZoneControl isLoading={isLoading} workHours={workHours} />
58
59
  <Row>
59
60
  <Col md={6} sm={12} />
60
61
  <Col
@@ -11,15 +11,15 @@ import { GameDurationControl } from "./GameDurationControl";
11
11
 
12
12
  export type ZoneControlProps = {
13
13
  isLoading: boolean;
14
- workHours?: WorkHour[];
14
+ workHours: WorkHour[] | undefined;
15
15
  };
16
16
 
17
- export const ZoneControl = ({ isLoading }: ZoneControlProps) => {
17
+ export const ZoneControl = ({ isLoading, workHours }: ZoneControlProps) => {
18
18
  return (
19
19
  <Row>
20
20
  <Col md={6} sm={12} className="pr-5">
21
21
  <NameControl isLoading={isLoading} />
22
- <ZoneRecurrencesControl />
22
+ <ZoneRecurrencesControl workHours={workHours} />
23
23
  <hr />
24
24
  <Row>
25
25
  <Col md={6} sm={6}>
@@ -25,12 +25,13 @@ export interface DateAndRecurrenceInputValues {
25
25
  zoneRecurrences?: Partial<ZoneRecurrence>[];
26
26
  }
27
27
 
28
- export type ZoneRecurrenceControlProps = {
29
- workHours?: WorkHour[];
30
- isLoading?: boolean;
28
+ type ZoneRecurrenceControlProps = {
29
+ workHours: WorkHour[] | undefined;
31
30
  };
32
31
 
33
- export const ZoneRecurrencesControl = () => {
32
+ export const ZoneRecurrencesControl = ({
33
+ workHours,
34
+ }: ZoneRecurrenceControlProps) => {
34
35
  const {
35
36
  control,
36
37
  register,
@@ -69,7 +70,7 @@ export const ZoneRecurrencesControl = () => {
69
70
  clearEditState();
70
71
  });
71
72
 
72
- const popoverId = useId()!;
73
+ const popoverId = useId();
73
74
 
74
75
  const { t } = useTranslation(["Design", "Validation"]);
75
76
 
@@ -166,6 +167,7 @@ export const ZoneRecurrencesControl = () => {
166
167
  onChange={handleRecurringDateChange}
167
168
  onDelete={handleDelete}
168
169
  setInitialStartDateAfterSelect
170
+ workHours={workHours}
169
171
  />
170
172
  </Popover.Content>
171
173
  </Popover>
@@ -53,18 +53,17 @@ export const getCheckboxesByWorkHours = (workHours?: WorkHour[]) => {
53
53
  if (!workHours || !workHours.length)
54
54
  return getTimeCheckboxRanges(DEFAULT_START_DAY_TIME, DEFAULT_END_DAY_TIME);
55
55
 
56
- const providerWorkHoursByWeek = workHours.reduce(
57
- (workHoursNextArray: { start: string; end: string }[], currentWorkHour) => {
58
- const { start, end } = currentWorkHour;
56
+ const providerWorkHoursByWeek = workHours.reduce<
57
+ { start: string; end: string }[]
58
+ >((workHoursNextArray, currentWorkHour) => {
59
+ const { start, end } = currentWorkHour;
59
60
 
60
- if (start && end) {
61
- return [...workHoursNextArray, { start, end }];
62
- }
61
+ if (start && end) {
62
+ return [...workHoursNextArray, { start, end }];
63
+ }
63
64
 
64
- return workHoursNextArray;
65
- },
66
- []
67
- );
65
+ return workHoursNextArray;
66
+ }, []);
68
67
 
69
68
  // If venue has filled only 1 work day from wee
70
69
  // For another days we use default 00:00 and 23:59