File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
Expand file tree Collapse file tree 1 file changed +47
-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 >
10+
11+ < script type ="text/jsx ">
12+ var Badge = React . createClass ( {
13+ render : function ( ) {
14+ return < button className = "btn btn-primary" type = "button" >
15+ { this . props . title } < span className = "badge" > { this . props . number } </ span >
16+ </ button >
17+ }
18+ } ) ;
19+
20+ var Thumbnail = React . createClass ( {
21+ render : function ( ) {
22+ return < div className = "col-sm-6 col-md-4" >
23+ < div className = "thumbnail" >
24+ < img src = { this . props . imageUrl } alt = "..." > </ img >
25+ < div className = "caption" >
26+ < h3 > { this . props . header } </ h3 >
27+ < p > { this . props . description } </ p >
28+ < p >
29+ < Badge title = { this . props . title } number = { this . props . number } />
30+ </ p >
31+ </ div >
32+ </ div >
33+ </ div >
34+ }
35+ } ) ;
36+
37+ var options = {
38+ title : 'Show Courses' ,
39+ number : 12 ,
40+ header : 'Learn React' ,
41+ 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.' ,
42+ imageUrl : 'https://raw.githubusercontent.com/wiki/facebook/react/react-logo-1000-transparent.png'
43+ } ;
44+
45+ var element = React . createElement ( Thumbnail , options ) ;
46+ React . render ( element , document . querySelector ( '.container' ) ) ;
47+ </ script >
You can’t perform that action at this time.
0 commit comments