Skip to content

Commit

Permalink
tooling - part 5
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Mar 21, 2015
1 parent 2112054 commit 50d6b89
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 29 deletions.
1 change: 1 addition & 0 deletions thumbnail-gulp/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
main.js
3 changes: 1 addition & 2 deletions thumbnail-gulp/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<head>
<script src="http://fb.me/react-0.13.0.js"></script>
<script src="application.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
</head>
<body>
<div class="container">
</div>
</body>
<script src="main.js"></script>
23 changes: 0 additions & 23 deletions thumbnail-gulp/main.js

This file was deleted.

6 changes: 5 additions & 1 deletion thumbnail-gulp/src/app.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
var React = require('react');
var ThumbnailList = require('./thumbnail-list');

var options = {
thumbnailData: [{
title: 'Show Courses',
number: 12,
number: 120,
header: 'Learn React',
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.',
imageUrl: 'https://raw.githubusercontent.com/wiki/facebook/react/react-logo-1000-transparent.png'
Expand All @@ -14,5 +17,6 @@ var options = {
}]
};


var element = React.createElement(ThumbnailList, options);
React.render(element, document.querySelector('.container'));
4 changes: 3 additions & 1 deletion thumbnail-gulp/src/badge.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
var Badge = React.createClass({
var React = require('react');

module.exports = React.createClass({
render: function() {
return <button className="btn btn-primary" type="button">
{this.props.title} <span className="badge">{this.props.number}</span>
Expand Down
5 changes: 4 additions & 1 deletion thumbnail-gulp/src/thumbnail-list.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
var ThumbnailList = React.createClass({
var React = require('react');
var Thumbnail = require('./thumbnail');

module.exports = React.createClass({
render: function() {
var list = this.props.thumbnailData.map(function(thumbnailProps){
return <Thumbnail {...thumbnailProps} />
Expand Down
5 changes: 4 additions & 1 deletion thumbnail-gulp/src/thumbnail.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
var Thumbnail = React.createClass({
var React = require('react');
var Badge = require('./badge');

module.exports = React.createClass({
render: function() {
return <div className="col-sm-6 col-md-4">
<div className="thumbnail">
Expand Down

0 comments on commit 50d6b89

Please sign in to comment.