Skip to content

Commit 3ac4d7c

Browse files
committed
Tooling - part1
1 parent ee7157f commit 3ac4d7c

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed

thumbnail-gulp/index.html

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

thumbnail-gulp/src/app.jsx

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

thumbnail-gulp/src/badge.jsx

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

thumbnail-gulp/src/thumbnail-list.jsx

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

thumbnail-gulp/src/thumbnail.jsx

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

0 commit comments

Comments
 (0)