Skip to content

Commit 3bbbbdf

Browse files
committed
add decorator to simplify examples
1 parent 8b07a55 commit 3bbbbdf

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

cosmos.decorator.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default ({ children }: { children: React.ReactNode }) => (
2+
<div style={{ width: "100vw", height: "100vh" }}>{children}</div>
3+
)

examples/resistor-and-capacitor.fixture.tsx

+9-11
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ import { SchematicViewer } from "lib/components/SchematicViewer"
22
import { renderToCircuitJson } from "lib/dev/render-to-circuit-json"
33

44
export default () => (
5-
<div style={{ width: "100vw", height: "90vh" }}>
6-
<SchematicViewer
7-
circuitJson={renderToCircuitJson(
8-
<board width="10mm" height="10mm">
9-
<resistor name="R1" resistance={1000} schX={-2} />
10-
<capacitor name="C1" capacitance="1uF" schX={2} />
11-
<trace from=".R1 .pin2" to=".C1 .pin1" />
12-
</board>,
13-
)}
14-
/>
15-
</div>
5+
<SchematicViewer
6+
circuitJson={renderToCircuitJson(
7+
<board width="10mm" height="10mm">
8+
<resistor name="R1" resistance={1000} schX={-2} />
9+
<capacitor name="C1" capacitance="1uF" schX={2} />
10+
<trace from=".R1 .pin2" to=".C1 .pin1" />
11+
</board>,
12+
)}
13+
/>
1614
)

0 commit comments

Comments
 (0)