diff --git a/geneit_app/src/routes/family/accommodations/AccommodationsReservationsRoute.tsx b/geneit_app/src/routes/family/accommodations/AccommodationsReservationsRoute.tsx index 669d5c7..20b3e4f 100644 --- a/geneit_app/src/routes/family/accommodations/AccommodationsReservationsRoute.tsx +++ b/geneit_app/src/routes/family/accommodations/AccommodationsReservationsRoute.tsx @@ -11,6 +11,9 @@ import { FormControlLabel, FormGroup, FormLabel, + Popover, + Typography, + fabClasses, } from "@mui/material"; import React from "react"; import { FamilyApi, FamilyUser } from "../../../api/FamilyApi"; @@ -55,6 +58,17 @@ export function AccommodationsReservationsRoute(): React.ReactElement { Set >(new Set()); + const eventPopupAnchor = React.useRef(null); + const [activeEvent, setActiveEvent] = React.useState< + | undefined + | { + x: number; + y: number; + w: number; + h: number; + } + >(); + const load = async () => { setReservations( await AccommodationsReservationsApi.FullListOfFamily(family.family) @@ -113,6 +127,8 @@ export function AccommodationsReservationsRoute(): React.ReactElement { }; const onEventClick = (ev: EventClickArg) => { + const loc = ev.el.getBoundingClientRect(); + setActiveEvent({ x: loc.left, y: loc.top, w: loc.width, h: loc.height }); console.log(ev); }; @@ -271,6 +287,33 @@ export function AccommodationsReservationsRoute(): React.ReactElement { })} /> + + {/* Calendar event popover */} +
+ { + setActiveEvent(undefined); + }} + anchorOrigin={{ + vertical: "bottom", + horizontal: "left", + }} + > + The content of the Popover. + )} />