@@ -4,51 +4,54 @@ import ReactCSSTransitionGroup from "react-addons-css-transition-group"
4
4
import { Route , Redirect } from "react-router-dom"
5
5
6
6
import "./main.css"
7
+ import Layout from "../layouts"
7
8
8
9
class AnimationExample extends React . Component {
9
10
render ( ) {
10
11
return (
11
- < div style = { { position : `relative` , minHeight : `80vh` } } >
12
- < Route
13
- render = { ( { location } ) => (
14
- < div style = { styles . fill } >
15
- < Route
16
- exact
17
- path = "/"
18
- render = { ( ) => < Redirect to = "/10/90/50" /> }
19
- />
12
+ < Layout >
13
+ < div style = { { position : `relative` , minHeight : `80vh` } } >
14
+ < Route
15
+ render = { ( { location } ) => (
16
+ < div style = { styles . fill } >
17
+ < Route
18
+ exact
19
+ path = "/"
20
+ render = { ( ) => < Redirect to = "/10/90/50" /> }
21
+ />
20
22
21
- < ul style = { styles . nav } >
22
- < NavLink to = "/10/90/50" > Red</ NavLink >
23
- < NavLink to = "/120/100/40" > Green</ NavLink >
24
- < NavLink to = "/200/100/40" > Blue</ NavLink >
25
- < NavLink to = "/310/100/50" > Pink</ NavLink >
26
- </ ul >
23
+ < ul style = { styles . nav } >
24
+ < NavLink to = "/10/90/50" > Red</ NavLink >
25
+ < NavLink to = "/120/100/40" > Green</ NavLink >
26
+ < NavLink to = "/200/100/40" > Blue</ NavLink >
27
+ < NavLink to = "/310/100/50" > Pink</ NavLink >
28
+ </ ul >
27
29
28
- < div style = { styles . content } >
29
- < ReactCSSTransitionGroup
30
- transitionName = "fade"
31
- transitionEnterTimeout = { 300 }
32
- transitionLeaveTimeout = { 300 }
33
- >
34
- { /* no different than other usage of
30
+ < div style = { styles . content } >
31
+ < ReactCSSTransitionGroup
32
+ transitionName = "fade"
33
+ transitionEnterTimeout = { 300 }
34
+ transitionLeaveTimeout = { 300 }
35
+ >
36
+ { /* no different than other usage of
35
37
ReactCSSTransitionGroup, just make
36
38
sure to pass `location` to `Route`
37
39
so it can match the old location
38
40
as it animates out
39
41
*/ }
40
- < Route
41
- location = { location }
42
- key = { location . key }
43
- path = "/:h/:s/:l"
44
- component = { HSL }
45
- />
46
- </ ReactCSSTransitionGroup >
42
+ < Route
43
+ location = { location }
44
+ key = { location . key }
45
+ path = "/:h/:s/:l"
46
+ component = { HSL }
47
+ />
48
+ </ ReactCSSTransitionGroup >
49
+ </ div >
47
50
</ div >
48
- </ div >
49
- ) }
50
- / >
51
- </ div >
51
+ ) }
52
+ />
53
+ </ div >
54
+ </ Layout >
52
55
)
53
56
}
54
57
}
0 commit comments