Last active
January 3, 2016 10:57
-
-
Save RSpace/04d18756a7accfe0de58 to your computer and use it in GitHub Desktop.
MeetupVR - Members.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Members extends Component { | |
render () { | |
let members = this.props.members | |
if (this.props.vrMode) { | |
return ( | |
<Entity> | |
{members.map(this.renderMember.bind(this))} | |
</Entity> | |
) | |
} else { | |
return ( | |
<div className="members-container"> | |
{members.map(this.renderMember.bind(this))} | |
</div> | |
) | |
} | |
} | |
renderMember (member, index) { | |
let position = circularPositionFromIndex(index, boxSize) | |
return ( | |
<Member key={index} id={member.get('id')} name={member.get('name')} photoUrl={member.get('photo_url')} | |
type={member.get('type')} | |
width={boxSize} height={boxSize} depth={boxSize} | |
position={position} | |
index={index} | |
onClick={this.props.onAvatarClicked} | |
vrMode={this.props.vrMode} /> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment