Skip to content

Commit

Permalink
add decorator to simplify examples
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Dec 10, 2024
1 parent 8b07a55 commit 3bbbbdf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
3 changes: 3 additions & 0 deletions cosmos.decorator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default ({ children }: { children: React.ReactNode }) => (
<div style={{ width: "100vw", height: "100vh" }}>{children}</div>
)
20 changes: 9 additions & 11 deletions examples/resistor-and-capacitor.fixture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import { SchematicViewer } from "lib/components/SchematicViewer"
import { renderToCircuitJson } from "lib/dev/render-to-circuit-json"

export default () => (
<div style={{ width: "100vw", height: "90vh" }}>
<SchematicViewer
circuitJson={renderToCircuitJson(
<board width="10mm" height="10mm">
<resistor name="R1" resistance={1000} schX={-2} />
<capacitor name="C1" capacitance="1uF" schX={2} />
<trace from=".R1 .pin2" to=".C1 .pin1" />
</board>,
)}
/>
</div>
<SchematicViewer
circuitJson={renderToCircuitJson(
<board width="10mm" height="10mm">
<resistor name="R1" resistance={1000} schX={-2} />
<capacitor name="C1" capacitance="1uF" schX={2} />
<trace from=".R1 .pin2" to=".C1 .pin1" />
</board>,
)}
/>
)

0 comments on commit 3bbbbdf

Please sign in to comment.