diff --git a/src/components/ui/banner.js b/src/components/ui/banner.js index 244620b..1da31cd 100644 --- a/src/components/ui/banner.js +++ b/src/components/ui/banner.js @@ -1,6 +1,11 @@ +import { Link } from "gatsby" import * as React from "react" const Banner = ({ description, shortDescription, emoji, announcementLink }) => { + const isExternalLink = + announcementLink.indexOf("http://") === 0 || + announcementLink.indexOf("https://") === 0 + return (
@@ -9,18 +14,37 @@ const Banner = ({ description, shortDescription, emoji, announcementLink }) => { {emoji && {emoji}}

{announcementLink ? ( - <> - - {shortDescription} - - - {description} - - + isExternalLink ? ( + <> + + {shortDescription} + + + {description} + + + ) : ( + <> + + {shortDescription} + + + {description} + + + ) ) : ( <> {shortDescription}