"use strict";

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

var _react = _interopRequireDefault(require("react"));

var _indexModule = _interopRequireDefault(require("./index.module.less"));

var _commonUtil = require("../../../../../utils/commonUtil");

var _components = require("../../../../../meta-comp/components");

var _common = require("../../../../../common");

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

var __extends = void 0 && (void 0).__extends || function () {
  var _extendStatics = function extendStatics(d, b) {
    _extendStatics = Object.setPrototypeOf || {
      __proto__: []
    } instanceof Array && function (d, b) {
      d.__proto__ = b;
    } || function (d, b) {
      for (var p in b) {
        if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
      }
    };

    return _extendStatics(d, b);
  };

  return function (d, b) {
    if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");

    _extendStatics(d, b);

    function __() {
      this.constructor = d;
    }

    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();

var SearchMobile =
/** @class */
function (_super) {
  __extends(SearchMobile, _super);

  function SearchMobile() {
    return _super !== null && _super.apply(this, arguments) || this;
  }

  SearchMobile.prototype.render = function () {
    var data = this.props.data;
    console.log('---data', data);
    var styleWrap = {};

    if (data.background.bgType === 'color') {
      styleWrap = {
        backgroundColor: data.background.color,
        opacity: data.background.opacity
      };
    } else {
      styleWrap = {
        backgroundImage: "url(".concat(data.background.image, ")"),
        backgroundPosition: 'center',
        backgroundRepeat: 'no-repeat'
      };
    }

    return /*#__PURE__*/_react["default"].createElement("div", {
      className: _indexModule["default"].searchWrap,
      style: styleWrap
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "right"
    }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
      color: "#2C2C2C",
      onClick: function onClick() {
        return (0, _commonUtil.navigateTo)('/search-page');
      },
      size: 24,
      type: "icon-search2"
    }), /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
      color: "#2C2C2C",
      onClick: function onClick() {
        return (0, _commonUtil.navigateTo)('/message-center');
      },
      size: 24,
      type: "icon-message"
    })), data.logo.open && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
      data: data.logo,
      style: {
        height: 20
      }
    }));
  };

  SearchMobile.defaultProps = {
    data: {}
  };
  return SearchMobile;
}(_react["default"].Component);

var _default = SearchMobile;
exports["default"] = _default;