More cool stuff

This commit is contained in:
Chris Blanchard 2015-07-27 01:09:02 +01:00
parent 9b7b1dcf11
commit 74a0468f09
3 changed files with 48 additions and 3 deletions

View file

@ -196,6 +196,26 @@ var ChatMessage = React.createClass({
}
});
var CurrentUser = React.createClass({
getDefaultProps: function () {
return {
username: "",
avatar: ""
}
},
componentDidMount: function () {
},
render: function () {
return (
<a href="#">{this.props.user.username} &nbsp;<img src={this.props.user.avatar}
alt="User Avatar"
height="20"
width="20" /></a>
);
}
});
var MessageBar = React.createClass({
sendMessage: function (content) {
socket.emit("message:new", {
@ -423,7 +443,7 @@ var Gatherers = React.createClass({
commBadge = (<img src="/images/commander.png"
alt="Commander"
height="20"
width="20" />)
width="20" />);
}
return (
@ -474,6 +494,7 @@ function initialiseComponents () {
React.render(<UserMenu />, document.getElementById('side-menu'));
React.render(<Chatroom />, document.getElementById('chatroom'));
React.render(<Gather />, document.getElementById('gathers'));
React.render(<CurrentUser />, document.getElementById('currentuser'));
};
initialiseComponents();

File diff suppressed because one or more lines are too long

View file

@ -56,6 +56,9 @@
</li>
</ul>
</li>
<li id="currentuser">
</li>
</ul>
<div class="navbar-default sidebar" role="navigation">