Merged in feat/sw-3230-move-link-to-design-system (pull request #2618)

feat(SW-3230): Move Link to design-system

* Move Link to design-system

* Remove comments


Approved-by: Linus Flood
This commit is contained in:
Anton Gunnarsson
2025-08-12 12:35:20 +00:00
parent 4c9790b938
commit 8518d018f8
80 changed files with 139 additions and 164 deletions

View File

@@ -1,21 +0,0 @@
import { useMemo } from "react"
export const useCheckIfExternalLink = (url: string) => {
return useMemo(() => {
if (typeof window !== "undefined" && url?.length) {
try {
const hostName = window.location.hostname
const newURL = new URL(url)
const hostsMatch = hostName === newURL.hostname
const langRouteRegex = /^\/[a-zA-Z]{2}\//
return !hostsMatch || !langRouteRegex.test(newURL.pathname)
} catch {
// Don't care. Expecting internal url (#, /my-pages/overview, etc)
return false
}
}
return false
}, [url])
}