mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-12-11 13:21:40 +00:00
36 lines
609 B
JavaScript
36 lines
609 B
JavaScript
const React = require("react");
|
|
|
|
var SnowMachineMenu = React.createClass({
|
|
getInitialState() {
|
|
return {
|
|
snowMachine: null
|
|
}
|
|
},
|
|
|
|
componentDidMount() {
|
|
const snowMachine = new SnowMachine();
|
|
snowMachine.start();
|
|
this.setState({ snowMachine: snowMachine });
|
|
},
|
|
|
|
toggle() {
|
|
const snowMachine = this.state.snowMachine;
|
|
if (snowMachine.timer) {
|
|
snowMachine.stop();
|
|
} else {
|
|
snowMachine.start();
|
|
}
|
|
},
|
|
|
|
render() {
|
|
return (
|
|
<ul className="nav navbar-top-links navbar-right">
|
|
<li>
|
|
<a href="#" onClick={this.toggle}>
|
|
Snow
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
);
|
|
}
|
|
});
|