Skip to content

Commit 63145b5

Browse files
committed
Cleaning up PIG explorer.
1 parent 41c25d0 commit 63145b5

File tree

4 files changed

+62
-13
lines changed

4 files changed

+62
-13
lines changed

PIG/index.html

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!DOCTYPE html>
22
<html>
3-
<body>
4-
<div id="browser_mount"></div>
5-
<script src="/bundles/PIG.bundle.js"></script>
6-
</body>
3+
<title>PIG Component Explorer</title>
4+
<body>
5+
<div id="browser_mount"></div>
6+
<script src="/bundles/PIG.bundle.js"></script>
7+
</body>
78
</html>

Parse-Dashboard/index.html

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!DOCTYPE html>
22
<html>
3-
<body>
4-
<div id="browser_mount"></div>
5-
<script src="/bundles/dashboard.bundle.js"></script>
6-
</body>
3+
<title>Parse Dashboard</title>
4+
<body>
5+
<div id="browser_mount"></div>
6+
<script src="/bundles/dashboard.bundle.js"></script>
7+
</body>
78
</html>

parse-interface-guide/PIG.react.js

+27-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
import * as ComponentsMap from 'parse-interface-guide/ComponentsMap';
99
import { Link } from 'react-router';
10+
import Icon from 'components/Icon/Icon.react';
1011
import PropsTable from 'parse-interface-guide/PropsTable.react';
1112
import React from 'react';
1213
import styles from 'parse-interface-guide/PIG.scss';
@@ -19,19 +20,43 @@ let PIGRow = ({ title, children }) => <div>
1920
</div>;
2021

2122
export default class PIG extends React.Component {
23+
constructor() {
24+
super();
25+
26+
this.state = {
27+
query: ''
28+
};
29+
}
30+
2231
renderSidebar() {
2332
let components = Object.keys(ComponentsMap);
2433
return (
2534
<div className={styles.sidebar}>
26-
{components.map((name) => <Link activeClassName={styles.active} key={name} to={`/${name}`}>{name}</Link>)}
35+
<div className={styles.iconWrap}>
36+
<Icon name='infinity' width={50} height={50} fill='#000000' />
37+
<span className={styles.iconLabel}>PIG Explorer</span>
38+
</div>
39+
<input
40+
type='text'
41+
placeholder='Filter components...'
42+
className={styles.searchField}
43+
onChange={(e) => {
44+
let query = e.target.value.trim();
45+
this.setState({query});
46+
}}/>
47+
{components.map((name) => {
48+
return name.toLowerCase().indexOf(this.state.query.toLowerCase()) !== -1
49+
? <Link activeClassName={styles.active} key={name} to={`/${name}`}>{name}</Link>
50+
: null;
51+
})}
2752
</div>
2853
);
2954
}
3055

3156
renderContent() {
3257
let componentInfo = ComponentsMap[this.props.params.component];
3358
if (!componentInfo) {
34-
return <div>Unknown component</div>;
59+
componentInfo = ComponentsMap[Object.keys(ComponentsMap)[0]];
3560
}
3661
let demos = componentInfo.demos || [];
3762
return (

parse-interface-guide/PIG.scss

+25-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
.sidebar {
1212
position: fixed;
1313
background: white;
14-
width: 200px;
14+
width: 300px;
1515
padding: 10px;
1616
border-right: 1px solid #b0b8bf;
1717
top: 0;
@@ -27,12 +27,34 @@
2727

2828
.active {
2929
color: #1F62B1;
30+
font-weight: bold;
3031
}
3132
}
3233

34+
.iconWrap {
35+
margin: 10px 0 20px 15px;
36+
}
37+
38+
.iconLabel {
39+
vertical-align: top;
40+
position: relative;
41+
top: 14px;
42+
left: 16px;
43+
font-size: 25px;
44+
}
45+
46+
.searchField {
47+
width: 230px;
48+
height: 44px;
49+
font-size: 20px;
50+
padding: 0 10px;
51+
border-radius: 5px;
52+
margin: 0 0 30px 10px;
53+
}
54+
3355
.content {
34-
margin-left: 200px;
35-
padding: 10px;
56+
margin-left: 300px;
57+
padding: 20px 10px 10px 10px;
3658
min-height: 100vh;
3759
}
3860

0 commit comments

Comments
 (0)