mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 09:30:31 +03:00
Installed react-external-links
This commit is contained in:
parent
34f194c714
commit
2fe923678e
3 changed files with 8 additions and 18 deletions
5
package-lock.json
generated
5
package-lock.json
generated
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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 (
|
||||
<a target="_blank" rel="noopener noreferrer" href={href} {...rest}>
|
||||
{children || href}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
ExternalLink.propTypes = propTypes;
|
||||
export default ExternalLink;
|
||||
|
|
Loading…
Reference in a new issue