refactor: extract post feed logic into reusable partial
All checks were successful
Deploy Theme / deploy (push) Successful in 13s
All checks were successful
Deploy Theme / deploy (push) Successful in 13s
This commit is contained in:
24
tag.hbs
24
tag.hbs
@@ -18,29 +18,7 @@
|
||||
|
||||
<div class="container mx-auto px-4 pb-20">
|
||||
{{#if posts}}
|
||||
<div id="posts-container" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-10">
|
||||
{{#foreach posts}}
|
||||
{{> "post-card"}}
|
||||
{{/foreach}}
|
||||
|
||||
{{#if pagination.next}}
|
||||
<div id="pagination-trigger"
|
||||
hx-get="{{page_url pagination.next}}"
|
||||
hx-trigger="revealed"
|
||||
hx-select="#posts-container > *"
|
||||
hx-target="this"
|
||||
hx-swap="outerHTML"
|
||||
hx-indicator="#loading-spinner"
|
||||
class="col-span-full h-1">
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div id="loading-spinner" class="htmx-indicator text-center py-12">
|
||||
<div class="inline-block animate-spin rounded-full h-10 w-10 border-4 border-[var(--brand-primary)] border-t-transparent"></div>
|
||||
<p class="text-[var(--text-secondary)] mt-4 font-medium tracking-wide">Loading more posts...</p>
|
||||
</div>
|
||||
|
||||
{{> "post-feed"}}
|
||||
{{else}}
|
||||
<p class="text-center text-[var(--text-secondary)] text-2xl py-20">No posts found.</p>
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user