diff --git a/frontend/src/components/examples/CircuitPreview.tsx b/frontend/src/components/examples/CircuitPreview.tsx index 405cfc13..07a946e3 100644 --- a/frontend/src/components/examples/CircuitPreview.tsx +++ b/frontend/src/components/examples/CircuitPreview.tsx @@ -207,10 +207,6 @@ export const CircuitPreview: React.FC = ({ } }); - // Wire endpoints also need to resolve by componentId - // Build a fast id→id map for wire routing (componentId → item.id) - const idSet = new Set(items.map(i => i.id)); - return (
= ({ ); })} - {/* ── Wire overlay ─────────────────────────────────────────────────── */} - - {example.wires?.map((wire, i) => { - const from = centreMap[wire.start.componentId] ?? (idSet.has(wire.start.componentId) ? undefined : null); - const to = centreMap[wire.end.componentId] ?? (idSet.has(wire.end.componentId) ? undefined : null); - if (!from || !to) return null; - const ddx = to[0] - from[0], ddy = to[1] - from[1]; - if (ddx * ddx + ddy * ddy < 9) return null; - return ( - - ); - })} -
); }; diff --git a/frontend/src/components/layout/ShareModal.tsx b/frontend/src/components/layout/ShareModal.tsx index 6e8bce0d..c0bc218e 100644 --- a/frontend/src/components/layout/ShareModal.tsx +++ b/frontend/src/components/layout/ShareModal.tsx @@ -3,6 +3,7 @@ */ import React, { useState } from 'react'; +import { createPortal } from 'react-dom'; import { useProjectStore } from '../../store/useProjectStore'; import { updateProject } from '../../services/projectService'; @@ -40,7 +41,7 @@ export const ShareModal: React.FC = ({ onClose }) => { } }; - return ( + return createPortal(
e.stopPropagation()}>

Share project

@@ -111,7 +112,8 @@ export const ShareModal: React.FC = ({ onClose }) => {
- + , + document.body ); };