diff --git a/package-lock.json b/package-lock.json index 9b5adeb2..3bbeeb1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14028,6 +14028,11 @@ "integrity": "sha1-iIlXuITUslsIOoKtVQ96rZZYU5Q=", "dev": true }, + "react-external-link": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/react-external-link/-/react-external-link-1.0.0.tgz", + "integrity": "sha512-KkEozBNo4OI+zdNgGX6ua5+w68wEu2RLdnMGF7KIod6+heDMLfK52Xeqtb0GBO/JvC+HTcj5Kdz8ol0oORYIPA==" + }, "react-is": { "version": "16.7.0", "resolved": "https://registry.yarnpkg.com/react-is/-/react-is-16.7.0.tgz", diff --git a/package.json b/package.json index ad113c9f..07e4033f 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "react-copy-to-clipboard": "^5.0.1", "react-datepicker": "~1.5.0", "react-dom": "^16.8.0", + "react-external-link": "^1.0.0", "react-leaflet": "^2.2.1", "react-moment": "^0.7.6", "react-redux": "^5.0.7", diff --git a/src/utils/ExternalLink.js b/src/utils/ExternalLink.js index 916809cd..e11ad7c4 100644 --- a/src/utils/ExternalLink.js +++ b/src/utils/ExternalLink.js @@ -1,19 +1,3 @@ -import React from 'react'; -import PropTypes from 'prop-types'; +import { ExternalLink } from 'react-external-link'; -const propTypes = { - href: PropTypes.string.isRequired, - children: PropTypes.node, -}; - -export default function ExternalLink(props) { - const { href, children, ...rest } = props; - - return ( - - {children || href} - - ); -} - -ExternalLink.propTypes = propTypes; +export default ExternalLink;