File tree Expand file tree Collapse file tree 11 files changed +133
-68
lines changed Expand file tree Collapse file tree 11 files changed +133
-68
lines changed Original file line number Diff line number Diff line change 20
20
},
21
21
"dependencies" : {
22
22
"@atlaskit/build-releases" : " ^3.0.3" ,
23
+ "@atlaskit/css-reset" : " ^3.0.6" ,
23
24
"@babel/core" : " ^7.4.0" ,
24
25
"@babel/plugin-syntax-flow" : " ^7.2.0" ,
25
26
"@babel/plugin-syntax-jsx" : " ^7.2.0" ,
Original file line number Diff line number Diff line change 2
2
"name" : " website" ,
3
3
"version" : " 0.0.0" ,
4
4
"dependencies" : {
5
+ "@atlaskit/css-reset" : " ^3.0.6" ,
5
6
"bolt" : " ^0.22.6" ,
6
7
"css-loader" : " ^2.1.1" ,
7
8
"extract-react-types" : " ^0.16.0" ,
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import ReactDOM from 'react-dom' ;
3
- import ReactMarkdown from 'react-markdown ' ;
4
- import { HashRouter as Router , Route , Link } from 'react-router-dom ';
3
+ import { BrowserRouter as Router , Route } from 'react-router-dom ' ;
4
+ import '@atlaskit/css-reset ';
5
5
6
- import docs from '../DOCS' ;
7
6
import Header from './components/Header' ;
8
7
import Home from './pages/home' ;
9
8
import PackageDoc from './pages/PackageDoc' ;
Original file line number Diff line number Diff line change @@ -4,8 +4,20 @@ import './style.css';
4
4
5
5
export default ( ) => (
6
6
< nav >
7
- < Link to = "/" > Home</ Link >
8
- < Link to = "/packages" > Packages</ Link >
9
- < Link to = "/repl" > Try it out</ Link >
7
+ < div className = "side-bar" >
8
+ < h1 > Pretty proptypes</ h1 >
9
+ < div className = "header-controls" >
10
+ < label >
11
+ Type system:
12
+ < select >
13
+ < option value = "flow" > Flow</ option >
14
+ < option value = "typescript" > TypeScript</ option >
15
+ </ select >
16
+ </ label >
17
+ < Link to = "/" > Home</ Link >
18
+ < Link to = "/packages" > Packages</ Link >
19
+ < Link to = "/repl" > Try it out</ Link >
20
+ </ div >
21
+ </ div >
10
22
</ nav >
11
23
) ;
Original file line number Diff line number Diff line change
1
+ .side-bar {
2
+ background : linear-gradient (270deg , # 6738ff, # c3ffbf );
3
+ color : # 6554c0 ;
4
+ padding : 15px ;
5
+ display : flex;
6
+ align-items : center;
7
+ justify-content : space-between;
8
+ height : 50px ;
9
+ }
10
+
11
+ .side-bar h1 {
12
+ display : inline-block;
13
+ text-shadow : 7px 6px 20px # 6a4fc6 ;
14
+ margin : 5px ;
15
+ }
16
+
17
+ .side-bar .header-controls {
18
+ color : # c0feba ;
19
+ }
20
+
21
+ .side-bar .header-controls select {
22
+ margin-left : 10px ;
23
+ }
Original file line number Diff line number Diff line change 17
17
height : 100% ;
18
18
}
19
19
20
- .side-bar {
21
- background : linear-gradient (270deg , # 6738ff, # c3ffbf );
22
- color : # 6554c0 ;
23
- padding : 15px ;
24
- display : flex;
25
- align-items : center;
26
- justify-content : space-between;
27
- height : 50px ;
28
- }
29
-
30
- .side-bar h1 {
31
- display : inline-block;
32
- text-shadow : 7px 6px 20px # 6a4fc6 ;
33
- margin : 5px ;
34
- }
35
-
36
- .side-bar .header-controls {
37
- color : # c0feba ;
38
- }
39
-
40
- .side-bar .header-controls select {
41
- margin-left : 10px ;
42
- }
20
+
43
21
44
22
.error-container {
45
23
position : absolute;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { Link } from 'react-router-dom' ;
3
+ import ReactMarkdown from 'react-markdown' ;
4
+ import docs from '../../../DOCS' ;
5
+ import './style.css' ;
6
+
7
+ export default function PackageDoc ( { location } ) {
8
+ let params = new URLSearchParams ( location . search ) ;
9
+ let docName = params . get ( 'package' ) ;
10
+ return (
11
+ < main >
12
+ < sidebar >
13
+ < ul >
14
+ { Object . keys ( docs ) . map ( docTitle => (
15
+ < li className = { docName && docName === docTitle ? 'active' : '' } >
16
+ < Link to = { { pathname : '/packages' , search : `package=${ docTitle } ` } } > { docTitle } </ Link >
17
+ </ li >
18
+ ) ) }
19
+ </ ul >
20
+ </ sidebar >
21
+ < article >
22
+ < ReactMarkdown source = { docs [ docName || Object . keys ( docs ) [ 0 ] ] } />
23
+ </ article >
24
+ </ main >
25
+ ) ;
26
+ }
Original file line number Diff line number Diff line change
1
+ main {
2
+ display : flex;
3
+ }
4
+ article {
5
+ margin-left : 20px ;
6
+ padding : 0 20px ;
7
+ border-left : 1px solid # ededed ;
8
+ }
9
+
10
+ sidebar ul {
11
+ list-style : none;
12
+ font-size : 1.5em ;
13
+ }
14
+
15
+ sidebar ul li a {
16
+ color : # 102b4f ;
17
+ }
18
+
19
+ sidebar ul li .active a {
20
+ font-weight : 500 ;
21
+ }
Original file line number Diff line number Diff line change @@ -56,18 +56,6 @@ class App extends Component {
56
56
const { code, dataForPropTypes, error } = this . state ;
57
57
return (
58
58
< Fragment >
59
- < div className = "side-bar" >
60
- < h1 > Pretty proptypes</ h1 >
61
- < div className = "header-controls" >
62
- < label >
63
- Type system:
64
- < select onChange = { this . handleSelectChange } >
65
- < option value = "flow" > Flow</ option >
66
- < option value = "typescript" > TypeScript</ option >
67
- </ select >
68
- </ label >
69
- </ div >
70
- </ div >
71
59
< div className = "container" >
72
60
< div className = "block" >
73
61
< CodeMirror
You can’t perform that action at this time.
0 commit comments