Last active
January 3, 2016 10:58
-
-
Save RSpace/23a10dcd02145763d58e to your computer and use it in GitHub Desktop.
MeetupVR - Member.js
This file contains hidden or 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
export default class Member extends Component { | |
render () { | |
const { id, name, photoUrl } = this.props | |
if (this.props.vrMode) { | |
const { width, height, depth } = this.props | |
const { x, y, z } = this.props.position | |
const color = `#${TYPE_TO_COLOR_MAP[this.props.type || '']}` | |
return ( | |
<Entity geometry={{'primitive': 'box', width: width, height: height, depth: depth}} | |
material={{src: `url(${photoUrl})`, color}} | |
position={`${x} ${y} ${z}`} | |
onClick={() => {this.props.onClick(id) }} /> | |
) | |
} else { | |
var memberClass = classNames({ | |
'member-component': true, | |
'member-component__hipster': this.props.type === 'hipster', | |
'member-component__hacker': this.props.type === 'hacker', | |
'member-component__hustler': this.props.type === 'hustler' | |
}) | |
return ( | |
<div className={memberClass} onClick={() => {this.props.onClick(id) }} title={name}> | |
<img src={photoUrl} width="100" height="100" /> | |
</div> | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment