Installed react-external-links

This commit is contained in:
Alejandro Celaya 2019-08-29 17:47:18 +02:00
parent 34f194c714
commit 2fe923678e
3 changed files with 8 additions and 18 deletions

5
package-lock.json generated
View file

@ -14028,6 +14028,11 @@
"integrity": "sha1-iIlXuITUslsIOoKtVQ96rZZYU5Q=", "integrity": "sha1-iIlXuITUslsIOoKtVQ96rZZYU5Q=",
"dev": true "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": { "react-is": {
"version": "16.7.0", "version": "16.7.0",
"resolved": "https://registry.yarnpkg.com/react-is/-/react-is-16.7.0.tgz", "resolved": "https://registry.yarnpkg.com/react-is/-/react-is-16.7.0.tgz",

View file

@ -49,6 +49,7 @@
"react-copy-to-clipboard": "^5.0.1", "react-copy-to-clipboard": "^5.0.1",
"react-datepicker": "~1.5.0", "react-datepicker": "~1.5.0",
"react-dom": "^16.8.0", "react-dom": "^16.8.0",
"react-external-link": "^1.0.0",
"react-leaflet": "^2.2.1", "react-leaflet": "^2.2.1",
"react-moment": "^0.7.6", "react-moment": "^0.7.6",
"react-redux": "^5.0.7", "react-redux": "^5.0.7",

View file

@ -1,19 +1,3 @@
import React from 'react'; import { ExternalLink } from 'react-external-link';
import PropTypes from 'prop-types';
const propTypes = { export default ExternalLink;
href: PropTypes.string.isRequired,
children: PropTypes.node,
};
export default function ExternalLink(props) {
const { href, children, ...rest } = props;
return (
<a target="_blank" rel="noopener noreferrer" href={href} {...rest}>
{children || href}
</a>
);
}
ExternalLink.propTypes = propTypes;