diff --git a/www/packages/docs-ui/src/components/MainNav/index.tsx b/www/packages/docs-ui/src/components/MainNav/index.tsx index 5e62cdf844..eaff03740c 100644 --- a/www/packages/docs-ui/src/components/MainNav/index.tsx +++ b/www/packages/docs-ui/src/components/MainNav/index.tsx @@ -4,14 +4,16 @@ import clsx from "clsx" import React from "react" import { MainNavigationDropdown } from "./NavigationDropdown" import { MainNavBreadcrumbs } from "./Breadcrumb" -import { SearchModalOpener, useMainNav } from "../.." +import { Button, SearchModalOpener, useMainNav, useSidebar } from "../.." import { MainNavColorMode } from "./ColorMode" import Link from "next/link" import { MainNavDivider } from "./Divider" import { MainNavSidebarOpener } from "./SidebarOpener" +import { SidebarLeftIcon } from "../Icons/SidebarLeft" export const MainNav = () => { const { reportIssueLink } = useMainNav() + const { setMobileSidebarOpen } = useSidebar() return (
{ )} >
+ diff --git a/www/packages/docs-ui/src/components/Pagination/Card/index.tsx b/www/packages/docs-ui/src/components/Pagination/Card/index.tsx new file mode 100644 index 0000000000..045316e944 --- /dev/null +++ b/www/packages/docs-ui/src/components/Pagination/Card/index.tsx @@ -0,0 +1,57 @@ +import { TriangleLeftMini, TriangleRightMini } from "@medusajs/icons" +import clsx from "clsx" +import Link from "next/link" +import React from "react" + +type PaginationCardProps = { + type: "previous" | "next" + title: string + parentTitle?: string + link: string + className?: string +} + +export const PaginationCard = ({ + type, + title, + parentTitle, + link, + className, +}: PaginationCardProps) => { + return ( +
+ + {type === "previous" && ( + + )} +
+ {parentTitle && ( + + {parentTitle} + + )} + + {title} + +
+ {type === "next" && ( + + )} +
+ ) +} diff --git a/www/packages/docs-ui/src/components/Pagination/index.tsx b/www/packages/docs-ui/src/components/Pagination/index.tsx index c8338619e4..3df35d5d43 100644 --- a/www/packages/docs-ui/src/components/Pagination/index.tsx +++ b/www/packages/docs-ui/src/components/Pagination/index.tsx @@ -2,9 +2,8 @@ import React from "react" import { usePagination } from "../../providers" -import { Card } from "../Card" -import { ChevronLeft, ChevronRight } from "@medusajs/icons" import clsx from "clsx" +import { PaginationCard } from "./Card" export const Pagination = () => { const { previousPage, nextPage } = usePagination() @@ -13,27 +12,23 @@ export const Pagination = () => {
{previousPage && ( - } - showLinkIcon={false} - href={previousPage.link} - className={clsx("ml-0 mr-auto items-center", "w-full sm:max-w-[45%]")} + parentTitle={previousPage.parentTitle} + link={previousPage.link} /> )} {nextPage && ( - } - showLinkIcon={false} - href={nextPage.link} - className={clsx("mr-0 ml-auto items-center", "w-full sm:max-w-[45%]")} + parentTitle={nextPage.parentTitle} + link={nextPage.link} /> )}