'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Footer = undefined;

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _lodash = require('lodash');

var _lodash2 = _interopRequireDefault(_lodash);

var _reactRouter = require('react-router');

var _index = require('../constants/index');

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

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

if (process.env.BROWSER) {}

var Footer = function (_Component) {
  _inherits(Footer, _Component);

  function Footer(props) {
    _classCallCheck(this, Footer);

    return _possibleConstructorReturn(this, (Footer.__proto__ || Object.getPrototypeOf(Footer)).call(this, props));
  }

  _createClass(Footer, [{
    key: 'render',
    value: function render() {
      var sectionList = this.props.sectionList;

      var sortedList = _lodash2.default.sortBy(sectionList.sections, function (o) {
        return o.sortOrder;
      });

      return _react2.default.createElement(
        'footer',
        { className: 'gradient' },
        _react2.default.createElement(
          'div',
          { className: 'container footer' },
          _react2.default.createElement(
            'div',
            { className: 'ui left aligned grid' },
            _react2.default.createElement(
              'div',
              { className: 'five column row', style: { color: '#FFF' } },
              _lodash2.default.map(sortedList, function (s) {
                return _react2.default.createElement(
                  'div',
                  { className: 'column', key: 'nav-' + s.name },
                  _react2.default.createElement(
                    'div',
                    { className: 'ui list' },
                    _react2.default.createElement(
                      _reactRouter.Link,
                      { to: '/section/' + s.name, className: 'item section', style: { color: '#FFF' } },
                      s.title
                    ),
                    _lodash2.default.map(s.categories, function (c) {
                      return _react2.default.createElement(
                        _reactRouter.Link,
                        { to: '/category/' + c.name, className: 'item', style: { color: '#FFF' }, key: 'nav-' + s.name + '-' + c.name },
                        c.title
                      );
                    })
                  )
                );
              })
            )
          ),
          _react2.default.createElement(
            'div',
            { className: 'ui center aligned grid' },
            _react2.default.createElement(
              'div',
              { className: 'sixteen wide column' },
              _react2.default.createElement('div', { className: 'divider-line' }),
              _react2.default.createElement(
                'div',
                { className: 'subscribe', style: { fontSize: '17px', letterSpacing: '1.1px', color: 'rgba(0, 0, 0, 0.5)' } },
                _react2.default.createElement(
                  'a',
                  { href: _index.SOCIAL_LINK.SUBSCRIBE },
                  '訂閱鏡週刊'
                ),
                ' - ',
                _react2.default.createElement(
                  'a',
                  { href: 'https://www.mirrormedia.mg/story/ad1018001/index.html?utm_source=mm&utm_medium=footer&utm_campaign=salesteam' },
                  '廣告合作'
                )
              ),
              _react2.default.createElement('div', { className: 'divider-line-pc' }),
              _react2.default.createElement(
                'div',
                { className: 'ui share' },
                _react2.default.createElement(
                  'a',
                  { className: 'item', href: _index.SOCIAL_LINK.LINE },
                  _react2.default.createElement('img', { src: '/asset/icon/line@2x.png', className: 'footer-icon line' })
                ),
                _react2.default.createElement(
                  'a',
                  { className: 'item', href: _index.SOCIAL_LINK.WEIBO },
                  _react2.default.createElement('img', { src: '/asset/icon/weibo@2x.png', className: 'footer-icon weibo' })
                ),
                _react2.default.createElement(
                  'a',
                  { className: 'item', href: _index.SOCIAL_LINK.FACEBOOK },
                  _react2.default.createElement('img', { src: '/asset/icon/facebook@2x.png', className: 'footer-icon facebook' })
                ),
                _react2.default.createElement(
                  'a',
                  { className: 'item', href: _index.SOCIAL_LINK.INSTAGRAM },
                  _react2.default.createElement('img', { src: '/asset/icon/instagram@2x.png', className: 'footer-icon instagram' })
                ),
                _react2.default.createElement(
                  'a',
                  { className: 'item', href: _index.SOCIAL_LINK.FEED },
                  _react2.default.createElement('img', { src: '/asset/icon/feed@2x.png', className: 'footer-icon feed' })
                ),
                _react2.default.createElement(
                  'a',
                  { className: 'item', href: _index.SOCIAL_LINK.EMAIL },
                  _react2.default.createElement('img', { src: '/asset/icon/mail@2x.png', className: 'footer-icon mail' })
                )
              )
            )
          )
        )
      );
    }
  }]);

  return Footer;
}(_react.Component);

exports.default = Footer;
exports.Footer = Footer;