forked from danielcgilibert/blog-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: create pagination component and pagination size in config
- Loading branch information
1 parent
1109e00
commit cdf26ea
Showing
3 changed files
with
44 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
import ArrowLeft from './icons/ArrowLeft.astro' | ||
import ArrowRight from './icons/ArrowRight.astro' | ||
const { page } = Astro.props | ||
--- | ||
|
||
<div class='flex gap-5 md:gap-1 justify-around md:justify-end'> | ||
<!-- Previous Button --> | ||
{ | ||
page.start > 0 && ( | ||
<a | ||
href={`${page.currentPage + -1}`} | ||
class='flex items-center justify-center px-8 md:px-4 h-10 text-base font-medium text-black bg-white border border-gray-300 rounded-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-transparent dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white' | ||
> | ||
<ArrowLeft /> | ||
</a> | ||
) | ||
} | ||
|
||
<!-- Next Button --> | ||
|
||
{ | ||
page.currentPage < page.lastPage && ( | ||
<a | ||
href={`${page.currentPage + 1}`} | ||
class='flex items-center justify-center px-8 md:px-4 h-10 ml-3 text-base font-medium text-black bg-white border border-gray-300 rounded-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-transparent dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white' | ||
> | ||
<ArrowRight /> | ||
</a> | ||
) | ||
} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters