UNPKG

@massds/mayflower-react

Version:

React versions of Mayflower design system UI components

94 lines 3.85 kB
/** * Footer module. * @module @massds/mayflower-react/Footer * @requires module:@massds/mayflower-assets/scss/03-organisms/footer */ import React from "react"; import PropTypes from "prop-types"; import ButtonFixedFeedback from "../ButtonFixedFeedback/index.mjs"; const today = new Date(); const Footer = _ref => { let footerLinks = _ref.footerLinks, _ref$footerText = _ref.footerText, _ref$footerText$copyr = _ref$footerText.copyright, copyright = _ref$footerText$copyr === void 0 ? today.getFullYear() : _ref$footerText$copyr, _ref$footerText$priva = _ref$footerText.privacyPolicy, privacyPolicy = _ref$footerText$priva === void 0 ? { text: 'Mass.gov Privacy Policy', url: 'https://www.mass.gov/privacypolicy' } : _ref$footerText$priva, _ref$footerLogo = _ref.footerLogo, _ref$footerLogo$domai = _ref$footerLogo.domain, domain = _ref$footerLogo$domai === void 0 ? '/' : _ref$footerLogo$domai, _ref$footerLogo$title = _ref$footerLogo.title, title = _ref$footerLogo$title === void 0 ? 'Mass.gov home page' : _ref$footerLogo$title, src = _ref$footerLogo.src, floatingAction = _ref.floatingAction; return /*#__PURE__*/React.createElement("footer", { "data-nosnippet": "true", className: "ma__footer-new", id: "footer" }, /*#__PURE__*/React.createElement("div", { className: "ma__footer-new__container" }, /*#__PURE__*/React.createElement("div", { className: "ma__footer-new__logo" }, /*#__PURE__*/React.createElement("a", { href: domain, title: title }, /*#__PURE__*/React.createElement("img", { src: src, alt: "Massachusetts State Seal", width: "100", height: "100" }))), /*#__PURE__*/React.createElement("div", { className: "ma__footer-new__content" }, /*#__PURE__*/React.createElement("nav", { className: "ma__footer-new__navlinks", "aria-label": "site navigation" }, footerLinks.links.map((link, i) => /*#__PURE__*/React.createElement("div", { key: "footerLinksNav_" + i, "data-index": i }, /*#__PURE__*/React.createElement("a", { href: link.href }, link.text)))), /*#__PURE__*/React.createElement("div", { className: "ma__footer-new__copyright" }, /*#__PURE__*/React.createElement("div", { className: "ma__footer-new__copyright--bold" }, "\xA9", " " + copyright + " Commonwealth of Massachusetts."), /*#__PURE__*/React.createElement("span", null, "Mass.gov\xAE is a registered service mark of the Commonwealth of Massachusetts. "), /*#__PURE__*/React.createElement("a", { href: privacyPolicy.url }, privacyPolicy.text)))), floatingAction && /*#__PURE__*/React.createElement(ButtonFixedFeedback, null)); }; Footer.propTypes = process.env.NODE_ENV !== "production" ? { /** Footer links */ footerLinks: PropTypes.shape({ links: PropTypes.array }).isRequired, /** Whether to display or visually hiding footer nav headings */ // showNavHeading: PropTypes.bool, /** Adds footer logo. (Defaults to matching Mass.gov) <br /> * `src:` logo image source url <br /> * `domain:` The URL for the site root <br /> * `title:` The title of the logo link */ footerLogo: PropTypes.shape({ src: PropTypes.string.isRequired, domain: PropTypes.string, title: PropTypes.string }), /** Adds footer info section. (Defaults to matching Mass.gov) <br /> * `copyright:` Bolded copyright info starting with © <br /> * `description:` Descriptive info below copyright <br /> * `privacyPolicy:` A link to the privacy policy page of the site */ footerText: PropTypes.shape({ copyright: PropTypes.string, description: PropTypes.string, privacyPolicy: PropTypes.shape({ text: PropTypes.string, url: PropTypes.string }) }), /** Adds feedback button. */ floatingAction: PropTypes.bool } : {}; export default Footer;