mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-30 16:11:27 +00:00
17 lines
No EOL
572 B
JavaScript
17 lines
No EOL
572 B
JavaScript
var MenuCounter = React.createClass({displayName: "MenuCounter",
|
|
componentDidMount: function () {
|
|
socket.on('gatherCount', this.updateCount)
|
|
},
|
|
updateCount: function (data) {
|
|
this.setProps({count: data.count});
|
|
},
|
|
render: function () {
|
|
return (
|
|
React.createElement("li", null,
|
|
React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-users fa-fw"}), " Gatherers (", this.props.count, ")")
|
|
)
|
|
);
|
|
}
|
|
});
|
|
|
|
React.render(React.createElement(MenuCounter, {count: 0}), document.getElementById('side-menu')); |