"use strict";

exports.__esModule = true;
exports.default = void 0;
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _proptypes = require("../../util/proptypes");
var _provider = _interopRequireDefault(require("../../atom/provider"));
var _link = _interopRequireDefault(require("../../atom/link"));
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function Hero(props, context) {
  const {
    skin
  } = context;
  const bg = (0, _get2.default)('images.hero', skin);
  const {
    url,
    title,
    touch = false
  } = props;
  const backgroundImage = bg ? `url(${bg})` : '';
  const ctaClass = touch ? 'ctaTouch' : 'ctaNoTouch';
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.hero,
    style: {
      backgroundImage
    }
  }, /*#__PURE__*/_react.default.createElement(_link.default, {
    href: url,
    className: _style.default[ctaClass]
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.label,
    style: {
      color: (0, _getOr2.default)('#00b0ff', 'common.primary', skin)
    }
  }, title, /*#__PURE__*/_react.default.createElement("span", {
    className: _style.default.bar,
    style: {
      backgroundColor: (0, _getOr2.default)('#00b0ff', 'common.primary', skin)
    }
  }))));
}
Hero.contextTypes = {
  skin: _provider.default.childContextTypes.skin
};
Hero.propTypes = process.env.NODE_ENV !== "production" ? {
  touch: _propTypes.default.bool,
  url: _propTypes.default.oneOfType([_proptypes.SrcPropType, _propTypes.default.string]).isRequired,
  title: _propTypes.default.string.isRequired
} : {};
var _default = exports.default = Hero;
//# sourceMappingURL=index.js.map