diff --git a/.changeset/six-cooks-brush.md b/.changeset/six-cooks-brush.md new file mode 100644 index 000000000..6cf1948d6 --- /dev/null +++ b/.changeset/six-cooks-brush.md @@ -0,0 +1,5 @@ +--- +"@bigcommerce/catalyst-core": patch +--- + +Add `Pagination` component. diff --git a/core/app/[locale]/(default)/(faceted)/brand/[slug]/page.tsx b/core/app/[locale]/(default)/(faceted)/brand/[slug]/page.tsx index 148ddca6f..7053614f3 100644 --- a/core/app/[locale]/(default)/(faceted)/brand/[slug]/page.tsx +++ b/core/app/[locale]/(default)/(faceted)/brand/[slug]/page.tsx @@ -4,11 +4,11 @@ import { NextIntlClientProvider } from 'next-intl'; import { getMessages, getTranslations, unstable_setRequestLocale } from 'next-intl/server'; import { ProductCard } from '~/components/product-card'; +import { Pagination } from '~/components/ui/pagination'; import { LocaleType } from '~/i18n'; import { FacetedSearch } from '../../_components/faceted-search'; import { MobileSideNav } from '../../_components/mobile-side-nav'; -import { Pagination } from '../../_components/pagination'; import { SortBy } from '../../_components/sort-by'; import { fetchFacetedSearch } from '../../fetch-faceted-search'; diff --git a/core/app/[locale]/(default)/(faceted)/category/[slug]/page.tsx b/core/app/[locale]/(default)/(faceted)/category/[slug]/page.tsx index bf43da077..69b47e8e2 100644 --- a/core/app/[locale]/(default)/(faceted)/category/[slug]/page.tsx +++ b/core/app/[locale]/(default)/(faceted)/category/[slug]/page.tsx @@ -5,11 +5,11 @@ import { getMessages, getTranslations, unstable_setRequestLocale } from 'next-in import { Breadcrumbs } from '~/components/breadcrumbs'; import { ProductCard } from '~/components/product-card'; +import { Pagination } from '~/components/ui/pagination'; import { LocaleType } from '~/i18n'; import { FacetedSearch } from '../../_components/faceted-search'; import { MobileSideNav } from '../../_components/mobile-side-nav'; -import { Pagination } from '../../_components/pagination'; import { SortBy } from '../../_components/sort-by'; import { fetchFacetedSearch } from '../../fetch-faceted-search'; diff --git a/core/app/[locale]/(default)/(faceted)/search/page.tsx b/core/app/[locale]/(default)/(faceted)/search/page.tsx index 2d600db56..1e44471e9 100644 --- a/core/app/[locale]/(default)/(faceted)/search/page.tsx +++ b/core/app/[locale]/(default)/(faceted)/search/page.tsx @@ -3,11 +3,11 @@ import { getMessages, getTranslations } from 'next-intl/server'; import { ProductCard } from '~/components/product-card'; import { SearchForm } from '~/components/search-form'; +import { Pagination } from '~/components/ui/pagination'; import { LocaleType } from '~/i18n'; import { FacetedSearch } from '../_components/faceted-search'; import { MobileSideNav } from '../_components/mobile-side-nav'; -import { Pagination } from '../_components/pagination'; import { SortBy } from '../_components/sort-by'; import { fetchFacetedSearch } from '../fetch-faceted-search'; diff --git a/core/app/[locale]/(default)/account/[tab]/_components/addresses-content/index.tsx b/core/app/[locale]/(default)/account/[tab]/_components/addresses-content/index.tsx index e9fd2d712..4d97c9de2 100644 --- a/core/app/[locale]/(default)/account/[tab]/_components/addresses-content/index.tsx +++ b/core/app/[locale]/(default)/account/[tab]/_components/addresses-content/index.tsx @@ -1,8 +1,8 @@ import { getLocale, getTranslations } from 'next-intl/server'; import { getCustomerAddresses } from '~/client/queries/get-customer-addresses'; +import { Pagination } from '~/components/ui/pagination'; -import { Pagination } from '../../../../(faceted)/_components/pagination'; import { TabHeading } from '../tab-heading'; import { AddressBook } from './address-book'; @@ -60,7 +60,7 @@ export const AddressesContent = async ({ { endCursor: string | null; hasPreviousPage: boolean; hasNextPage: boolean; @@ -16,15 +14,17 @@ interface PaginationProps { nextLabel: string; } -export const Pagination = ({ +const Pagination = ({ className, + children, endCursor, hasPreviousPage, hasNextPage, startCursor, prevLabel, nextLabel, -}: PaginationProps) => { + ...props +}: Props) => { const pathname = usePathname(); const searchParams = useSearchParams(); @@ -45,7 +45,11 @@ export const Pagination = ({ } return ( -