Skip to content

Commit d34eaba

Browse files
committed
minor changes for active doc enabler
1 parent 316d635 commit d34eaba

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

docs/client/components/PlaygroundPage/PlaygroundWithPreview/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class PlaygroundWithPreview extends React.Component {
3333
render() {
3434
const {
3535
activeComponent,
36+
expandDocumentation,
37+
isDocumentationOn,
3638
} = this.props;
3739

3840
return (
@@ -44,7 +46,11 @@ class PlaygroundWithPreview extends React.Component {
4446
<Playground
4547
code={this.props.defaultCode}
4648
onChange={this.handleOnChangeCode}
49+
activeComponent={activeComponent}
50+
expandDocumentation={expandDocumentation}
51+
isDocumentationOn={isDocumentationOn}
4752
/>
53+
4854
<Preview
4955
code={this.state.code}
5056
/>

docs/client/components/PlaygroundPage/PlaygroundWithPreview/styles.scss

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,22 @@
55
.header {
66
font-size: 24px;
77
font-weight: bold;
8+
margin-bottom: 20px;
89
}
910
}
1011

1112
:local(.playground) {
1213
position: fixed;
1314
width: 40%;
1415
height: 100%;
15-
border: 1px solid;
16+
.doc-enabler {
17+
margin: 40px auto;
18+
width: 40%;
19+
.switch {
20+
margin-left: 10px;
21+
margin-top: 10px;
22+
}
23+
}
1624
}
1725

1826
:local(.preview) {
@@ -24,5 +32,4 @@
2432
left: 55%;
2533
width: 35%;
2634
height: 100%;
27-
border: 1px solid;
2835
}

docs/client/components/PlaygroundPage/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class PlaygroundPage extends React.Component {
99
this.state = {
1010
isDocumentationOn: false,
1111
activeComponent: '',
12+
activeDocs: '',
1213
};
1314
this.expandDocumentation = this.expandDocumentation.bind(this);
1415
this.handleClickComponent = this.handleClickComponent.bind(this);
@@ -20,10 +21,12 @@ class PlaygroundPage extends React.Component {
2021
});
2122
}
2223

23-
handleClickComponent(activeComponent, defaultCode) {
24+
handleClickComponent(activeComponent, defaultCode, activeDocs) {
25+
console.log('activeDocs ', activeDocs);
2426
this.setState({
2527
activeComponent,
2628
defaultCode,
29+
activeDocs,
2730
});
2831
}
2932

0 commit comments

Comments
 (0)