Skip to content

Commit

Permalink
Flux - 23 - Filtering Image Data
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Jul 5, 2015
1 parent b61d75e commit 56668a1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions imgur-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"gulp-server-livereload": "^1.3.0",
"gulp-util": "^3.0.4",
"gulp-watch": "^4.2.4",
"lodash": "^3.10.0",
"node-notifier": "^4.2.1",
"react": "^0.13.3",
"react-router": "^1.0.0-beta2",
Expand Down
9 changes: 9 additions & 0 deletions imgur-client/sass/image-preview.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.image-preview {
display: inline-block;

img {
height: 200px;
width: 200px;
display: inline-block;
}
}
3 changes: 3 additions & 0 deletions imgur-client/sass/topic.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.topic {
text-align: center;
}
2 changes: 1 addition & 1 deletion imgur-client/src/components/image-preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var React = require('react');

module.exports = React.createClass({
render: function() {
return <div>
return <div className="image-preview">
{this.image()}
</div>
},
Expand Down
2 changes: 1 addition & 1 deletion imgur-client/src/components/topic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = React.createClass({
Actions.getImages(nextProps.params.id);
},
render: function() {
return <div>
return <div className="topic">
{this.renderImages()}
</div>
},
Expand Down
6 changes: 5 additions & 1 deletion imgur-client/src/stores/image-store.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
var Reflux = require('reflux');
var Api = require('../utils/api');
var Actions = require('../actions');
var _ = require('lodash');

module.exports = Reflux.createStore({
listenables: [Actions],
getImages: function(topicId){
Api.get('topics/' + topicId)
.then(function(json){
this.images = json.data;
this.images = _.reject(json.data, function(image) {
return image.is_album
});

this.triggerChange();
}.bind(this));
},
Expand Down

0 comments on commit 56668a1

Please sign in to comment.