From d6115dc30d573b4409f8d3f95246743be7054b80 Mon Sep 17 00:00:00 2001 From: Joyce <26967919+Joyce-O@users.noreply.github.com> Date: Thu, 5 Feb 2026 20:35:19 -0500 Subject: [PATCH] update --- .../src/components/AvailabilityHeatmapV2.tsx | 57 +++++- .../src/components/ParticipantSelector.tsx | 14 ++ frontend/src/components/TimezoneSelector.tsx | 25 ++- frontend/src/components/ui/sheet.tsx | 135 ++++++++----- frontend/src/pages/Index.tsx | 188 +++++++++--------- 5 files changed, 257 insertions(+), 162 deletions(-) diff --git a/frontend/src/components/AvailabilityHeatmapV2.tsx b/frontend/src/components/AvailabilityHeatmapV2.tsx index 9638307..f4c002d 100644 --- a/frontend/src/components/AvailabilityHeatmapV2.tsx +++ b/frontend/src/components/AvailabilityHeatmapV2.tsx @@ -156,6 +156,23 @@ export const AvailabilityHeatmapV2 = ({ }); }; + // Move hooks to top level to avoid conditional hook execution error + const tzOffsetDiff = useMemo(() => { + try { + const now = new Date(); + const p = parseInt(new Intl.DateTimeFormat('en-US', { timeZone: displayTimezone, hour: 'numeric', hour12: false }).format(now)); + const s = parseInt(new Intl.DateTimeFormat('en-US', { timeZone: secondaryTimezone, hour: 'numeric', hour12: false }).format(now)); + let diff = s - p; + if (diff > 12) diff -= 24; + if (diff < -12) diff += 24; + return diff; + } catch { + return 0; + } + }, [displayTimezone, secondaryTimezone]); + + const timeColWidth = showSecondaryTimezone ? "120px" : "80px"; + if (selectedParticipants.length === 0) { return (
+ Configure your calendar preferences. +
- When enabled, shows time slots where only some participants are available. -
- -