import React from 'react'; import { Segment, Header, Image, Icon, Table, Label, } from 'semantic-ui-react' export default class AccountHeader extends React.Component { constructor(props) { super(props); } render() { if (this.props.account) { let bannedInfo = this.props.account.status == "Banned" ? (
This account has been banned Reason for ban {this.props.account.banHistory[0].message}
) : null; let accountStatus = this.props.account.status == "Banned" ? (
) : ( ) let avatarUrl = "/images/avatar_b.jpg"; if (this.props.account.oculusProfile && this.props.account.oculusProfile.oculusImageURL) { avatarUrl = this.props.account.oculusProfile.oculusImageURL; } else if (this.props.account.steamProfile && this.props.account.steamProfile.avatarfull) { avatarUrl = this.props.account.steamProfile.avatarfull; } // currentRoomId will be set if the user is in a room, but it will be "hidden" if the room is not public. // We're still sticking with the plan of hiding private rooms. let roomLink = null; if (this.props.connections && this.props.connections.length > 0 && this.props.connections[0].currentRoomId) { if (this.props.connections[0].currentRoomId === "hidden") { roomLink = ( ) } else { roomLink = ( ) } } return (
{this.props.account.username} {(this.props.connections && this.props.connections.length > 0) && } {roomLink}
{this.props.account.accessPolicies.includes("Admin") && This is a Bigscreen Admin Account 👑 } {this.props.account.accessPolicies.includes("Moderator") && This is a Bigscreen Moderator Account ✅ } {this.props.account.accessPolicies.includes("Fabricator") && This is a Bigscreen Fabricator Account 🛠 } {bannedInfo}
); } } }