|
1 | 1 | import { Meta, Story, Preview, Props } from "@storybook/addon-docs/blocks"; |
2 | 2 | import { CommonHeader, DemoUI } from "../Utils"; |
3 | | -import { CenterType, ViewPort, Fixed, Top, Right, LeftResizable, BottomResizable, Fill } from "../../"; |
| 3 | +import { CenterType, ViewPort, Fixed, Top, Right, LeftResizable, BottomResizable, Fill, Options } from "../../"; |
4 | 4 |
|
5 | 5 | <CommonHeader /> |
6 | 6 |
|
@@ -47,14 +47,16 @@ lines and text alignment have been added specifically for this example. In pract |
47 | 47 | have any visual element, padding or margins leaving it up to you to fill them or style them however |
48 | 48 | you want.* |
49 | 49 |
|
50 | | -<Fixed style={{ outline: '1px solid black' }} height={400}> |
51 | | - <LeftResizable style={{ borderRight: '1px dashed black' }} size="25%" centerContent={CenterType.HorizontalVertical}> |
52 | | - Sidebar |
53 | | - </LeftResizable> |
54 | | - <Fill centerContent={CenterType.HorizontalVertical}> |
55 | | - Main content |
56 | | - </Fill> |
57 | | -</Fixed> |
| 50 | +<React.StrictMode> |
| 51 | + <Fixed style={{ outline: '1px solid black' }} height={400}> |
| 52 | + <LeftResizable style={{ borderRight: '1px dashed black' }} size="25%" centerContent={CenterType.HorizontalVertical}> |
| 53 | + Sidebar |
| 54 | + </LeftResizable> |
| 55 | + <Fill centerContent={CenterType.HorizontalVertical}> |
| 56 | + Main content |
| 57 | + </Fill> |
| 58 | + </Fixed> |
| 59 | +</React.StrictMode> |
58 | 60 |
|
59 | 61 | Notice how the fill space automatically adjusts it's size when the left resizable space is resized with |
60 | 62 | the mouse. |
@@ -85,19 +87,21 @@ const App = () => ( |
85 | 87 |
|
86 | 88 | Here we have added additional nested spaces inside the original `<Fill />` space to achieve this: |
87 | 89 |
|
88 | | -<Fixed style={{ outline: '1px solid black' }} height={400}> |
89 | | - <LeftResizable style={{ borderRight: '1px dashed black' }} size="25%" centerContent={CenterType.HorizontalVertical}> |
90 | | - Sidebar |
91 | | - </LeftResizable> |
92 | | - <Fill> |
93 | | - <Fill centerContent={CenterType.HorizontalVertical}> |
94 | | - Main content |
| 90 | +<React.StrictMode> |
| 91 | + <Fixed style={{ outline: '1px solid black' }} height={400}> |
| 92 | + <LeftResizable style={{ borderRight: '1px dashed black' }} size="25%" centerContent={CenterType.HorizontalVertical}> |
| 93 | + Sidebar |
| 94 | + </LeftResizable> |
| 95 | + <Fill> |
| 96 | + <Fill centerContent={CenterType.HorizontalVertical}> |
| 97 | + Main content |
| 98 | + </Fill> |
| 99 | + <BottomResizable style={{ borderTop: '1px dashed black' }} size={100} centerContent={CenterType.HorizontalVertical}> |
| 100 | + Bottom area |
| 101 | + </BottomResizable> |
95 | 102 | </Fill> |
96 | | - <BottomResizable style={{ borderTop: '1px dashed black' }} size={100} centerContent={CenterType.HorizontalVertical}> |
97 | | - Bottom area |
98 | | - </BottomResizable> |
99 | | - </Fill> |
100 | | -</Fixed> |
| 103 | + </Fixed> |
| 104 | +</React.StrictMode> |
101 | 105 |
|
102 | 106 | We can add further nested spaces to add elements like title bars into different areas. |
103 | 107 |
|
@@ -136,28 +140,30 @@ const App = () => ( |
136 | 140 |
|
137 | 141 | Now we have something like below: |
138 | 142 |
|
139 | | -<Fixed style={{ outline: '1px solid black' }} height={400}> |
140 | | - <Top style={{ borderBottom: '1px dashed black', padding: 5 }} order={1} size={25} centerContent={CenterType.Vertical}> |
141 | | - Title |
142 | | - </Top> |
143 | | - <Top style={{ borderBottom: '1px dashed black', padding: 5 }} order={2} size={25} centerContent={CenterType.Vertical}> |
144 | | - Menu bar |
145 | | - </Top> |
146 | | - <Fill> |
147 | | - <LeftResizable style={{ borderRight: '1px dashed black' }} size="25%"> |
148 | | - <Top style={{ borderBottom: '1px dashed black', padding: 5 }} size={25} centerContent={CenterType.Vertical}>Sidebar title</Top> |
149 | | - <Fill centerContent={CenterType.HorizontalVertical}>Sidebar</Fill> |
150 | | - </LeftResizable> |
| 143 | +<React.StrictMode> |
| 144 | + <Fixed style={{ outline: '1px solid black' }} height={400}> |
| 145 | + <Top style={{ borderBottom: '1px dashed black', padding: 5 }} order={1} size={25} centerContent={CenterType.Vertical}> |
| 146 | + Title |
| 147 | + </Top> |
| 148 | + <Top style={{ borderBottom: '1px dashed black', padding: 5 }} order={2} size={25} centerContent={CenterType.Vertical}> |
| 149 | + Menu bar |
| 150 | + </Top> |
151 | 151 | <Fill> |
152 | | - <Fill centerContent={CenterType.HorizontalVertical}> |
153 | | - Main content |
| 152 | + <LeftResizable style={{ borderRight: '1px dashed black' }} size="25%"> |
| 153 | + <Top style={{ borderBottom: '1px dashed black', padding: 5 }} size={25} centerContent={CenterType.Vertical}>Sidebar title</Top> |
| 154 | + <Fill centerContent={CenterType.HorizontalVertical}>Sidebar</Fill> |
| 155 | + </LeftResizable> |
| 156 | + <Fill> |
| 157 | + <Fill centerContent={CenterType.HorizontalVertical}> |
| 158 | + Main content |
| 159 | + </Fill> |
| 160 | + <BottomResizable style={{ borderTop: '1px dashed black' }} size={100} centerContent={CenterType.HorizontalVertical}> |
| 161 | + Bottom area |
| 162 | + </BottomResizable> |
154 | 163 | </Fill> |
155 | | - <BottomResizable style={{ borderTop: '1px dashed black' }} size={100} centerContent={CenterType.HorizontalVertical}> |
156 | | - Bottom area |
157 | | - </BottomResizable> |
158 | 164 | </Fill> |
159 | | - </Fill> |
160 | | -</Fixed> |
| 165 | + </Fixed> |
| 166 | +</React.StrictMode> |
161 | 167 |
|
162 | 168 | ### Introducing simple interactivity |
163 | 169 |
|
|
0 commit comments