IO-1055 Blocked Day improvements.
This commit is contained in:
@@ -43,6 +43,12 @@ export function ScheduleCalendarHeaderComponent({
|
||||
);
|
||||
}, [events, date]);
|
||||
|
||||
const isDayBlocked = useMemo(() => {
|
||||
return events.filter(
|
||||
(e) => moment(date).isSame(moment(e.start), "day") && e.block
|
||||
);
|
||||
}, [events, date]);
|
||||
|
||||
const { t } = useTranslation();
|
||||
const loadData = load[date.toISOString().substr(0, 10)];
|
||||
|
||||
@@ -136,9 +142,9 @@ export function ScheduleCalendarHeaderComponent({
|
||||
<div>
|
||||
<ul style={{ listStyleType: "none", columns: "2 auto", padding: 0 }}>
|
||||
{Object.keys(ATSToday).map((key, idx) => (
|
||||
<li key={idx}>{`${key === "null" ? "N/A" : key}: ${
|
||||
ATSToday[key].length
|
||||
}`}</li>
|
||||
<li key={idx}>{`${
|
||||
key === "null" || key === "undefined" ? "N/A" : key
|
||||
}: ${ATSToday[key].length}`}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
@@ -179,7 +185,11 @@ export function ScheduleCalendarHeaderComponent({
|
||||
|
||||
return (
|
||||
<div className="imex-calendar-load">
|
||||
<ScheduleBlockDay date={date} refetch={refetch}>
|
||||
<ScheduleBlockDay
|
||||
alreadyBlocked={isDayBlocked.length > 0}
|
||||
date={date}
|
||||
refetch={refetch}
|
||||
>
|
||||
<div style={{ color: isShopOpen(date) ? "" : "tomato" }}>
|
||||
{label}
|
||||
{calculating ? <LoadingSkeleton /> : LoadComponent}
|
||||
|
||||
Reference in New Issue
Block a user