diff --git a/web/app/components/auth-panel/auth-panel.jsx b/web/app/components/auth-panel/auth-panel.jsx index 0ba4b09b..0883ec38 100644 --- a/web/app/components/auth-panel/auth-panel.jsx +++ b/web/app/components/auth-panel/auth-panel.jsx @@ -5,33 +5,44 @@ export default class AuthPanel extends Component { super(props); this.toggleUserId = this.toggleUserId.bind(this); + this.toggleBlockedVisibility = this.toggleBlockedVisibility.bind(this); } toggleUserId() { this.setState({ isUserIdVisible: !this.state.isUserIdVisible }); } - render(props, { isUserIdVisible }) { + toggleBlockedVisibility() { + if (!this.state.isBlockedVisible) { + if (this.props.onBlockedUsersShow) this.props.onBlockedUsersShow(); + } else { + if (this.props.onBlockedUsersHide) this.props.onBlockedUsersHide(); + } + + this.setState({ isBlockedVisible: !this.state.isBlockedVisible }); + } + + render(props, { isUserIdVisible, isBlockedVisible }) { const { user, providers = [] } = props; return (
{ !!user.name && ( - +
You signed in as {' '} {user.name} {isUserIdVisible && ({user.id})}. {' '} Sign out? - +
) } { !user.name && ( - +
Sign in to comment using {' '} { @@ -50,7 +61,18 @@ export default class AuthPanel extends Component { }) } {'.'} - +
+ ) + } + + { + user.admin && ( +
+ {isBlockedVisible ? 'hide' : 'show'} blocked +
) }