File tree 27 files changed +119
-52
lines changed
27 files changed +119
-52
lines changed Original file line number Diff line number Diff line change
1
+ ### React Router Examples
2
+
3
+ In order to try out the examples, you need to follow these steps:
4
+
5
+ 1 . Clone this repo
6
+ 1 . Run ` npm -g install webpack ` , if you don't have it installed already
7
+ 1 . Run ` npm install ` from the repo's root directory
8
+ 1 . Run ` ./script/build-examples ` from the repo's root directory
9
+ 1 . Point your browser to the ` index.html ` location in this directory
Original file line number Diff line number Diff line change
1
+ .Image {
2
+ position : relative;
3
+ }
4
+
5
+ .Image img {
6
+ position : absolute;
7
+ top : 0 ;
8
+ left : 0 ;
9
+ height : 400 ;
10
+ width : 400 ;
11
+ background : gray;
12
+ }
13
+
14
+ .example-enter {
15
+ opacity : 0.01 ;
16
+ transition : opacity .5s ease-in;
17
+ }
18
+
19
+ .example-enter .example-enter-active {
20
+ opacity : 1 ;
21
+ }
22
+
23
+ .example-leave {
24
+ opacity : 1 ;
25
+ transition : opacity .5s ease-in;
26
+ }
27
+
28
+ .example-leave .example-leave-active {
29
+ opacity : 0.01 ;
30
+ }
Original file line number Diff line number Diff line change @@ -41,4 +41,4 @@ var routes = (
41
41
</ Routes >
42
42
) ;
43
43
44
- React . renderComponent ( routes , document . body ) ;
44
+ React . renderComponent ( routes , document . getElementById ( 'example' ) ) ;
Original file line number Diff line number Diff line change 1
1
<!doctype html public "restroom">
2
2
< title > Animation Example</ title >
3
- < link href ="../app.css " rel ="stylesheet "/>
4
- < style >
5
- .Image {
6
- position : relative;
7
- }
8
-
9
- .Image img {
10
- position : absolute;
11
- top : 0 ;
12
- left : 0 ;
13
- height : 400 ;
14
- width : 400 ;
15
- background : gray;
16
- }
17
-
18
- .example-enter {
19
- opacity : 0.01 ;
20
- transition : opacity .5s ease-in;
21
- }
22
-
23
- .example-enter .example-enter-active {
24
- opacity : 1 ;
25
- }
26
-
27
- .example-leave {
28
- opacity : 1 ;
29
- transition : opacity .5s ease-in;
30
- }
31
-
32
- .example-leave .example-leave-active {
33
- opacity : 0.01 ;
34
- }
35
- </ style >
3
+ < link href ="../global.css " rel ="stylesheet "/>
4
+ < link href ="app.css " rel ="stylesheet "/>
36
5
< body >
6
+ < h1 class ="breadcrumbs "> < a href ="../index.html "> React Router Examples</ a > / Animations</ h1 >
7
+ < div id ="example "/>
37
8
< script src ="../build/animations.js "> </ script >
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ var App = React.createClass({
29
29
< Link to = "login" > Sign in</ Link > ;
30
30
return (
31
31
< div >
32
- < h1 > Auth User Flow</ h1 >
33
32
< ul >
34
33
< li > { loginOrOut } </ li >
35
34
< li > < Link to = "about" > About</ Link > </ li >
@@ -190,4 +189,4 @@ var routes = (
190
189
</ Routes >
191
190
) ;
192
191
193
- React . renderComponent ( routes , document . body ) ;
192
+ React . renderComponent ( routes , document . getElementById ( 'example' ) ) ;
Original file line number Diff line number Diff line change 1
1
<!doctype html public "display of affection">
2
2
< title > Authentication Flow Example</ title >
3
- < link rel ="stylesheet " href ="../app .css "/>
3
+ < link rel ="stylesheet " href ="../global .css "/>
4
4
< body >
5
+ < h1 class ="breadcrumbs "> < a href ="../index.html "> React Router Examples</ a > / Auth Flow</ h1 >
6
+ < div id ="example "/>
5
7
< script src ="../build/auth-flow.js "> </ script >
6
8
Original file line number Diff line number Diff line change @@ -11,12 +11,18 @@ a.active {
11
11
color : hsl (20 , 50% , 50% );
12
12
}
13
13
14
+ # example {
15
+ position : absolute;
16
+ }
17
+
14
18
.App {
15
19
position : absolute;
16
20
top : 0 ;
17
21
left : 0 ;
18
22
right : 0 ;
19
23
bottom : 0 ;
24
+ width : 500px ;
25
+ height : 500px ;
20
26
}
21
27
22
28
.Master {
Original file line number Diff line number Diff line change @@ -72,4 +72,4 @@ var routes = (
72
72
</ Routes >
73
73
) ;
74
74
75
- React . renderComponent ( routes , document . body ) ;
75
+ React . renderComponent ( routes , document . getElementById ( 'example' ) ) ;
Original file line number Diff line number Diff line change 1
1
<!doctype html public "embarassment">
2
2
< title > Data Flow Example</ title >
3
+ < link href ="../global.css " rel ="stylesheet "/>
3
4
< link href ="app.css " rel ="stylesheet "/>
4
5
< body >
6
+ < h1 class ="breadcrumbs "> < a href ="../index.html "> React Router Examples</ a > / Data Flow</ h1 >
7
+ < div id ="example "/>
5
8
< script src ="../build/data-flow.js "> </ script >
6
-
Original file line number Diff line number Diff line change @@ -55,4 +55,4 @@ var routes = (
55
55
</ Routes >
56
56
) ;
57
57
58
- React . renderComponent ( routes , document . body ) ;
58
+ React . renderComponent ( routes , document . getElementById ( 'example' ) ) ;
Original file line number Diff line number Diff line change 1
1
<!doctype html public "restroom">
2
2
< title > Dynamic Segments Example</ title >
3
- < link href ="../app .css " rel ="stylesheet "/>
3
+ < link href ="../global .css " rel ="stylesheet "/>
4
4
< body >
5
+ < h1 class ="breadcrumbs "> < a href ="../index.html "> React Router Examples</ a > / Dynamic Segments</ h1 >
6
+ < div id ="example "/>
5
7
< script src ="../build/dynamic-segments.js "> </ script >
Original file line number Diff line number Diff line change @@ -15,3 +15,6 @@ a.active {
15
15
color : hsl (20 , 50% , 50% );
16
16
}
17
17
18
+ .breadcrumbs a {
19
+ text-decoration : none;
20
+ }
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+ < title > React Router Examples</ title >
3
+ < link href ="global.css " rel ="stylesheet "/>
4
+ < body >
5
+ < h1 > React Router Examples</ h1 >
6
+ < ul >
7
+ < li > < a href ="animations/index.html "> Animations</ a > </ li >
8
+ < li > < a href ="auth-flow/index.html "> Auth Flow</ a > </ li >
9
+ < li > < a href ="data-flow/index.html "> Data Flow</ a > </ li >
10
+ < li > < a href ="dynamic-segments/index.html "> Dynamic Segments</ a > </ li >
11
+ < li > < a href ="master-detail/index.html "> Master Detail</ a > </ li >
12
+ < li > < a href ="partial-app-loading/index.html "> Partial App Loading</ a > </ li >
13
+ < li > < a href ="query-params/index.html "> Query Params</ a > </ li >
14
+ < li > < a href ="shared-root/index.html "> Shared Root</ a > </ li >
15
+ < li > < a href ="simple-master-detail/index.html "> Simple Master Detail</ a > </ li >
16
+ < li > < a href ="transitions/index.html "> Transitions</ a > </ li >
17
+ </ ul >
Original file line number Diff line number Diff line change @@ -11,12 +11,18 @@ a.active {
11
11
color : hsl (20 , 50% , 50% );
12
12
}
13
13
14
+ # example {
15
+ position : absolute;
16
+ }
17
+
14
18
.App {
15
19
position : absolute;
16
20
top : 0 ;
17
21
left : 0 ;
18
22
right : 0 ;
19
23
bottom : 0 ;
24
+ width : 500px ;
25
+ height : 500px ;
20
26
}
21
27
22
28
.ContactList {
Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ var routes = (
213
213
</ Routes >
214
214
) ;
215
215
216
- React . renderComponent ( routes , document . body ) ;
216
+ React . renderComponent ( routes , document . getElementById ( 'example' ) ) ;
217
217
218
218
// Request utils.
219
219
Original file line number Diff line number Diff line change 1
1
<!doctype html public "embarassment">
2
2
< title > Master Detail Example</ title >
3
+ < link href ="../global.css " rel ="stylesheet "/>
3
4
< link href ="app.css " rel ="stylesheet "/>
4
5
< body >
6
+ < h1 class ="breadcrumbs "> < a href ="../index.html "> React Router Examples</ a > / Master Detail</ h1 >
7
+ < div id ="example "/>
5
8
< script src ="../build/master-detail.js "> </ script >
Original file line number Diff line number Diff line change @@ -69,4 +69,4 @@ var routes = (
69
69
</ Routes >
70
70
) ;
71
71
72
- React . renderComponent ( routes , document . body ) ;
72
+ React . renderComponent ( routes , document . getElementById ( 'example' ) ) ;
Original file line number Diff line number Diff line change 1
1
<!doctype html public "intoxication">
2
2
< title > Partial App Loading Example</ title >
3
- < link rel ="stylesheet " href ="../app .css "/>
3
+ < link rel ="stylesheet " href ="../global .css "/>
4
4
< body >
5
+ < h1 class ="breadcrumbs "> < a href ="../index.html "> React Router Examples</ a > / Partial App Loading</ h1 >
6
+ < div id ="example "/>
5
7
< script src ="../build/partial-app-loading.js "> </ script >
Original file line number Diff line number Diff line change @@ -40,4 +40,4 @@ var routes = (
40
40
</ Routes >
41
41
) ;
42
42
43
- React . renderComponent ( routes , document . body ) ;
43
+ React . renderComponent ( routes , document . getElementById ( 'example' ) ) ;
Original file line number Diff line number Diff line change 1
1
<!doctype html public "restroom">
2
2
< title > Query Params Example</ title >
3
- < link href ="../app .css " rel ="stylesheet "/>
3
+ < link href ="../global .css " rel ="stylesheet "/>
4
4
< body >
5
+ < h1 class ="breadcrumbs "> < a href ="../index.html "> React Router Examples</ a > / Query Params</ h1 >
6
+ < div id ="example "/>
5
7
< script src ="../build/query-params.js "> </ script >
Original file line number Diff line number Diff line change @@ -80,4 +80,4 @@ var routes = (
80
80
</ Routes >
81
81
) ;
82
82
83
- React . renderComponent ( routes , document . body ) ;
83
+ React . renderComponent ( routes , document . getElementById ( 'example' ) ) ;
Original file line number Diff line number Diff line change 1
1
<!doctype html public "superawesome">
2
2
< title > Shared Root Example</ title >
3
- < link rel ="stylesheet " href ="../app .css "/>
3
+ < link rel ="stylesheet " href ="../global .css "/>
4
4
< body >
5
+ < h1 class ="breadcrumbs "> < a href ="../index.html "> React Router Examples</ a > / Shared Root</ h1 >
6
+ < div id ="example "/>
5
7
< script src ="../build/shared-root.js "> </ script >
Original file line number Diff line number Diff line change @@ -11,20 +11,26 @@ a.active {
11
11
color : hsl (20 , 50% , 50% );
12
12
}
13
13
14
+ # example {
15
+ position : absolute;
16
+ }
17
+
14
18
.App {
15
19
position : absolute;
16
20
top : 0 ;
17
21
left : 0 ;
18
22
right : 0 ;
19
23
bottom : 0 ;
24
+ width : 1000px ;
25
+ height : 800px ;
20
26
}
21
27
22
28
.Master {
23
29
position : absolute;
24
30
left : 0 ;
25
31
top : 0 ;
26
32
bottom : 0 ;
27
- width : 300 px ;
33
+ width : 200 px ;
28
34
overflow : auto;
29
35
padding : 10px 40px ;
30
36
}
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ var routes = (
58
58
</ Routes >
59
59
) ;
60
60
61
- React . renderComponent ( routes , document . body ) ;
61
+ React . renderComponent ( routes , document . getElementById ( 'example' ) ) ;
62
62
63
63
/*****************************************************************************/
64
64
// data stuff
Original file line number Diff line number Diff line change 1
1
<!doctype html public "embarassment">
2
2
< title > Simple Master Detail Example</ title >
3
+ < link href ="../global.css " rel ="stylesheet "/>
3
4
< link href ="app.css " rel ="stylesheet "/>
4
5
< body >
6
+ < h1 class ="breadcrumbs "> < a href ="../index.html "> React Router Examples</ a > / Simple Master Detail</ h1 >
7
+ < div id ="example "/>
5
8
< script src ="../build/simple-master-detail.js "> </ script >
Original file line number Diff line number Diff line change @@ -64,4 +64,4 @@ var routes = (
64
64
</ Routes >
65
65
) ;
66
66
67
- React . renderComponent ( routes , document . body ) ;
67
+ React . renderComponent ( routes , document . getElementById ( 'example' ) ) ;
Original file line number Diff line number Diff line change 1
1
<!doctype html public "restroom">
2
2
< title > Transitions Example</ title >
3
- < link href ="../app .css " rel ="stylesheet "/>
3
+ < link href ="../global .css " rel ="stylesheet "/>
4
4
< body >
5
+ < h1 class ="breadcrumbs "> < a href ="../index.html "> React Router Examples</ a > / Transitions</ h1 >
6
+ < div id ="example "/>
5
7
< script src ="../build/transitions.js "> </ script >
You can’t perform that action at this time.
0 commit comments