Skip to content

Commit 4ca0674

Browse files
committed
Fix nested story
1 parent a4fd9c9 commit 4ca0674

File tree

2 files changed

+40
-23
lines changed

2 files changed

+40
-23
lines changed

Diff for: src/components/stories/01-examples/01-Nested.mdx

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs";
2+
3+
import { ViewPort, Left, Top, Right, Bottom, LeftResizable, TopResizable, RightResizable, BottomResizable, Fill } from "../../";
4+
import { red, green, blue, description } from "../Utils";
5+
import { CommonHeader } from "../Utils";
6+
import * as Stories from './01-Nested.stories';
7+
8+
<CommonHeader />
9+
10+
<Meta of={Stories} />
11+
12+
## Nested spaces
13+
14+
Examples of nested spaces.
15+
16+
### Non-resizable
17+
18+
<Canvas of={Stories.NonResizable} />
19+
20+
### Resizable
21+
22+
<Canvas of={Stories.Resizable} />

Diff for: src/components/stories/01-examples/01-Nested.stories.mdx.broken renamed to src/components/stories/01-examples/01-Nested.stories.tsx

+18-23
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs";
2-
3-
import { ViewPort, Left, Top, Right, Bottom, LeftResizable, TopResizable, RightResizable, BottomResizable, Fill } from "../../";
1+
import * as React from "react";
2+
import { ViewPort, Left, Top, Right, Bottom, LeftResizable, TopResizable, RightResizable, BottomResizable, Fill } from "../..";
43
import { red, green, blue, description } from "../Utils";
5-
import { CommonHeader } from "../Utils";
6-
7-
<CommonHeader />
8-
9-
<Meta title="Basic examples/Nested" />
10-
11-
## Nested spaces
124

13-
Examples of nested spaces.
5+
export default {
6+
title: "Basic examples/Nested",
7+
};
148

15-
### Non-resizable
16-
17-
<Canvas>
18-
<Story name="Non-resizable">
9+
export const NonResizable = {
10+
render: () => (
1911
<React.StrictMode>
2012
<ViewPort>
2113
<Left size="20%" style={green}>
@@ -51,13 +43,13 @@ Examples of nested spaces.
5143
</Right>
5244
</ViewPort>
5345
</React.StrictMode>
54-
</Story>
55-
</Canvas>
46+
),
5647

57-
### Resizable
48+
name: "Non-resizable",
49+
};
5850

59-
<Canvas>
60-
<Story name="Resizable">
51+
export const Resizable = {
52+
render: () => (
6153
<React.StrictMode>
6254
<ViewPort>
6355
<LeftResizable size="20%" style={green} trackSize={true}>
@@ -93,7 +85,10 @@ Examples of nested spaces.
9385
<RightResizable size="20%" style={green} trackSize={true}>
9486
{description("Right")}
9587
</RightResizable>
96-
</ViewPort>`
88+
</ViewPort>
89+
`
9790
</React.StrictMode>
98-
</Story>
99-
</Canvas>
91+
),
92+
93+
name: "Resizable",
94+
};

0 commit comments

Comments
 (0)