UNPKG

@catho/quantum

Version:
53 lines (52 loc) 1.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _propTypes = _interopRequireDefault(require("prop-types")); var _styledComponents = _interopRequireDefault(require("styled-components")); var _SocialIcons = require("./SocialIcons"); var _jsxRuntime = require("react/jsx-runtime"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } var SocialWrapper = _styledComponents["default"].a.withConfig({ displayName: "SocialType__SocialWrapper", componentId: "sc-rgcx9k-0" })(["display:inline-flex;"]); var SocialType = function SocialType(_ref) { var type = _ref.type, url = _ref.url, _ref$size = _ref.size, size = _ref$size === void 0 ? '48' : _ref$size, title = _ref.title, _ref$withBox = _ref.withBox, withBox = _ref$withBox === void 0 ? true : _ref$withBox; var socialTypes = { twitter: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SocialIcons.SocialTwitterIcon, { size: size, title: title, withBox: withBox }), youtube: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SocialIcons.SocialYoutubeIcon, { size: size, title: title, withBox: withBox }), facebook: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SocialIcons.SocialFacebookIcon, { size: size, title: title, withBox: withBox }) }; return /*#__PURE__*/(0, _jsxRuntime.jsx)(SocialWrapper, { href: url, children: socialTypes[type] }); }; SocialType.propTypes = { type: _propTypes["default"].oneOf(['twitter', 'youtube', 'facebook']).isRequired, url: _propTypes["default"].string.isRequired, size: _propTypes["default"].string, title: _propTypes["default"].string.isRequired, withBox: _propTypes["default"].bool }; var _default = exports["default"] = SocialType;