mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2025-01-31 21:40:38 +00:00
More cool stuff
This commit is contained in:
parent
9b7b1dcf11
commit
74a0468f09
3 changed files with 48 additions and 3 deletions
|
@ -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} <img src={this.props.user.avatar}
|
||||||
|
alt="User Avatar"
|
||||||
|
height="20"
|
||||||
|
width="20" /></a>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var MessageBar = React.createClass({
|
var MessageBar = React.createClass({
|
||||||
sendMessage: function (content) {
|
sendMessage: function (content) {
|
||||||
socket.emit("message:new", {
|
socket.emit("message:new", {
|
||||||
|
@ -423,7 +443,7 @@ var Gatherers = React.createClass({
|
||||||
commBadge = (<img src="/images/commander.png"
|
commBadge = (<img src="/images/commander.png"
|
||||||
alt="Commander"
|
alt="Commander"
|
||||||
height="20"
|
height="20"
|
||||||
width="20" />)
|
width="20" />);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -474,6 +494,7 @@ function initialiseComponents () {
|
||||||
React.render(<UserMenu />, document.getElementById('side-menu'));
|
React.render(<UserMenu />, document.getElementById('side-menu'));
|
||||||
React.render(<Chatroom />, document.getElementById('chatroom'));
|
React.render(<Chatroom />, document.getElementById('chatroom'));
|
||||||
React.render(<Gather />, document.getElementById('gathers'));
|
React.render(<Gather />, document.getElementById('gathers'));
|
||||||
|
React.render(<CurrentUser />, document.getElementById('currentuser'));
|
||||||
};
|
};
|
||||||
|
|
||||||
initialiseComponents();
|
initialiseComponents();
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -56,6 +56,9 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
<li id="currentuser">
|
||||||
|
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="navbar-default sidebar" role="navigation">
|
<div class="navbar-default sidebar" role="navigation">
|
||||||
|
|
Loading…
Reference in a new issue