File tree Expand file tree Collapse file tree 5 files changed +61
-0
lines changed Expand file tree Collapse file tree 5 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ < head >
2
+ < script src ="http://fb.me/react-0.13.0.js "> </ script >
3
+ < script src ="http://fb.me/JSXTransformer-0.13.0.js "> </ script >
4
+ < link rel ="stylesheet " href ="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css ">
5
+ </ head >
6
+ < body >
7
+ < div class ="container ">
8
+ </ div >
9
+ </ body >
Original file line number Diff line number Diff line change
1
+ var options = {
2
+ thumbnailData : [ {
3
+ title : 'Show Courses' ,
4
+ number : 12 ,
5
+ header : 'Learn React' ,
6
+ description : 'React is a fantastic new front end library for rendering web pages. React is a fantastic new front end library for rendering web pages.' ,
7
+ imageUrl : 'https://raw.githubusercontent.com/wiki/facebook/react/react-logo-1000-transparent.png'
8
+ } , {
9
+ title : 'Show Courses' ,
10
+ number : 25 ,
11
+ header : 'Learn Gulp' ,
12
+ description : 'Gulp will speed up your development workflow. Gulp will speed up your development workflow. Gulp will speed up your development workflow.' ,
13
+ imageUrl : 'http://brunch.io/images/others/gulp.png'
14
+ } ]
15
+ } ;
16
+
17
+ var element = React . createElement ( ThumbnailList , options ) ;
18
+ React . render ( element , document . querySelector ( '.container' ) ) ;
Original file line number Diff line number Diff line change
1
+ var Badge = React . createClass ( {
2
+ render : function ( ) {
3
+ return < button className = "btn btn-primary" type = "button" >
4
+ { this . props . title } < span className = "badge" > { this . props . number } </ span >
5
+ </ button >
6
+ }
7
+ } ) ;
Original file line number Diff line number Diff line change
1
+ var ThumbnailList = React . createClass ( {
2
+ render : function ( ) {
3
+ var list = this . props . thumbnailData . map ( function ( thumbnailProps ) {
4
+ return < Thumbnail { ...thumbnailProps } />
5
+ } ) ;
6
+
7
+ return < div >
8
+ { list }
9
+ </ div >
10
+ }
11
+ } ) ;
Original file line number Diff line number Diff line change
1
+ var Thumbnail = React . createClass ( {
2
+ render : function ( ) {
3
+ return < div className = "col-sm-6 col-md-4" >
4
+ < div className = "thumbnail" >
5
+ < img src = { this . props . imageUrl } alt = "..." > </ img >
6
+ < div className = "caption" >
7
+ < h3 > { this . props . header } </ h3 >
8
+ < p > { this . props . description } </ p >
9
+ < p >
10
+ < Badge title = { this . props . title } number = { this . props . number } />
11
+ </ p >
12
+ </ div >
13
+ </ div >
14
+ </ div >
15
+ }
16
+ } ) ;
You can’t perform that action at this time.
0 commit comments