mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
改善:UserNavatorに活性化されているPlanetがちゃん表示されるした
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user