1
Fork 0

Added glyphicon support for icons

This commit is contained in:
Jake Howard 2016-01-29 22:56:59 +00:00
parent d87e5b0bd1
commit 63d96d0a2e
3 changed files with 11 additions and 5 deletions

View file

@ -28,9 +28,15 @@ export default class Item extends React.Component {
render() {
let icon;
if (this.props.icon) {
if (this.props.icon.startsWith('ion')) {
icon = (
<i className={'icon ' + this.props.icon}></i>
<i className={'icon ' + this.props.icon} />
);
} else if (this.props.icon.startsWith('glyphicon')) {
icon = (
<span className={'glyphicon ' + this.props.icon} aria-hidden="true" />
);
}
}
return (
<li><a href={this.state.url}>{icon}{this.props.children}</a></li>

View file

@ -35,7 +35,7 @@ export default class NavBar extends React.Component {
<Dropdown title="College">
<Item ident="robotics:index">Student Robotics</Item>
<Item href="#" icon="ion-cube">Attack on Blocks Game</Item>
<Item href="#">Student Server</Item>
<Item href="#" icon="glyphicon-hdd">Student Server</Item>
<Item href="#" icon="ion-ios-paper">EPQ</Item>
<Item href="#">Wall of Sheep</Item>
</Dropdown>

View file

@ -78,7 +78,7 @@
}
margin: 0;
z-index: 10000;
i + * {
i + *, .glyphicon + * {
margin-left: 5px;
}
& .container-fluid{