Skip to content

Commit dfcb44f

Browse files
committed
Playground and ComponentPage styles.
1 parent ed4dee0 commit dfcb44f

6 files changed

Lines changed: 69 additions & 34 deletions

File tree

packages/react-components/src/Select/examples.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,12 @@ const examples = [
1616
/>
1717
),
1818
code: (
19-
`
20-
<Select
21-
options={[
22-
'Zoey Andrews',
23-
'Jerry Woods',
24-
'Marion Garza'
25-
]}
19+
`<Select
20+
options={['Zoey Andrews', 'Jerry Woods', 'Marion Garza']}
2621
selected={2}
2722
handleChange={(e) => { console.log(e.target.value); }}
2823
label="Select user"
29-
/>
30-
`
24+
/>`
3125
)
3226
}
3327
];

packages/website/src/components/Playground/index.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* global hljs */
12
import React, { PropTypes } from 'react';
23
import './index.styl';
34

@@ -14,14 +15,22 @@ class Playground extends React.Component {
1415
render() {
1516
const { component, code, title } = this.props;
1617
return (
17-
<div className="react-component-playground">
18-
{title}
19-
{component}
20-
<pre>
21-
<code className="javascript" ref={node => this.codeBlock = node}>
22-
{code}
23-
</code>
24-
</pre>
18+
<div className="react-playground">
19+
{ title && <h3 className="react-playground-title">{title}</h3> }
20+
<div className="react-playground-component">
21+
<div className="component-links">
22+
<a href="#">Open in stage</a>
23+
</div>
24+
{component}
25+
</div>
26+
<div className="react-playground-code">
27+
<button className="copy-code-btn btn btn-sm btn-success">Copy code</button>
28+
<pre>
29+
<code className="javascript" ref={node => this.codeBlock = node}>
30+
{code}
31+
</code>
32+
</pre>
33+
</div>
2534
</div>
2635
);
2736
}
Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
1-
.react-component-playground
2-
width 100%
3-
min-height 200px
4-
background-color white
5-
border-radius 3px
1+
.react-playground
2+
margin-bottom 60px
3+
4+
.react-playground-title
5+
font-size 22px
6+
7+
.react-playground-component
8+
width 100%
9+
min-height 140px
10+
position relative
11+
background-color white
12+
border 1px solid #EDEDED
13+
border-bottom 0
14+
border-top-left-radius 3px
15+
border-top-right-radius 3px
16+
17+
.component-links
18+
position absolute
19+
top -40px
20+
right 0
21+
22+
.react-playground-code
23+
position relative
24+
25+
.copy-code-btn
26+
position absolute
27+
top 20px
28+
right 20px
29+
30+
code
31+
padding 24px
32+
border-radius 0
33+
border-bottom-left-radius 3px
34+
border-bottom-right-radius 3px
35+
36+
pre
37+
margin-bottom 0

packages/website/src/components/Sidebar/index.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
.sidebar-item-link
3939
display block
4040
color black
41-
padding 12px 16px
41+
padding 12px 24px
4242
font-size 14px
4343

4444
&.active

packages/website/src/containers/ComponentPage/index.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import './index.styl';
44

55
const ComponentPage = ({ title, description, props, examples }) =>
66
<section className="react-component-page">
7-
<h1 className="component-title">{title}</h1>
8-
<p className="component-description">{description}</p>
9-
7+
<div className="component-information">
8+
<h1 className="component-title">{title}</h1>
9+
<p className="component-description">{description}</p>
10+
</div>
1011
{examples.map((example, index) =>
1112
<Playground
1213
key={index}
@@ -15,13 +16,7 @@ const ComponentPage = ({ title, description, props, examples }) =>
1516
title={example.title}
1617
/>
1718
)}
18-
19-
{ props ? (
20-
<PropertiesTable props={props} />
21-
) : (
22-
<h4>No component propTypes defined.</h4>
23-
)}
24-
19+
{ props && <PropertiesTable props={props} />}
2520
</section>;
2621

2722
ComponentPage.propTypes = {
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
.react-component-page
22
padding 60px
33

4+
.component-information
5+
margin-bottom 30px
6+
47
.component-title
5-
font-size 24px
8+
font-size 28px
69

710
.component-description
811
color grey
12+
font-size 16px
13+
margin-bottom 0

0 commit comments

Comments
 (0)