File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1+ var React = require ( 'react' ) ;
2+
3+ module . exports = React . createClass ( {
4+ render : function ( ) {
5+ return < div >
6+ I am an image detail.
7+ </ div >
8+ }
9+ } ) ;
Original file line number Diff line number Diff line change 11var React = require ( 'react' ) ;
2+ var ReactRouter = require ( 'react-router' ) ;
3+ var Link = ReactRouter . Link ;
24
35module . exports = React . createClass ( {
46 getInitialState : function ( ) {
@@ -7,15 +9,16 @@ module.exports = React.createClass({
79 }
810 } ,
911 render : function ( ) {
10- return < div
12+ return < Link
13+ to = { "images/" + this . props . id }
1114 className = "image-preview"
1215 onMouseEnter = { this . handleMouseEnter }
1316 onMouseLeave = { this . handleMouseLeave }
1417 >
1518 { this . props . animated && this . state . hovering ? this . video ( ) : this . image ( ) }
1619 { this . props . animated && ! this . state . hovering ? this . icon ( ) : null }
1720 { this . state . hovering ? this . inset ( ) : null }
18- </ div >
21+ </ Link >
1922 } ,
2023 inset : function ( ) {
2124 return < div className = "inset" >
Original file line number Diff line number Diff line change @@ -6,11 +6,13 @@ var Route = ReactRouter.Route;
66
77var Main = require ( './components/main' ) ;
88var Topic = require ( './components/topic' ) ;
9+ var ImageDetail = require ( './components/image-detail' ) ;
910
1011module . exports = (
1112 < Router history = { new HashHistory } >
1213 < Route path = "/" component = { Main } >
1314 < Route path = "topics/:id" component = { Topic } />
15+ < Route path = "images/:id" component = { ImageDetail } />
1416 </ Route >
1517 </ Router >
1618)
You can’t perform that action at this time.
0 commit comments