refactor(rack-planner): lift port config modal state to root level to avoid rendering issues within transformed modules
This commit is contained in:
@@ -18,6 +18,7 @@ import { RackColumn } from './RackColumn';
|
||||
import { DevicePalette } from './DevicePalette';
|
||||
import { ConnectionLayer } from './ConnectionLayer';
|
||||
import { AddModuleModal } from '../modals/AddModuleModal';
|
||||
import { PortConfigModal } from '../modals/PortConfigModal';
|
||||
import { RackSkeleton } from '../ui/Skeleton';
|
||||
import type { ModuleType } from '../../types';
|
||||
import { MODULE_TYPE_COLORS, MODULE_TYPE_LABELS } from '../../lib/constants';
|
||||
@@ -85,7 +86,7 @@ const POINTER_SENSOR_OPTIONS = {
|
||||
};
|
||||
|
||||
export function RackPlanner() {
|
||||
const { racks, loading, fetchRacks, moveModule } = useRackStore();
|
||||
const { racks, loading, fetchRacks, moveModule, activeConfigPortId, setActiveConfigPortId } = useRackStore();
|
||||
const canvasRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// Drag state
|
||||
@@ -295,6 +296,14 @@ export function RackPlanner() {
|
||||
initialType={pendingDrop.type}
|
||||
/>
|
||||
)}
|
||||
|
||||
{activeConfigPortId && (
|
||||
<PortConfigModal
|
||||
open={!!activeConfigPortId}
|
||||
portId={activeConfigPortId}
|
||||
onClose={() => setActiveConfigPortId(null)}
|
||||
/>
|
||||
)}
|
||||
</DndContext>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user