1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

改善:UserNavatorに活性化されているPlanetがちゃん表示されるした

This commit is contained in:
Rokt33r
2015-07-29 10:52:37 +09:00
parent bd2d77fef7
commit c8851ecd2a
4 changed files with 139 additions and 137 deletions

View File

@@ -52,9 +52,11 @@ module.exports = React.createClass({
}
},
render: function () {
console.log(this.props.currentUser)
console.log(this.props.currentPlanet)
var planets = this.props.currentUser.Planets.map(function (planet, index) {
return (
<li key={planet.id} className={this.props.currentPlanet != null && this.props.currentPlanet.name === planet.name ? 'active' : ''}>
<li key={planet.id} className={this.props.currentPlanet != null && this.props.currentPlanet.userName === planet.userName && this.props.currentPlanet.name === planet.name ? 'active' : ''}>
<Link to='planet' params={{userName: planet.userName, planetName: planet.name}}>
{planet.name[0]}
<div className='planetTooltip'>{planet.userName}/{planet.name}</div>

View File

@@ -95,7 +95,6 @@ module.exports = React.createClass({
}
},
render: function () {
var currentPlanetName = this.props.params.planetName
var currentUser = this.state.currentUser
var user = this.state.user
@@ -104,12 +103,12 @@ module.exports = React.createClass({
var currentPlanet = null
currentUser.Planets.some(function (planet) {
if (planet.name === currentPlanetName) {
if (planet.userName === this.props.params.userName && planet.name === this.props.params.planetName) {
currentPlanet = planet
return true
}
return false
})
}.bind(this))
var content
if (this.isActive('userHome')) {