docs: redesign cards (#8671)

* docs: redesign cards

* fix build error
This commit is contained in:
Shahed Nasser
2024-08-20 15:48:17 +03:00
committed by GitHub
parent 48fe819d9e
commit b4d8e265e3
37 changed files with 493 additions and 476 deletions
+1
View File
@@ -4,6 +4,7 @@ export * from "./use-collapsible"
export * from "./use-collapsible-code-lines"
export * from "./use-copy"
export * from "./use-current-learning-path"
export * from "./use-is-external-link"
export * from "./use-is-browser"
export * from "./use-keyboard-shortcut"
export * from "./use-page-scroll-manager"
@@ -0,0 +1,19 @@
import { useMemo } from "react"
type UseIsExternalLinkProps = {
href?: string
}
export const useIsExternalLink = ({ href }: UseIsExternalLinkProps) => {
const isExternal = useMemo(() => {
return (
href &&
!href.startsWith("/") &&
!href.startsWith("https://docs.medusajs.com") &&
!href.startsWith("http://localhost:") &&
!href.startsWith("#")
)
}, [href])
return isExternal
}