2018-09-04 10:24:08 -05:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import appEvents from '../../app_events';
|
|
|
|
import TopSection from './TopSection';
|
|
|
|
import BottomSection from './BottomSection';
|
2019-03-07 02:36:40 -06:00
|
|
|
import config from 'app/core/config';
|
2018-09-04 10:24:08 -05:00
|
|
|
|
2019-03-07 02:36:40 -06:00
|
|
|
const homeUrl = config.appSubUrl || '/';
|
2018-09-04 10:24:08 -05:00
|
|
|
|
2019-03-07 02:36:40 -06:00
|
|
|
export class SideMenu extends PureComponent {
|
2018-09-04 10:24:08 -05:00
|
|
|
toggleSideMenuSmallBreakpoint = () => {
|
|
|
|
appEvents.emit('toggle-sidemenu-mobile');
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return [
|
2019-03-07 02:36:40 -06:00
|
|
|
<a href={homeUrl} className="sidemenu__logo" key="logo">
|
2018-10-16 00:50:44 -05:00
|
|
|
<img src="public/img/grafana_icon.svg" alt="Grafana" />
|
2019-03-07 02:36:40 -06:00
|
|
|
</a>,
|
2018-09-04 10:24:08 -05:00
|
|
|
<div className="sidemenu__logo_small_breakpoint" onClick={this.toggleSideMenuSmallBreakpoint} key="hamburger">
|
|
|
|
<i className="fa fa-bars" />
|
|
|
|
<span className="sidemenu__close">
|
2019-02-19 08:41:35 -06:00
|
|
|
<i className="fa fa-times" />
|
|
|
|
Close
|
2018-09-04 10:24:08 -05:00
|
|
|
</span>
|
|
|
|
</div>,
|
|
|
|
<TopSection key="topsection" />,
|
|
|
|
<BottomSection key="bottomsection" />,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|