From 58c2d87248742a0d590c4cf9d600bd0175e5cf62 Mon Sep 17 00:00:00 2001 From: Raj Date: Wed, 17 Jan 2024 00:53:03 +0530 Subject: [PATCH 1/3] Done the following changes Signed-off-by: Raj --- components/Pagination/Pagination.tsx | 51 ++++++++++++++++----------- pages/[category]/[...subcategory].tsx | 2 +- 2 files changed, 31 insertions(+), 22 deletions(-) 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..33457ed59 100644 --- a/pages/[category]/[...subcategory].tsx +++ b/pages/[category]/[...subcategory].tsx @@ -101,7 +101,7 @@ 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} -
+ {/*
*/} Date: Wed, 17 Jan 2024 00:56:14 +0530 Subject: [PATCH 2/3] Minor changes in subcategory page Signed-off-by: Raj --- pages/[category]/[...subcategory].tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/[category]/[...subcategory].tsx b/pages/[category]/[...subcategory].tsx index 33457ed59..1d41608de 100644 --- a/pages/[category]/[...subcategory].tsx +++ b/pages/[category]/[...subcategory].tsx @@ -101,7 +101,6 @@ 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} - {/*
*/} Date: Sun, 21 Jan 2024 00:29:02 +0530 Subject: [PATCH 3/3] Fixed Errors --- pages/[category]/[...subcategory].tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pages/[category]/[...subcategory].tsx b/pages/[category]/[...subcategory].tsx index 1d41608de..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 ( <> @@ -102,6 +103,14 @@ const SubCategory: NextPage = ({ subcategory }) => { > {content} +
+ = async ( } } -export default SubCategory +export default SubCategory \ No newline at end of file