Commit 3ce24867 authored by Vũ Đình Nguyên's avatar Vũ Đình Nguyên

Merge branch 'feat/home_page' into 'develop'

Feat/home page

See merge request !5
parents fc8def4e b9ca187b
This diff is collapsed.
......@@ -30,7 +30,7 @@ export default function Page() {
<CardNews key={news.id} news={news} />
))}
<div className="w-full flex justify-center mt-4">
<div className='w-full flex justify-center mt-4'>
<Pagination
pageCount={Number(allData?.responseData.totalPages ?? 1)}
page={Number(allData?.responseData.currentPage ?? page)}
......
......@@ -36,7 +36,14 @@ export default function Page() {
page={Number(allData?.responseData.currentPage ?? page)}
onChangePage={(p) => setPage(p)}
onGoToPreviousPage={() => setPage(Math.max(1, page - 1))}
onGoToNextPage={() => setPage(Math.min(Number(allData?.responseData.totalPages ?? 1), page + 1))}
onGoToNextPage={() =>
setPage(
Math.min(
Number(allData?.responseData.totalPages ?? 1),
page + 1
)
)
}
/>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment