Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions examples/example47-grayed-out-sch-tab-with-panels.fixture.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { RunFrame } from "lib/components/RunFrame/RunFrame"
import React from "react"

export default () => (
<RunFrame
fsMap={{
"main.tsx": `
circuit.add(
<panel width="50mm" height="20mm">
<board width="20mm" height="15mm">
<resistor resistance="1k" footprint="0402" name="R1" />
</board>
</panel>
)
`,
}}
entrypoint="main.tsx"
/>
)
8 changes: 7 additions & 1 deletion lib/components/CircuitJsonPreview/CircuitJsonPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ export const CircuitJsonPreview = ({
return circuitJson.some((e) => e.type === "schematic_group")
}, [circuitJson])

const hasPanels = useMemo(() => {
return circuitJson?.some((e) => e.type === "pcb_panel")
}, [circuitJson])

useErrorTelemetry({
errorMessage,
errorStack,
Expand Down Expand Up @@ -296,7 +300,9 @@ export const CircuitJsonPreview = ({
"rf-whitespace-nowrap",
circuitJson && !hasSchematicGroup && "rf-opacity-50",
)}
disabled={circuitJson ? !hasSchematicGroup : false}
disabled={
circuitJson ? !hasSchematicGroup || hasPanels : false
}
>
{circuitJson && (
<span
Expand Down