Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 40 additions & 12 deletions src/components/DocsNav.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { useRouter } from "next/router"
import { useTranslation } from "next-i18next"
import { FaChevronLeft, FaChevronRight } from "react-icons/fa"
import {
Box,
Flex,
FlexProps,
Icon,
LinkBox,
LinkOverlay,
Spacer,
Expand All @@ -12,7 +14,6 @@ import {
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"

Expand All @@ -26,9 +27,9 @@ const TextDiv = ({ children, ...props }: FlexProps) => (
<Flex
direction="column"
justify="space-between"
maxW="166px"
w="100%"
h="100%"
wordwrap="break-word"
wordWrap="break-word"
p={4}
lineHeight={4}
{...props}
Expand Down Expand Up @@ -63,26 +64,53 @@ const CardLink = ({ docData, isPrev, contentNotTranslated }: CardLinkProps) => {
h="82px"
bg="background.base"
border="1px"
borderColor="border"
borderRadius={1}
borderColor="primary.base"
borderRadius={4}
justify={isPrev ? "flex-start" : "flex-end"}
_hover={{
borderColor: "primary.hover",
"& svg": {
fill: "primary.hover",
},
".btn-txt": {
color: "primary.hover",
},
}}
>
<Box textDecoration="none" p={4} h="100%" order={isPrev ? 0 : 1}>
<Emoji
text={isPrev ? ":point_left:" : ":point_right:"}
fontSize="5xl"
transform={contentNotTranslated ? undefined : flipForRtl}
/>
<Box
textDecoration="none"
p={4}
order={isPrev ? 0 : 1}
transform={contentNotTranslated ? undefined : flipForRtl}
>
{isPrev ? (
<Icon
fill="primary.base"
fontSize="xl"
as={FaChevronLeft}
name="chevron left"
/>
) : (
<Icon
fill="primary.base"
fontSize="xl"
as={FaChevronRight}
name="chevron right"
/>
)}
</Box>
<TextDiv {...xPadding} {...(!isPrev && { textAlign: "end" })}>
<Text textTransform="uppercase" m="0">
<Text m="0" color="primary.base" fontSize="lg" className="btn-txt">
{t(isPrev ? "previous" : "next")}
</Text>
<LinkOverlay
as={BaseLink}
href={docData.href}
textAlign={isPrev ? "start" : "end"}
rel={isPrev ? "prev" : "next"}
fontSize="sm"
textDecoration="none"
_hover={{ textDecoration: "none" }}
onClick={() => {
trackCustomEvent({
eventCategory: "next/previous article DocsNav",
Expand Down