Skip to content

Commit

Permalink
[New] Add prop to hide overlay of link icon
Browse files Browse the repository at this point in the history
  • Loading branch information
LaChope authored and blcham committed Oct 16, 2022
1 parent e87b6f6 commit 6f0aade
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/components/LinkIcon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ExternalLink from "../styles/icons/ExternalLink";
import IconOverlay from "./IconOverlay";

const LinkIcon = (props) => {
return (
return props.showOverlay ? (
<IconOverlay
tooltipContent={props.url["@id"] || props.url}
id="url-tooltip"
Expand All @@ -18,6 +18,14 @@ const LinkIcon = (props) => {
<ExternalLink className={props.iconClass} />
</a>
</IconOverlay>
) : (
<a
href={props.url["@id"] || props.url}
target="_blank"
className={props.iconClassContainer}
>
<ExternalLink className={props.iconClass} />
</a>
);
};

Expand All @@ -30,12 +38,14 @@ LinkIcon.propTypes = {
iconClass: PropTypes.string,
overlayPlacement: PropTypes.string,
absolutePosition: PropTypes.bool,
showOverlay: PropTypes.bool,
};

LinkIcon.defaultProps = {
iconClassContainer: "",
iconClass: "",
absolutePosition: true,
showOverlay: true,
};

export default LinkIcon;

0 comments on commit 6f0aade

Please sign in to comment.