Skip to content

Commit f1e90f6

Browse files
authored
Merge pull request #6 from Codebrahma/docs-component-integration
Docs component integration
2 parents 560e475 + f6d8046 commit f1e90f6

File tree

25 files changed

+260
-83
lines changed

25 files changed

+260
-83
lines changed

docs/client/components/AppNavbar/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Navbar extends React.Component {
6363
to="/components"
6464
onClick={() => { this.handleNavClick('components') }}
6565
>
66-
<span className={`${activeLink === 'components' && 'active'}`}>API</span>
66+
<span className={`${activeLink === 'components' && 'active'}`}>Usage</span>
6767
</Link>
6868
</Col>
6969
</Row>

docs/client/components/ComponentsPage/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import React from 'react';
22

3+
import CardReadme from '../../../../src/card/readMe.md';
4+
5+
import styles from './styles.scss';
6+
37
const ComponentsPage = () => (
4-
<div>
5-
Components Page
8+
<div className={styles.usage}>
9+
<div dangerouslySetInnerHTML={{ __html: CardReadme }} />
10+
<div style={{ height: '300px' }} />
611
</div>
712
);
813

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
:local(.usage) {
2+
overflow: scroll;
3+
height: 800px;
4+
padding: 5%;
5+
6+
table, td, th {
7+
border: 1px solid #d2d2d2;
8+
border-collapse: collapse;
9+
}
10+
td {
11+
padding: 5px;
12+
font-size: 12px;
13+
height: 40px;
14+
}
15+
.hljs {
16+
padding: 15px 0px;
17+
background: #f1f1f1;
18+
}
19+
}

docs/client/components/GettingStartedPage/index.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
import React from 'react';
22

3+
import SampleCode from './sampleCode.md';
4+
import styles from './styles.scss';
5+
36
const GettingStartedPage = () => (
4-
<div>
5-
GettingStarted Page
7+
<div className={styles.code}>
8+
<div className="header">
9+
GettingStarted Page
10+
</div>
11+
<div className="sub-header">
12+
Installation
13+
</div>
14+
<div className="js-code">
15+
npm install react-lite
16+
</div>
17+
<div className="sub-header">
18+
Usage
19+
</div>
20+
<div className="js-code">
21+
<div dangerouslySetInnerHTML={{ __html: SampleCode }} />
22+
</div>
23+
<div className="empty-div" />
624
</div>
725
);
826

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
```
2+
import { Card } from 'react-lite;
3+
import theme from './theme.scss';
4+
5+
const App = (
6+
<Card
7+
header='Card String header'
8+
wrapContent
9+
noPadding
10+
theme={customTheme}>
11+
<span>Card Content</span>
12+
<span>Card Content</span>
13+
<span>Card Content</span>
14+
</Card>
15+
);
16+
17+
export default App;
18+
19+
// In theme.scss Customize any themeable option and pass it as a prop
20+
:local(.card) {
21+
background: #d2d2d2;
22+
}
23+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
:local(.code) {
2+
width: 50%;
3+
padding-bottom: 200px;
4+
margin: 0 auto;
5+
.header {
6+
font-size: 24px;
7+
font-weight: bold;
8+
}
9+
.sub-header {
10+
font-size: 18px;
11+
font-weight: bold;
12+
}
13+
.js-code {
14+
padding: 20px;
15+
background: #e2e2e2;
16+
margin-bottom: 20px;
17+
min-width: 300px;
18+
}
19+
20+
.empty-div {
21+
height: 200px;
22+
}
23+
24+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const ComponentBarPage = ({ children, onClickComponent }) => (
1111
<div
1212
className="each-component-item"
1313
key={component.name}
14-
onClick={() => { onClickComponent(component.name) }}
14+
onClick={() => { onClickComponent(component.name, component.defaultCode, component.docs) }}
1515
>
1616
{component.name}
1717
</div>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
padding-top: 25px;
1010
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);
1111
.each-component-item {
12+
font-size: 23px;
1213
color: $primary-dark-font;
1314
padding: 15px 5px 15px 15px;
1415
font-weight: bold;

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,18 @@ import styles from './styles.scss';
55
const DocumentationPage = ({
66
isDocumentationOn,
77
expandDocumentation,
8+
activeDocs,
89
}) => {
910
const docStatusClass = isDocumentationOn ? 'active' : '';
10-
return isDocumentationOn ? (
11+
return (
1112
<div className={cx(styles.documentation, docStatusClass)}>
1213
<div className="header">
1314
Documentation
1415
</div>
15-
<button
16-
onClick={expandDocumentation}
17-
> Let me try!!! </button>
16+
<div className="content" dangerouslySetInnerHTML={{ __html: activeDocs }} />
17+
<div className="empty-div" />
1818
</div>
19-
) : (
20-
<div className={cx(styles.documentation, docStatusClass)}>
21-
<button
22-
onClick={expandDocumentation}
23-
> Props </button>
24-
</div>
25-
)
19+
);
2620
}
2721

2822

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,70 @@
1+
/* Safari 4.0 - 8.0 */
2+
@-webkit-keyframes open {
3+
from {width: 0%;}
4+
to {width: 45%;}
5+
}
6+
7+
/* Standard syntax */
8+
@keyframes open {
9+
from {width: 0%;}
10+
to {width: 45%;}
11+
}
12+
113
:local(.documentation) {
214
position: fixed;
15+
padding: 5px 20px 50px 20px;
316
right: 0%;
417
top: 78px;
518
height: 100%;
6-
width: 5%;
19+
width: 0%;
720
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);
821
background: #ffffff;
22+
overflow: scroll;
923
.header {
1024
font-size: 24px;
1125
font-weight: bold;
1226
padding: 10px;
1327
}
14-
button {
15-
border-radius: 50%;
16-
padding: 30px 25px;
17-
position: absolute;
18-
left: -45px;
19-
top: 40%;
28+
.content {
29+
font-size: 12px;
30+
table, th, td {
31+
border: 1px solid #d2d2d2;
32+
border-collapse: collapse;
33+
}
34+
th {
35+
height: 40px;
36+
}
37+
td {
38+
height: 40px;
39+
padding: 5px;
40+
}
41+
.hljs {
42+
padding: 15px 0px;
43+
background: #f1f1f1;
44+
}
2045
}
46+
2147
&.active {
22-
width: 50%;
48+
width: 45%;
49+
-webkit-animation: open 0.5s; /* Safari 4.0 - 8.0 */
50+
animation: open 0.5s;
2351
button {
2452
left: -55px;
2553
}
2654
}
2755

28-
}
56+
.docs-btn {
57+
button {
58+
border-radius: 50%;
59+
padding: 30px 25px;
60+
position: absolute;
61+
right: -45px;
62+
top: 2%;
63+
}
64+
}
65+
66+
.empty-div {
67+
height: 100px;
68+
}
69+
}
70+

0 commit comments

Comments
 (0)