'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports['default'] = undefined;

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _dec, _class;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _mobxReact = require('mobx-react');

var _Logo2x = require('./style/icons/Logo@2x.png');

var _Logo2x2 = _interopRequireDefault(_Logo2x);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var Logo = (_dec = (0, _mobxReact.inject)('AppState', 'MenuStore'), _dec(_class = (0, _mobxReact.observer)(_class = function (_Component) {
  (0, _inherits3['default'])(Logo, _Component);

  function Logo() {
    var _ref;

    var _temp, _this, _ret;

    (0, _classCallCheck3['default'])(this, Logo);

    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, (_ref = Logo.__proto__ || Object.getPrototypeOf(Logo)).call.apply(_ref, [this].concat(args))), _this), _this.onHideMenu = function () {
      var _this$props = _this.props,
          AppState = _this$props.AppState,
          MenuStore = _this$props.MenuStore;
      var hideMenu = AppState.hideMenu;

      if (hideMenu) {
        AppState.setHideMenu(false);
      } else {
        AppState.setHideMenu(true);
        MenuStore.setCollapsed(false);
        MenuStore.setOpenKeys([]);
      }
    }, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
  }

  (0, _createClass3['default'])(Logo, [{
    key: 'render',
    value: function render() {
      var AppState = this.props.AppState;

      return _react2['default'].createElement(
        'div',
        { className: 'header-logo-wrap' },
        _react2['default'].createElement('div', { className: 'header-logo-icon', onClick: this.onHideMenu, style: { backgroundImage: 'url( ' + _Logo2x2['default'] + ')' } })
      );
    }
  }]);
  return Logo;
}(_react.Component)) || _class) || _class);
exports['default'] = Logo;