UNPKG

react-spatial

Version:

Components to build React map apps.

63 lines (54 loc) 1.48 kB
import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; var propTypes = { /** * Link to open in a new window. */ href: PropTypes.string.isRequired, /** * Children content of the link. */ children: PropTypes.node.isRequired, /** * Title attribute. */ title: PropTypes.string, /** * CSS class. */ className: PropTypes.string, }; var defaultProps = { className: undefined, title: undefined, }; /** * This component displays a simple a HTML element which opens the link provided * in a blank window. */ var BlankLink = /*@__PURE__*/(function (PureComponent) { function BlankLink () { PureComponent.apply(this, arguments); } if ( PureComponent ) BlankLink.__proto__ = PureComponent; BlankLink.prototype = Object.create( PureComponent && PureComponent.prototype ); BlankLink.prototype.constructor = BlankLink; BlankLink.prototype.render = function render () { var ref = this.props; var href = ref.href; var children = ref.children; var title = ref.title; var className = ref.className; return ( React.createElement( 'a', { href: href, title: title, className: className, target: "_blank", rel: "noopener noreferrer", tabIndex: "0" }, children ) ); }; return BlankLink; }(PureComponent)); BlankLink.propTypes = propTypes; BlankLink.defaultProps = defaultProps; export default BlankLink; //# sourceMappingURL=BlankLink.js.map