Skip to content

Commit

Permalink
Fix Time detail overlay data
Browse files Browse the repository at this point in the history
  • Loading branch information
sjkneisler committed Apr 30, 2024
1 parent ba756ff commit fa1ec21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/src/components/AggregateWeekyCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const AggregateWeeklyCalendar: React.FC<{
labels?: string[];
labelProps?: TypographyProps[];
granularity: ScheduleGranularity;
timezone: string;
}> = ({
availability,
labels = [
Expand All @@ -37,6 +38,7 @@ export const AggregateWeeklyCalendar: React.FC<{
],
labelProps = [],
granularity,
timezone,
}) => {
const [currentHover, setCurrentHover] = useState<DragPosition | null>(null);
const [schedule] = useContext(ScheduleContext);
Expand Down Expand Up @@ -72,7 +74,7 @@ export const AggregateWeeklyCalendar: React.FC<{
return (
shiftAvailabilityByTimezone(
user.availability.weekly,
getTimezoneOffset(user.timezone || getCurrentTimezone()),
getTimezoneOffset(timezone || getCurrentTimezone()),
)[currentHover.day][currentHover.time] === Availability.Green
);
})
Expand All @@ -82,7 +84,7 @@ export const AggregateWeeklyCalendar: React.FC<{
return (
shiftAvailabilityByTimezone(
user.availability.weekly,
getTimezoneOffset(user.timezone || getCurrentTimezone()),
getTimezoneOffset(timezone || getCurrentTimezone()),
)[currentHover.day][currentHover.time] === Availability.Yellow
);
})
Expand All @@ -92,7 +94,7 @@ export const AggregateWeeklyCalendar: React.FC<{
return (
shiftAvailabilityByTimezone(
user.availability.weekly,
getTimezoneOffset(user.timezone || getCurrentTimezone()),
getTimezoneOffset(timezone || getCurrentTimezone()),
)[currentHover.day][currentHover.time] === Availability.Red
);
})
Expand Down Expand Up @@ -133,7 +135,7 @@ export const AggregateWeeklyCalendar: React.FC<{
<HoursGuide />
</div>
</div>
{currentHover && userAvailabilities && (
{currentHover && userAvailabilities && schedule.users.length > 0 && (
<TimeDetailOverlay
startTime={currentHover}
userAvailabilities={userAvailabilities}
Expand Down
1 change: 1 addition & 0 deletions app/src/pages/AggregateExceptionsCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export const AggregateExceptionsCalendar: React.FC = () => {
labels={dayLabels}
labelProps={dayLabelProps}
granularity={schedule.granularity}
timezone={timezone}
/>
</Stack>
</PageContainer>
Expand Down
1 change: 1 addition & 0 deletions app/src/pages/CampaignView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export const CampaignView: React.FC = () => {
<AggregateWeeklyCalendar
availability={showAvailability}
granularity={schedule.granularity}
timezone={timezone}
/>
</Stack>
</PageContainer>
Expand Down

0 comments on commit fa1ec21

Please sign in to comment.