Skip to content

Commit 5693d3c

Browse files
committed
thumbnail
1 parent 0f49ee5 commit 5693d3c

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

thumbnail/index.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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>

0 commit comments

Comments
 (0)