Skip to content

Commit

Permalink
feat(pagination): can now click to load next page as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jan 30, 2024
1 parent d6a42e4 commit e5442c2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
24 changes: 21 additions & 3 deletions pages/posts/[domain].vue
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,27 @@

<!-- Next Pagination -->
<PostsPagination @load-next-page="onLoadNextPostPage">
<span v-if="isFetchingNextPage">Loading more&hellip;</span>
<span v-else-if="hasNextPage">Reach here to load more</span>
<span v-else>Nothing more to load</span>
<span
v-if="isFetchingNextPage"
class="block rounded-md px-1.5 py-1"
>
Loading more&hellip;
</span>

<button
v-else-if="hasNextPage"
class="focus-visible:focus-outline-util hover:hover-bg-util hover:hover-text-util rounded-md px-1.5 py-1"
@click="onLoadNextPostPage"
>
Scroll here or click me to load more
</button>

<span
v-else
class="block rounded-md px-1.5 py-1"
>
Nothing more to load
</span>
</PostsPagination>
</div>
</section>
Expand Down
24 changes: 21 additions & 3 deletions pages/premium/saved-posts/[domain].vue
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,27 @@

<!-- Next Pagination -->
<PostsPagination @load-next-page="onLoadNextPostPage">
<span v-if="isFetchingNextPage">Loading more&hellip;</span>
<span v-else-if="hasNextPage">Reach here to load more</span>
<span v-else>Nothing more to load</span>
<span
v-if="isFetchingNextPage"
class="block rounded-md px-1.5 py-1"
>
Loading more&hellip;
</span>

<button
v-else-if="hasNextPage"
class="focus-visible:focus-outline-util hover:hover-bg-util hover:hover-text-util rounded-md px-1.5 py-1"
@click="onLoadNextPostPage"
>
Scroll here or click me to load more
</button>

<span
v-else
class="block rounded-md px-1.5 py-1"
>
Nothing more to load
</span>
</PostsPagination>
</div>
</section>
Expand Down

0 comments on commit e5442c2

Please sign in to comment.