Repository URL to install this package:
|
Version:
3.10.6 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _react = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _Icon = _interopRequireDefault(require("../../visuals/Icon"));
var _DoodleLogo = _interopRequireDefault(require("../../visuals/DoodleLogo"));
var _Link = _interopRequireDefault(require("../../controls/Link/Link"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var FacebookIcon = function FacebookIcon(props) {
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
d: "M13.49 21.256v-8.783h2.95l.44-3.424h-3.39V6.864c0-.991.276-1.667 1.697-1.667H17V2.135A24.232 24.232 0 0 0 14.359 2c-2.614 0-4.403 1.595-4.403 4.525v2.524H7v3.424h2.956v8.783h3.535z",
fill: "currentColor"
}));
};
FacebookIcon.defaultProps = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
};
var TwitterIcon = function TwitterIcon(props) {
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
d: "M23.455 4.26a10.451 10.451 0 0 1-2.413 2.504c.02.143.031.357.031.642 0 1.629-.305 3.237-.916 4.825a15.53 15.53 0 0 1-2.58 4.383c-1.11 1.333-2.556 2.412-4.338 3.237-1.781.825-3.73 1.237-5.848 1.237-2.627 0-5.09-.723-7.391-2.168.733.06 1.12.091 1.16.091 2.2 0 4.185-.692 5.956-2.077a4.687 4.687 0 0 1-2.795-.962 4.682 4.682 0 0 1-1.695-2.397 4.1 4.1 0 0 0 .917.092 4.44 4.44 0 0 0 1.282-.184 4.766 4.766 0 0 1-2.779-1.634c-.733-.865-1.1-1.878-1.1-3.038v-.062c.713.367 1.436.56 2.17.58C1.69 8.353.976 7.02.976 5.33c0-.835.214-1.65.642-2.443a14.053 14.053 0 0 0 4.413 3.573 12.96 12.96 0 0 0 5.512 1.466 6.404 6.404 0 0 1-.122-1.1c0-1.323.468-2.458 1.405-3.405.937-.947 2.067-1.42 3.39-1.42 1.385 0 2.565.52 3.543 1.558 1.018-.204 2.026-.601 3.023-1.192-.346 1.181-1.038 2.077-2.076 2.688a10.432 10.432 0 0 0 2.748-.794z",
fill: "currentColor"
}));
};
TwitterIcon.defaultProps = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
};
var Footer =
/*#__PURE__*/
function (_Component) {
_inherits(Footer, _Component);
function Footer() {
_classCallCheck(this, Footer);
return _possibleConstructorReturn(this, _getPrototypeOf(Footer).apply(this, arguments));
}
_createClass(Footer, [{
key: "render",
value: function render() {
var _this$props = this.props,
children = _this$props.children,
className = _this$props.className,
hideSocialLinks = _this$props.hideSocialLinks,
links = _this$props.links,
right = _this$props.right;
var componentClassName = "Footer".concat(className ? " ".concat(className) : '');
return _react["default"].createElement("footer", {
className: componentClassName
}, children, _react["default"].createElement("aside", {
className: "Footer-bar"
}, _react["default"].createElement("nav", {
className: "Footer-section Footer-section--left"
}, links.map(function (_ref) {
var label = _ref.label,
to = _ref.to,
key = _ref.key;
return _react["default"].createElement(_Link["default"], {
key: key || label,
to: to,
variant: "white"
}, label);
})), _react["default"].createElement("section", {
className: "Footer-section Footer-section--center",
"aria-hidden": "true"
}, _react["default"].createElement(_DoodleLogo["default"], null)), _react["default"].createElement("section", {
className: "Footer-section Footer-section--right"
}, right, !hideSocialLinks && _react["default"].createElement("div", {
className: "Footer-links"
}, _react["default"].createElement(_Link["default"], {
to: "https://facebook.com/DoodleAG",
title: "Facebook",
variant: "white"
}, _react["default"].createElement(_Icon["default"], {
icon: FacebookIcon
})), _react["default"].createElement(_Link["default"], {
to: "https://twitter.com/doodletweet",
title: "Twitter",
variant: "white"
}, _react["default"].createElement(_Icon["default"], {
icon: TwitterIcon
}))))));
}
}]);
return Footer;
}(_react.Component);
_defineProperty(Footer, "propTypes", {
/** the content of the footer */
children: _propTypes["default"].node,
className: _propTypes["default"].string,
links: _propTypes["default"].array,
hideSocialLinks: _propTypes["default"].bool,
right: _propTypes["default"].node
});
_defineProperty(Footer, "defaultProps", {
children: null,
className: null,
hideSocialLinks: false,
links: [],
right: null
});
var _default = Footer;
exports["default"] = _default;