Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
import * as React from 'react';
import { reduxify } from './utils';
import { User } from './User';
(state) => ({
users: state.users,
hideExamples: state.hideExamples
(dispatch) => ({
toggleExamples:() => dispatch({ type: 'EXAMPLES_TOGGLE' })
export class Sidebar extends React.Component<any, any> {
render() {
const height = this.props.hideExamples ? "25px" : "auto";
const label = this.props.hideExamples ? "show" : "hide";
return (
<div id="right">
<div id="users">
{ => <User key={user.userId} user={user} onSelect={() => this.props.onUserSelected(user)} />)}
<div id="examples" style={{ height: height }}>
<span style={{position: "absolute", top: "2px", right: "7px"}} onClick={this.props.toggleExamples}>{label}</span>
<span onClick={e => this.props.onCommandSelected(( as HTMLElement).innerHTML)}>
<h4><a href="">Example Commands</a></h4>
<div>/cmd.announce This is your captain speaking ...</div>
<h4><a href="">CSS</a></h4>
<div>/css.background-image url(</div>
<div>/css.background-image url(</div>
<div>@me /css.background #eceff1</div>
<div>/css.background$#top #673ab7</div>
<div>/css.background$#bottom #0091ea</div>
<div>/css.background$#right #fffde7</div>
<div>/css.color$#welcome #ff0</div>
<div>/css.visibility$img,a hidden</div>
<div>/css.visibility$img,a visible</div>
<h4><a href="">Receivers</a></h4>
<div>@me /</div>
<div>/document.title New Window Title</div>
<div>/cmd.addReceiver window</div>
<div>/cmd.removeReceiver window</div>
<h4><a href="">Triggers</a></h4>
<div>/trigger.customEvent arg</div>