Skip to content

Commit

Permalink
Flux - 16 - Routing with Parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Jul 5, 2015
1 parent 10519ed commit 6c2e386
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions imgur-client/src/components/topic-list.jsx
Expand Up @@ -2,6 +2,8 @@ var React = require('react');
var Reflux = require('reflux');
var TopicStore = require('../stores/topic-store');
var Actions = require('../actions');
var ReactRouter = require('react-router');
var Link = ReactRouter.Link;

module.exports = React.createClass({
mixins: [
Expand All @@ -23,9 +25,10 @@ module.exports = React.createClass({
},
renderTopics: function() {
return this.state.topics.map(function(topic){
return <li>
{topic}
</li>
return <Link to={"topics/" + topic.id} className="list-group-item" key={topic.id}>
<h4>{topic.name}</h4>
<p>{topic.description}</p>
</Link>
});
},
onChange: function(event, topics) {
Expand Down

0 comments on commit 6c2e386

Please sign in to comment.