'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, _class2, _temp;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _IconHamburgerLine = require('instructure-icons/lib/Line/IconHamburgerLine');

var _IconHamburgerLine2 = _interopRequireDefault(_IconHamburgerLine);

var _ScreenReaderContent = require('@instructure/ui-a11y/lib/components/ScreenReaderContent');

var _ScreenReaderContent2 = _interopRequireDefault(_ScreenReaderContent);

var _lib = require('@instructure/ui-themeable/lib');

var _lib2 = _interopRequireDefault(_lib);

var _formatMessage = require('../../../../format-message');

var _formatMessage2 = _interopRequireDefault(_formatMessage);

var _theme = require('./theme');

var _theme2 = _interopRequireDefault(_theme);

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

var styles = {
  template: function template(theme) {
    return '/*  imported from styles.css  */\n\n.HeaderMenuButton__styles__title {\n  /* default to none - since toggle moved to sidebar on non mobile */\n  display: none;\n  height: inherit;\n}\n\n@media screen and (--phoneBreakPoint) {\n  .HeaderMenuButton__styles__title {\n    display: flex;\n    align-items: center;\n  }\n}\n\n.HeaderMenuButton__styles__menuButton {\n  border: none;\n  font-size: ' + theme.menuButtonFontSize + ';\n  color: ' + theme.menuButtonColor + ';\n  background: transparent;\n  height: inherit;\n}\n\n.HeaderMenuButton__styles__menuButton:hover {\n  opacity: ' + theme.menuButtonHoverOpacity + ';\n}\n';
  },
  'title': 'HeaderMenuButton__styles__title',
  'menuButton': 'HeaderMenuButton__styles__menuButton'
};
var HeaderMenuButton = (_dec = (0, _lib2.default)(_theme2.default, styles), _dec(_class = (_temp = _class2 = function (_Component) {
  (0, _inherits3.default)(HeaderMenuButton, _Component);

  function HeaderMenuButton() {
    (0, _classCallCheck3.default)(this, HeaderMenuButton);
    return (0, _possibleConstructorReturn3.default)(this, (HeaderMenuButton.__proto__ || Object.getPrototypeOf(HeaderMenuButton)).apply(this, arguments));
  }

  (0, _createClass3.default)(HeaderMenuButton, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          hidden = _props.hidden,
          sidebarMenuClick = _props.sidebarMenuClick;


      if (hidden) {
        return null;
      }

      return _react2.default.createElement(
        'div',
        { className: styles.title },
        _react2.default.createElement(
          'button',
          {
            className: styles.menuButton,
            onClick: sidebarMenuClick,
            tabIndex: '0',
            'data-automation': 'sdk-hamburger-button'
          },
          _react2.default.createElement(_IconHamburgerLine2.default, null),
          _react2.default.createElement(
            _ScreenReaderContent2.default,
            null,
            'Ouvrir le menu'
          )
        )
      );
    }
  }]);
  HeaderMenuButton.displayName = 'HeaderMenuButton'
  ;
  return HeaderMenuButton;
}(_react.Component), _class2.propTypes = {
  sidebarMenuClick: _propTypes2.default.func.isRequired,
  hidden: _propTypes2.default.bool.isRequired
}, _temp)) || _class);
exports.default = HeaderMenuButton;