diff --git a/apps/calendar/apps/web/src/lib/components/calendar/DayView.svelte b/apps/calendar/apps/web/src/lib/components/calendar/DayView.svelte index e8dc910f3..5a501906a 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/DayView.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/DayView.svelte @@ -6,12 +6,9 @@ import { searchStore } from '$lib/stores/search.svelte'; import { todosStore, type Task } from '$lib/stores/todos.svelte'; import { eventContextMenuStore } from '$lib/stores/eventContextMenu.svelte'; - import { birthdaysStore, type BirthdayEvent } from '$lib/stores/birthdays.svelte'; + import { birthdaysStore } from '$lib/stores/birthdays.svelte'; import BirthdayPopover from '$lib/components/birthday/BirthdayPopover.svelte'; - import { - useVisibleHours, - useCurrentTimeIndicator, - } from '$lib/composables/useVisibleHours.svelte'; + import { useVisibleHours, useCurrentTimeIndicator, useBirthdayPopover } from '$lib/composables'; import { toDate } from '$lib/utils/eventDateHelpers'; import { HOUR_HEIGHT_PX, SNAP_INTERVAL_MINUTES } from '$lib/utils/calendarConstants'; import { @@ -102,9 +99,8 @@ let blockAllDayEvents = $derived(allDayEvents.filter((e) => getEventDisplayMode(e) === 'block')); - // Birthday Popover State - let selectedBirthday = $state(null); - let birthdayPopoverPosition = $state<{ x: number; y: number }>({ x: 0, y: 0 }); + // Birthday Popover (using composable) + const birthdayPopover = useBirthdayPopover(); // Get birthdays for current day (if enabled in settings) let birthdays = $derived.by(() => { @@ -112,18 +108,6 @@ return birthdaysStore.getBirthdaysForDay(viewStore.currentDate); }); - // Handle birthday click - show popover - function handleBirthdayClick(birthday: BirthdayEvent, e: MouseEvent) { - e.stopPropagation(); - selectedBirthday = birthday; - birthdayPopoverPosition = { x: e.clientX, y: e.clientY }; - } - - // Close birthday popover - function closeBirthdayPopover() { - selectedBirthday = null; - } - // ============================================================================ // Drag & Drop State // ============================================================================ @@ -744,7 +728,7 @@ {#each birthdays as birthday}