aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2024-09-13 01:10:31 +0300
committerValentin Popov <valentin@popov.link>2024-09-13 01:10:31 +0300
commitde1885fe8fe279c95c2c2b101fad916958dadd4a (patch)
tree11925fe753743b85a0c37333848ab4322665468e /src/components
parent3591bebabff902106632f0f0b309f3baa1e04a17 (diff)
downloadpopov.link-de1885fe8fe279c95c2c2b101fad916958dadd4a.tar.xz
popov.link-de1885fe8fe279c95c2c2b101fad916958dadd4a.zip
Added Pagination component
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Pagination.astro46
-rw-r--r--src/components/PostSummary.astro (renamed from src/components/PostElement.astro)0
2 files changed, 46 insertions, 0 deletions
diff --git a/src/components/Pagination.astro b/src/components/Pagination.astro
new file mode 100644
index 0000000..e9fbc69
--- /dev/null
+++ b/src/components/Pagination.astro
@@ -0,0 +1,46 @@
+---
+type Props = {
+ readonly prevUrl?: string;
+ readonly nextUrl?: string;
+};
+
+const { prevUrl, nextUrl } = Astro.props;
+---
+
+<style lang="scss">
+ .pagination {
+ overflow: hidden;
+ padding: 3rem 0;
+ width: 100%;
+ }
+
+ .prev,
+ .next {
+ max-width: 40%;
+ }
+
+ .prev {
+ float: left;
+ }
+
+ .next {
+ float: right;
+ }
+</style>
+
+<div class="pagination">
+ {
+ prevUrl && (
+ <span class="prev">
+ <a href={prevUrl}>&lt; Prev</a>
+ </span>
+ )
+ }
+ {
+ nextUrl && (
+ <span class="next">
+ <a href={nextUrl}>Next &gt;</a>
+ </span>
+ )
+ }
+</div>
diff --git a/src/components/PostElement.astro b/src/components/PostSummary.astro
index 2f98130..2f98130 100644
--- a/src/components/PostElement.astro
+++ b/src/components/PostSummary.astro