File tree Expand file tree Collapse file tree 10 files changed +114
-66
lines changed Expand file tree Collapse file tree 10 files changed +114
-66
lines changed 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
Original file line number Diff line number Diff line change @@ -2074,6 +2074,10 @@ core-js@^2.4.0, core-js@^2.5.0:
2074
2074
version "2.6.5"
2075
2075
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895"
2076
2076
2077
+ core-js@^2.4.1 :
2078
+ version "2.6.5"
2079
+ resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895"
2080
+
2077
2081
[email protected] , core-util-is@~1.0.0:
2078
2082
version "1.0.2"
2079
2083
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@@ -2905,6 +2909,10 @@ execa@^1.0.0:
2905
2909
signal-exit "^3.0.0"
2906
2910
strip-eof "^1.0.0"
2907
2911
2912
+ exenv@^1.2.2 :
2913
+ version "1.2.2"
2914
+ resolved "https://registry.npmjs.org/exenv/-/exenv-1.2.2.tgz#2ae78e85d9894158670b03d47bec1f03bd91bb9d"
2915
+
2908
2916
exit@^0.1.2 :
2909
2917
version "0.1.2"
2910
2918
resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
@@ -3058,6 +3066,10 @@ fb-watchman@^2.0.0:
3058
3066
dependencies :
3059
3067
bser "^2.0.0"
3060
3068
3069
+ fbjs-css-vars@^1.0.0 :
3070
+ version "1.0.2"
3071
+ resolved "https://registry.npmjs.org/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz#216551136ae02fe255932c3ec8775f18e2c078b8"
3072
+
3061
3073
fbjs@^0.8.0, fbjs@^0.8.9 :
3062
3074
version "0.8.17"
3063
3075
resolved "https://registry.npmjs.org/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
@@ -3070,6 +3082,19 @@ fbjs@^0.8.0, fbjs@^0.8.9:
3070
3082
setimmediate "^1.0.5"
3071
3083
ua-parser-js "^0.7.18"
3072
3084
3085
+ fbjs@^1.0.0 :
3086
+ version "1.0.0"
3087
+ resolved "https://registry.npmjs.org/fbjs/-/fbjs-1.0.0.tgz#52c215e0883a3c86af2a7a776ed51525ae8e0a5a"
3088
+ dependencies :
3089
+ core-js "^2.4.1"
3090
+ fbjs-css-vars "^1.0.0"
3091
+ isomorphic-fetch "^2.1.1"
3092
+ loose-envify "^1.0.0"
3093
+ object-assign "^4.1.0"
3094
+ promise "^7.1.1"
3095
+ setimmediate "^1.0.5"
3096
+ ua-parser-js "^0.7.18"
3097
+
3073
3098
figgy-pudding@^3.5.1 :
3074
3099
version "3.5.1"
3075
3100
resolved "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790"
You can’t perform that action at this time.
0 commit comments