aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/ExternalLink.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/components/ExternalLink.js b/src/components/ExternalLink.js
index 82c87300..71e09dd9 100644
--- a/src/components/ExternalLink.js
+++ b/src/components/ExternalLink.js
@@ -3,9 +3,14 @@ import React from 'react';
import ExternalLinkIcon from '@theme/Icon/ExternalLink';
export default function ExternalLink({children, href}) {
+ if(href) {
+ return (
+ <a href={href} rel={"noopener noreferrer"} target={"_blank"}>
+ {children} <ExternalLinkIcon />
+ </a>
+ );
+ }
return (
- <a href={href} rel={"noopener noreferrer"} target={"_blank"}>
- {children} <ExternalLinkIcon />
- </a>
+ <>{children}</>
);
} \ No newline at end of file