diff --git a/next/components/atoms/Link.js b/next/components/atoms/Link.js index 085d42df..32385fd9 100644 --- a/next/components/atoms/Link.js +++ b/next/components/atoms/Link.js @@ -12,6 +12,38 @@ export default function Link({ }) { const { locale } = useRouter(); + const isExternalLink = (() => { + try { + const linkUrl = new URL(href, window.location.origin); + return linkUrl.origin !== window.location.origin; + } catch (error) { + return false; + } + })(); + + if (isExternalLink) { + return ( + + {children} + + ); + } + return ( ); } - diff --git a/next/components/molecules/Menu.js b/next/components/molecules/Menu.js index cd3bc4b0..f3bb9c73 100644 --- a/next/components/molecules/Menu.js +++ b/next/components/molecules/Menu.js @@ -1000,7 +1000,6 @@ export default function MenuNav({ simpleTemplate = false, userTemplate = false } let links; if (locale === "pt") { - links = { [t('data')]: `/search`, [t('solutions')]: [ @@ -1036,9 +1035,7 @@ export default function MenuNav({ simpleTemplate = false, userTemplate = false } [t('contact')]: "/contact", Button: [] } - } else if (locale === "en") { - links = { [t('data')]: `/search`, [t('solutions')]: [ @@ -1062,9 +1059,7 @@ export default function MenuNav({ simpleTemplate = false, userTemplate = false } [t('contact')]: "/contact", Button: [] } - } else if (locale === "es") { - links = { [t('data')]: `/search`, [t('solutions')]: [ @@ -1088,7 +1083,6 @@ export default function MenuNav({ simpleTemplate = false, userTemplate = false } [t('contact')]: "/contact", Button: [] } - } useEffect(() => {