File tree Expand file tree Collapse file tree 2 files changed +49
-8
lines changed
docs/client/components/PlaygroundPage Expand file tree Collapse file tree 2 files changed +49
-8
lines changed Original file line number Diff line number Diff line change
1
+ :local(.playground-preview ) {
2
+ position : fixed ;
3
+ height : 100% ;
4
+ width : 60% ;
5
+ .header {
6
+ font-size : 24px ;
7
+ font-weight : bold ;
8
+ }
9
+ }
10
+
1
11
:local(.playground ) {
2
12
position : fixed ;
3
- height : 50% ;
4
- width : 100% ;
13
+ width : 40% ;
14
+ height : 100% ;
15
+ border : 1px solid ;
16
+ }
17
+
18
+ :local(.preview ) {
5
19
.header {
6
20
font-size : 24px ;
7
21
font-weight : bold ;
8
22
}
9
- }
23
+ position : fixed ;
24
+ left : 55% ;
25
+ width : 35% ;
26
+ height : 100% ;
27
+ border : 1px solid ;
28
+ }
Original file line number Diff line number Diff line change @@ -7,19 +7,41 @@ class PlaygroundPage extends React.Component {
7
7
constructor ( props ) {
8
8
super ( props ) ;
9
9
this . state = {
10
- active : '' ,
10
+ isDocumentationOn : false ,
11
+ activeComponent : '' ,
11
12
} ;
13
+ this . expandDocumentation = this . expandDocumentation . bind ( this ) ;
14
+ this . handleClickComponent = this . handleClickComponent . bind ( this ) ;
15
+ }
16
+
17
+ expandDocumentation ( ) {
18
+ this . setState ( {
19
+ isDocumentationOn : ! this . state . isDocumentationOn ,
20
+ } ) ;
21
+ }
22
+
23
+ handleClickComponent ( activeComponent ) {
24
+ this . setState ( {
25
+ activeComponent,
26
+ } ) ;
12
27
}
13
28
14
29
render ( ) {
15
30
return (
16
31
< div >
17
- < ComponentBar >
18
- < PlaygroundWithPreview />
19
- < Documentation />
32
+ < ComponentBar
33
+ onClickComponent = { this . handleClickComponent }
34
+ >
35
+ < PlaygroundWithPreview
36
+ activeComponent = { this . state . activeComponent }
37
+ />
38
+ < Documentation
39
+ isDocumentationOn = { this . state . isDocumentationOn }
40
+ expandDocumentation = { this . expandDocumentation }
41
+ />
20
42
</ ComponentBar >
21
43
</ div >
22
- )
44
+ ) ;
23
45
}
24
46
}
25
47
You can’t perform that action at this time.
0 commit comments