/*
 * @Author: 吴文洁
 * @Date: 2019-09-10 18:26:03
 * @LastEditors: wangyixi
 * @LastEditTime: 2020-11-11 14:04:50
 * @Description:
 */
import React from 'react';
import './Header.less';
import {
  Menu,
  Dropdown,
  Icon,
  message,
  Modal,
  Input,
  Avatar,
  Button,
  Row,
  Col,
  Badge,
  Tooltip,
  Radio,
} from 'antd';
import { withRouter } from 'react-router-dom';
import Bus from '@/core/bus';
// var $topContainer = $('#top-container');
class Header extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      menuType: 1,
    };
  }

  componentWillMount() {
  }

  componentDidMount() {
  }
  handleMenu = () => {
    const menuType = !this.state.menuType;
    this.setState({ menuType }, () => {
      Bus.trigger('menuTypeChange', menuType);
    });
  };
  render() {
    const {
    } = this.state;
    return (
      <div id="top-container" className="top-container">
        <div className="top top-nav">
          <div>
            {this.state.menuType ? (
              <img src="https://image.xiaomaiketang.com/xm/TP2x7aQ24y.png" className="logo" alt="" />
            ):(
              <img src="https://dev.xiaomai5.com/admin/static/images/logo.928339cd.png" className="logo" alt="" />
            )}
          </div>
          {this.state.menuType ? (
            <span className="icon iconfont cursor ml20  handLike" onClick={this.handleMenu}>
              &#xe7ff;{' '}
            </span>
          ) : (
            <span className="icon iconfont cursor ml20  handLike" onClick={this.handleMenu}>
              &#xe7fe;
            </span>
          )}
          <div className="message-help">
            <Dropdown>
              <div className="user">
                <span className="name">张乐园</span>
              </div>
            </Dropdown>
          </div>
        </div>
      </div>
    );
  }
}

export default withRouter(Header);
