mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2025-04-25 00:41:07 +00:00
61 lines
1.5 KiB
JavaScript
61 lines
1.5 KiB
JavaScript
import React from "react"
|
|
|
|
class InfoButton extends React.Component {
|
|
state = {
|
|
open: false
|
|
}
|
|
|
|
toggleOpen = (e) => {
|
|
e.preventDefault();
|
|
this.setState({ open: !this.state.open });
|
|
}
|
|
|
|
chevron = () => {
|
|
if (this.state.open) {
|
|
return <i className="fa fa-angle-down pull-right"></i>;
|
|
} else {
|
|
return <i className="fa fa-angle-right pull-right"></i>;
|
|
}
|
|
}
|
|
|
|
render = () => {
|
|
const open = this.state.open;
|
|
let componentClass = ["treeview"];
|
|
let dropdown;
|
|
if (open) {
|
|
componentClass.push("active");
|
|
dropdown = (
|
|
<ul className="treeview-menu menu-open" style={{ display: "block" }}>
|
|
<li>
|
|
<a href="https://github.com/ENSL/ensl_gathers" target="_blank">
|
|
<i className="fa fa-github"> </i> Github
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="https://www.ensl.org/gatherre" target="_blank">
|
|
<i className="fa fa-legal"> </i> Gather Rules
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="/messages" target="_blank">
|
|
<i className="fa fa-comments"> </i> Message Archive
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<li className={componentClass.join(" ")}>
|
|
<a href="#" onClick={this.toggleOpen}>
|
|
<i className="fa fa-info-circle"></i><span>Info</span>
|
|
{this.chevron()}
|
|
</a>
|
|
{dropdown}
|
|
</li>
|
|
);
|
|
}
|
|
}
|
|
|
|
export { InfoButton }
|
|
|