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; }; }();

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; }

import React from 'react';
import { parse } from 'url';
import RelatedAppsBanner from '../related-apps-banner';
import { Row } from 'jsxstyle';
import * as fonts from '../../mixins/fonts';
import * as sizes from '../../mixins/sizes';

var CategoryQueryParams = function (_React$Component) {
    _inherits(CategoryQueryParams, _React$Component);

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

        var _this = _possibleConstructorReturn(this, (CategoryQueryParams.__proto__ || Object.getPrototypeOf(CategoryQueryParams)).call(this, props));

        var _parse = parse(window.location.href, true),
            query = _parse.query;

        var categories = query['app-category'] || [];
        if (typeof categories === 'string') {
            categories = [categories];
        }
        _this.state = { categories: categories };
        return _this;
    }

    _createClass(CategoryQueryParams, [{
        key: 'render',
        value: function render() {
            return React.createElement(Row, { props: { 'data-component': 'category-query-params' }, fontFamily: fonts.sansSerif, fontSize: sizes.baseFontSize, lineHeight: 1.5, maxWidth: 960, flex: '1 1', color: '#000', position: 'relative' }, React.createElement(RelatedAppsBanner, { categories: this.state.categories, domain: 'omnichan.org', shadowType: 'subtle' }));
        }
    }]);

    return CategoryQueryParams;
}(React.Component);
//# sourceMappingURL=category-query-params.js.map


export { CategoryQueryParams as default };