UNPKG

@massds/mayflower-react

Version:

React versions of Mayflower design system UI components

44 lines (38 loc) 1.84 kB
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * GenTeaserEmail module. * @module @massds/mayflower-react/GenTeaserEmail * @requires module:@massds/mayflower-assets/scss/03-organisms/gen-teaser */ import React from "react"; import PropTypes from "prop-types"; import IconMail from "../Icon/IconMail.mjs"; import Email from "../Email/index.mjs"; /** * Email */ const GenTeaserEmail = props => { const email = props.email, details = props.details, rest = _objectWithoutPropertiesLoose(props, ["email", "details"]); const emailProps = { email: email, details: details }; return /*#__PURE__*/React.createElement("div", _extends({ className: "ma__gen-teaser__infoitem" }, rest), /*#__PURE__*/React.createElement("span", { className: "ma__gen-teaser__infoitem-icon" }, /*#__PURE__*/React.createElement(IconMail, { width: 15, height: 15 })), /*#__PURE__*/React.createElement(Email, emailProps)); }; GenTeaserEmail.propTypes = process.env.NODE_ENV !== "production" ? { /** The email address. */ email: PropTypes.string.isRequired, /** Details around contacting the provided email. */ details: PropTypes.oneOfType([PropTypes.string, PropTypes.object]) } : {}; export default GenTeaserEmail;