aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
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