diff --git a/v2/community/reusableMD/supported-tech-stacks-frontend.mdx b/v2/community/reusableMD/supported-tech-stacks-frontend.mdx index f24248fb6..cc28c1a25 100644 --- a/v2/community/reusableMD/supported-tech-stacks-frontend.mdx +++ b/v2/community/reusableMD/supported-tech-stacks-frontend.mdx @@ -1,3 +1,6 @@ + +import RecipeLink from "/src/components/RecipeLink"; +
:::important for mobile apps -For mobile apps, please see the "Using your own UI" section (see left nav bar) -::: \ No newline at end of file +For mobile apps, please see the **Using your own UI** section from the left nav bar +::: + +:::important for nextjs +For **NextJS** apps, please go to the **Integrations** section from the left nav bar. +- App Directory Instructions +- Pages Directory Instructions +::: diff --git a/v2/src/components/RecipeLink.tsx b/v2/src/components/RecipeLink.tsx new file mode 100644 index 000000000..4ef74c9c8 --- /dev/null +++ b/v2/src/components/RecipeLink.tsx @@ -0,0 +1,20 @@ +import React, { useMemo } from "react"; +import { useLocation } from "@docusaurus/router"; + +export default function RecipeLink({ + link, + children, +}: React.PropsWithChildren<{ link: string }>) { + const { pathname } = useLocation(); + + const fullLink = useMemo(() => { + const [, , recipePath] = pathname.split("/"); + + console.log(link); + + console.log(recipePath); + return `/docs/${recipePath}/${link}`; + }, [pathname, link]); + + return {children}; +}