fix(web): portal timeline overlays above stacked panels
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user