diff --git a/components/Pagination/Pagination.tsx b/components/Pagination/Pagination.tsx index 77b281b6f..0fb32cb62 100644 --- a/components/Pagination/Pagination.tsx +++ b/components/Pagination/Pagination.tsx @@ -1,43 +1,50 @@ -import React, { useEffect } from 'react'; -import { useTheme } from 'next-themes'; -import clsx from 'clsx'; +import React, { useEffect } from 'react' +import { useTheme } from 'next-themes' +import clsx from 'clsx' type PaginationProps = { - totalPages: number[] | null; - currentPage: number; - handlePageChange: (page: number) => void; -}; + toporbottom: boolean + totalPages: number[] | null + currentPage: number + handlePageChange: (page: number) => void +} export default function Pagination({ + toporbottom, totalPages, currentPage, handlePageChange, }: PaginationProps) { - const { resolvedTheme } = useTheme(); - const isDarkMode = resolvedTheme === 'dark'; - + const { resolvedTheme } = useTheme() + const isDarkMode = resolvedTheme === 'dark' const scrollToTop = () => { - window.scrollTo({ top: 0, behavior: 'smooth' }); - }; + window.scrollTo({ top: 0, behavior: 'smooth' }) + } const changePage = (page: number) => { - handlePageChange(page); - }; + handlePageChange(page) + } useEffect(() => { - scrollToTop(); - }, [currentPage]); + scrollToTop() + }, [currentPage]) return ( <> {totalPages && totalPages.length > 1 && (
-
+
)} - ); + ) } diff --git a/pages/[category]/[...subcategory].tsx b/pages/[category]/[...subcategory].tsx index 796541f9d..23be5529e 100644 --- a/pages/[category]/[...subcategory].tsx +++ b/pages/[category]/[...subcategory].tsx @@ -33,6 +33,7 @@ const SubCategory: NextPage = ({ subcategory }) => { } else { content = } + const toporbottom = true return ( <> @@ -101,8 +102,15 @@ const SubCategory: NextPage = ({ subcategory }) => { className="relative min-h-[calc(100%-68px)] w-full pt-[85px] pb-4 md:min-h-[calc(100%-76px)] md:px-10 md:pt-10" > {content} -
+
+ = async ( } } -export default SubCategory +export default SubCategory \ No newline at end of file