fix(web): portal timeline overlays above stacked panels

This commit is contained in:
2026-03-30 13:18:08 +02:00
parent 58824545fc
commit e20bf64eef
5 changed files with 22 additions and 6 deletions
@@ -2,6 +2,7 @@
import { clsx } from "clsx";
import { useEffect, useRef, useState } from "react";
import { createPortal } from "react-dom";
import type { AllocationLike, AllocationReadModel, Assignment } from "@capakraken/shared";
import { trpc } from "~/lib/trpc/client.js";
import { useInvalidateTimeline } from "~/hooks/useInvalidatePlanningViews.js";
@@ -89,16 +90,17 @@ export function AllocationPopover({
}
if (isLoading || !allocation) {
return (
const loadingPopover = (
<div ref={ref} style={style} className="bg-white border border-gray-200 rounded-xl shadow-xl p-4 text-sm text-gray-500">
Loading...
</div>
);
return typeof document === "undefined" ? loadingPopover : createPortal(loadingPopover, document.body);
}
const dailyCostEUR = ((hoursPerDay ?? allocation.hoursPerDay) * (allocation.resource?.lcrCents ?? 0) / 100).toFixed(2);
return (
const popover = (
<div
ref={ref}
style={style}
@@ -211,4 +213,6 @@ export function AllocationPopover({
</div>
</div>
);
return typeof document === "undefined" ? popover : createPortal(popover, document.body);
}