mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-12-01 08:42:04 +00:00
17 lines
450 B
React
17 lines
450 B
React
|
var MenuCounter = React.createClass({
|
||
|
componentDidMount: function () {
|
||
|
socket.on('gatherCount', this.updateCount)
|
||
|
},
|
||
|
updateCount: function (data) {
|
||
|
this.setProps({count: data.count});
|
||
|
},
|
||
|
render: function () {
|
||
|
return (
|
||
|
<li>
|
||
|
<a href="#"><i className="fa fa-users fa-fw"></i> Gatherers ({this.props.count})</a>
|
||
|
</li>
|
||
|
);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
React.render(<MenuCounter count={0} />, document.getElementById('side-menu'));
|