Skip to content

Commit ed88439

Browse files
committed
modified documentation component
1 parent d6d9d6e commit ed88439

File tree

2 files changed

+61
-9
lines changed

2 files changed

+61
-9
lines changed
Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
:local(.documentation) {
22
position: fixed;
3-
top: 55%;
4-
height: 40%;
5-
width: 100%;
3+
right: 0%;
4+
top: 78px;
5+
height: 100%;
6+
width: 5%;
7+
box-shadow: 0 4px 5px 0 rgba(0,0,0,.14), 0 1px 10px 0 rgba(0,0,0,.12), 0 2px 4px -1px rgba(0,0,0,.2);
8+
background: #ffffff;
69
.header {
710
font-size: 24px;
811
font-weight: bold;
12+
padding: 10px;
913
}
14+
button {
15+
border-radius: 50%;
16+
padding: 30px 25px;
17+
position: absolute;
18+
left: -45px;
19+
top: 40%;
20+
}
21+
&.active {
22+
width: 50%;
23+
button {
24+
left: -55px;
25+
}
26+
}
27+
1028
}
Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,45 @@
11
import React from 'react';
2-
2+
import Preview from './Preview';
3+
import Playground from './Playground';
34
import styles from './styles.scss';
45

5-
const PlaygroundWithPreview = () => (
6-
<div className={styles.playground}>
7-
PlaygroundWithPreview
8-
</div>
9-
);
6+
const defaultCode = `
7+
const Example = (
8+
<div>
9+
Example Component
10+
</div>
11+
);
12+
`;
13+
14+
class PlaygroundWithPreview extends React.Component {
15+
constructor(props) {
16+
super(props);
17+
this.state = {};
18+
}
19+
20+
render() {
21+
const {
22+
activeComponent,
23+
} = this.props;
24+
25+
return (
26+
<div className={styles['playground-preview']}>
27+
<div className="header">
28+
PlaygroundWithPreview
29+
</div>
30+
31+
<div>
32+
<Playground
33+
code={defaultCode}
34+
/>
35+
<Preview
36+
37+
/>
38+
</div>
39+
{activeComponent}
40+
</div>
41+
);
42+
}
43+
}
1044

1145
export default PlaygroundWithPreview;

0 commit comments

Comments
 (0)