diff --git a/src/components/DocsNav.tsx b/src/components/DocsNav.tsx index 62ee9b5ad2f..6465116d450 100644 --- a/src/components/DocsNav.tsx +++ b/src/components/DocsNav.tsx @@ -1,41 +1,31 @@ import { useRouter } from "next/router" import { useTranslation } from "next-i18next" -import { - Box, - Flex, - FlexProps, - LinkBox, - LinkOverlay, - Spacer, -} from "@chakra-ui/react" import { TranslationKey } from "@/lib/types" import type { DeveloperDocsLink } from "@/lib/interfaces" import Emoji from "@/components/Emoji" -import { BaseLink } from "@/components/Link" -import Text from "@/components/OldText" import { cn } from "@/lib/utils/cn" import { trackCustomEvent } from "@/lib/utils/matomo" import docLinks from "@/data/developer-docs-links.yaml" +import { Stack } from "./ui/flex" +import { LinkBox, LinkOverlay } from "./ui/link-box" + import { useRtlFlip } from "@/hooks/useRtlFlip" -const TextDiv = ({ children, ...props }: FlexProps) => ( - ( + {children} - + ) type DocsArrayProps = { @@ -53,22 +43,15 @@ const CardLink = ({ docData, isPrev, contentNotTranslated }: CardLinkProps) => { const { t } = useTranslation("page-developers-docs") const { isRtl } = useRtlFlip() - const xPadding = isPrev ? { ps: "0" } : { pe: 0 } - return ( - +
{ !contentNotTranslated && isRtl ? "-scale-x-100" : "" )} /> - - - - {t(isPrev ? "previous" : "next")} - +
+ +

{t(isPrev ? "previous" : "next")}

{ trackCustomEvent({ eventCategory: "next/previous article DocsNav", @@ -93,6 +71,8 @@ const CardLink = ({ docData, isPrev, contentNotTranslated }: CardLinkProps) => { eventName: isPrev ? "previous" : "next", }) }} + className={cn("underline", isPrev ? "text-start" : "text-end")} + rel={isPrev ? "prev" : "next"} > {t(docData.id)} @@ -145,19 +125,13 @@ const DocsNav = ({ contentNotTranslated }: DocsNavProps) => { currentIndex + 1 < docsArray.length ? docsArray[currentIndex + 1] : null return ( - {previousDoc ? ( { isPrev /> ) : ( - +
)} {nextDoc ? ( { contentNotTranslated={contentNotTranslated} /> ) : ( - +
)} -
+ ) }