Skip to content

Commit

Permalink
Bonfire rendering sidepanel correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Berkeley Martinez authored and Berkeley Martinez committed Mar 19, 2015
1 parent d736d64 commit 40ec190
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions common/components/bonfires/Bonfires.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ var Bonfire = React.createClass({

render: function() {
var {
name,
difficulty,
description
} = this.state;
var brief = description.shift();
var brief = description.slice(0, 1).pop();

// convert bonfire difficulty from floating point string
// to integer.
Expand All @@ -32,9 +33,10 @@ var Bonfire = React.createClass({
<Grid>
<Row>
<SidePanel
difficulty={ difficulty }
name={ name }
brief={ brief }
description={ description }/>
difficulty={ difficulty }
description={ description.length > 1 ? description : [] }/>
<Col
xs={ 12 }
md={ 8 }>
Expand Down
5 changes: 3 additions & 2 deletions common/components/bonfires/SidePanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var React = require('react'),
var SidePanel = React.createClass({

propTypes: {
name: React.PropTypes.string,
brief: React.PropTypes.string,
description: React.PropTypes.array,
difficulty: React.PropTypes.number
Expand Down Expand Up @@ -48,7 +49,7 @@ var SidePanel = React.createClass({
return (
<i
key={ num }
className={ className } />
className={ className }/>
);
});
},
Expand All @@ -75,7 +76,7 @@ var SidePanel = React.createClass({
xs={ 12 }
md={ 4 }>
<div>
<h1 classNameName='text-center'>Meet Bonfire</h1>
<h1 classNameName='text-center'>{ this.props.name }</h1>
<h2 classNameName='text-center'>
<div classNameName='bonfire-flames'>
Difficulty:&nbsp;
Expand Down
3 changes: 2 additions & 1 deletion common/components/bonfires/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ var BonfiresStore = Store.create({

return [
setBonfire
.map(function({ description, difficulty}) {
.map(function({ name, description, difficulty}) {
return {
name,
description,
difficulty
};
Expand Down

0 comments on commit 40ec190

Please sign in to comment.