/* * A copoment to for left main menu */ import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import InlineSVG from 'svg-inline-react'; import { getQueryParameter } from 'common/commonUtil'; import Style from './left-menu.less'; import ClassBind from 'classnames/bind'; import { showFilter, showRootCA } from 'action/globalStatusAction'; import { MenuKeyMap } from 'common/constant'; const StyleBind = ClassBind.bind(Style); const { RECORD_FILTER: RECORD_FILTER_MENU_KEY, ROOT_CA: ROOT_CA_MENU_KEY } = MenuKeyMap; class LeftMenu extends React.Component { constructor() { super(); this.state = { inAppMode: getQueryParameter('in_app_mode') }; // this.showMapLocal = this.showMapLocal.bind(this); this.showFilter = this.showFilter.bind(this); this.showRootCA = this.showRootCA.bind(this); } static propTypes = { dispatch: PropTypes.func, globalStatus: PropTypes.object } // showMapLocal() { // this.props.dispatch(showMapLocal()); // } showFilter() { this.props.dispatch(showFilter()); } showRootCA() { this.props.dispatch(showRootCA()); } render() { const { filterStr, activeMenuKey, recording } = this.props.globalStatus; const filterMenuStyle = StyleBind('menuItem', { working: filterStr.length > 0, active: activeMenuKey === RECORD_FILTER_MENU_KEY }); const rootCAMenuStyle = StyleBind('menuItem', { active: activeMenuKey === ROOT_CA_MENU_KEY }); const wrapperStyle = StyleBind('wrapper', { inApp: this.state.inAppMode }); const circleStyle = StyleBind('circles', { active: recording, stop: !recording }); return (
); } } function select(state) { return { globalStatus: state.globalStatus }; } export default connect(select)(LeftMenu);