1+ import * as React from 'react' ;
2+ import * as Space from 'react-spaces' ;
3+ import SyntaxHighlighter from 'react-syntax-highlighter' ;
4+ import { Tabs } from 'antd' ;
5+ import { Description } from './Docs' ;
6+
7+ export const Nested = ( ) => {
8+ return (
9+ < >
10+ < h2 id = "nested" > Nested spaces</ h2 >
11+
12+ < p >
13+ Spaces can be nested within other spaces to create complex layouts.
14+ </ p >
15+
16+ < Tabs defaultActiveKey = "1" >
17+ < Tabs . TabPane tab = "Left/right nested within top/fill/bottom" key = "1" >
18+
19+ < SyntaxHighlighter language = "html" >
20+ {
21+ "const App = () => (\r\n" +
22+ " <Space.Fixed height={400}>\r\n" +
23+ " <Space.TopResizable size=\"20%\" />\r\n" +
24+ " <Space.Fill>\r\n" +
25+ " <Space.LeftResizable size=\"20%\" />\r\n" +
26+ " <Space.Fill />\r\n" +
27+ " <Space.RightResizable size=\"20%\" />\r\n" +
28+ " </Space.Fill>\r\n" +
29+ " <Space.BottomResizable size=\"20%\" />\r\n" +
30+ " </Space.Fixed>\r\n" +
31+ ")"
32+ }
33+ </ SyntaxHighlighter >
34+
35+ < Space . Fixed height = { 400 } >
36+ < Space . TopResizable trackSize = { true } size = "25%" style = { { backgroundColor : '#e0eee0' } } >
37+ { Description ( "Top" , "T" ) }
38+ </ Space . TopResizable >
39+ < Space . Fill >
40+ < Space . LeftResizable trackSize = { true } size = "25%" style = { { backgroundColor : '#e0eeee' } } >
41+ { Description ( "Left" , "L" ) }
42+ </ Space . LeftResizable >
43+ < Space . Fill trackSize = { true } style = { { backgroundColor : '#eee0e0' } } >
44+ { Description ( "Fill" , "F" ) }
45+ </ Space . Fill >
46+ < Space . RightResizable trackSize = { true } size = "25%" style = { { backgroundColor : '#e0eeee' } } >
47+ { Description ( "Right" , "R" ) }
48+ </ Space . RightResizable >
49+ </ Space . Fill >
50+ < Space . BottomResizable trackSize = { true } size = "25%" style = { { backgroundColor : '#e0eee0' } } >
51+ { Description ( "Bottom" , "B" ) }
52+ </ Space . BottomResizable >
53+ </ Space . Fixed >
54+
55+ </ Tabs . TabPane >
56+ < Tabs . TabPane tab = "Top/bottom nested within left/fill/right" key = "2" >
57+
58+ < SyntaxHighlighter language = "html" >
59+ {
60+ "const App = () => (\r\n" +
61+ " <Space.Fixed height={400}>\r\n" +
62+ " <Space.LeftResizable size=\"25%\" />\r\n" +
63+ " <Space.Fill>\r\n" +
64+ " <Space.TopResizable size=\"25%\" />\r\n" +
65+ " <Space.Fill />\r\n" +
66+ " <Space.BottomResizable size=\"25%\" />\r\n" +
67+ " </Space.Fill>\r\n" +
68+ " <Space.RightResizable size=\"25%\" />\r\n" +
69+ " </Space.Fixed>\r\n" +
70+ ")"
71+ }
72+ </ SyntaxHighlighter >
73+
74+ < Space . Fixed height = { 400 } >
75+ < Space . LeftResizable trackSize = { true } size = "25%" style = { { backgroundColor : '#e0eeee' } } >
76+ { Description ( "Left" , "L" ) }
77+ </ Space . LeftResizable >
78+ < Space . Fill >
79+ < Space . TopResizable trackSize = { true } size = "25%" style = { { backgroundColor : '#e0eee0' } } >
80+ { Description ( "Top" , "T" ) }
81+ </ Space . TopResizable >
82+ < Space . Fill trackSize = { true } style = { { backgroundColor : '#eee0e0' } } >
83+ { Description ( "Fill" , "F" ) }
84+ </ Space . Fill >
85+ < Space . BottomResizable trackSize = { true } size = "25%" style = { { backgroundColor : '#e0eee0' } } >
86+ { Description ( "Bottom" , "B" ) }
87+ </ Space . BottomResizable >
88+ </ Space . Fill >
89+ < Space . RightResizable trackSize = { true } size = "25%" style = { { backgroundColor : '#e0eeee' } } >
90+ { Description ( "Right" , "R" ) }
91+ </ Space . RightResizable >
92+ </ Space . Fixed >
93+
94+ </ Tabs . TabPane >
95+ </ Tabs >
96+ </ >
97+ )
98+ }
0 commit comments