Skip to content

Commit cb27fe9

Browse files
committed
fix: basic pagination
1 parent a468c99 commit cb27fe9

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

src/components/common/Pagination.js

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,34 @@ const Pagination = ({ pageContext }) => {
77
pageContext;
88

99
return (
10-
<nav className="pagination" role="navigation">
11-
<div>
12-
{previousPagePath && (
13-
<Link to={previousPagePath} rel="prev">
14-
Previous
15-
</Link>
16-
)}
17-
</div>
18-
{numberOfPages > 1 && (
19-
<div className="pagination-location">
20-
Page {humanPageNumber} of {numberOfPages}
10+
<nav className="flex justify-center">
11+
<ul class="flex">
12+
<div>
13+
{previousPagePath && (
14+
15+
<Link
16+
className="underline relative block py-1.5 px-3 rounded border-0 outline-none transition-all duration-300 rounded text-gray-800 hover:text-gray-800 hover:bg-gray-200 focus:shadow-none"
17+
to={previousPagePath} rel="prev">
18+
Previous
19+
</Link>
20+
21+
)}
2122
</div>
22-
)}
23-
<div>
24-
{nextPagePath && (
25-
<Link to={nextPagePath} rel="next">
26-
Next
27-
</Link>
23+
{numberOfPages > 1 && (
24+
<div className="relative block mx-2 py-1.5 px-3 rounded border-2 transition-all duration-300 rounded">
25+
Page {humanPageNumber} of {numberOfPages}
26+
</div>
2827
)}
29-
</div>
28+
<div>
29+
{nextPagePath && (
30+
<Link
31+
className="underline relative block py-1.5 px-3 rounded border-0 bg-transparent outline-none transition-all duration-300 rounded text-gray-800 hover:text-gray-800 hover:bg-gray-200 focus:shadow-none"
32+
to={nextPagePath} rel="next">
33+
Next
34+
</Link>
35+
)}
36+
</div>
37+
</ul>
3038
</nav>
3139
);
3240
};

0 commit comments

Comments
 (0)