Skip to content

Commit

Permalink
feat: add prop for forcing normal controls
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Nov 20, 2021
1 parent 323cf34 commit 04a485e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
19 changes: 12 additions & 7 deletions components/pages/posts/navigation/page/PostsControls.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<!-- Normal controls -->
<template v-if="!getUserSettings.infiniteLoad.value">
<template v-if="!getUserSettings.infiniteLoad.value || forceNormalControls">
<div
:class="{
'fixed bottom-0 inset-x-0 z-10 max-w-3xl p-2 mx-auto sm:p-4 lg:p-6':
Expand All @@ -11,20 +11,20 @@
<div class="flex justify-around p-2 text-center material-container">
<!-- Previous page -->
<button
type="button"
aria-label="Load previous page"
class="link"
title="Load previous page"
aria-label="Load previous page"
type="button"
@click="getPrevPage"
>
<span class="text-white">&larr;</span> Prev
</button>

<!-- Get specific page -->
<button
aria-label="Load specific page"
class="link"
title="Load specific page"
aria-label="Load specific page"
type="button"
@click="getSpecificPage"
>
Expand All @@ -33,10 +33,10 @@

<!-- Next page -->
<button
type="button"
aria-label="Load next page"
class="link"
title="Load next page"
aria-label="Load next page"
type="button"
@click="getNextPage"
>
Next <span class="text-white">&rarr;</span>
Expand All @@ -51,7 +51,7 @@
</template>

<!-- Infinite loading -->
<template v-else-if="getUserSettings.infiniteLoad.value">
<template v-else>
<div
v-intersect="{
handler: InfiniteLoadHandler,
Expand Down Expand Up @@ -91,6 +91,11 @@ export default {
type: Number,
required: true,
},
forceNormalControls: {
type: Boolean,
default: false,
},
},
computed: {
Expand Down
6 changes: 5 additions & 1 deletion pages/premium/saved-posts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@
</template>
</ul>

<PostsControls :current-page="currentPage" @setPage="onPageChange" />
<PostsControls
:current-page="currentPage"
:force-normal-controls="true"
@setPage="onPageChange"
/>
</main>
</template>

Expand Down

0 comments on commit 04a485e

Please sign in to comment.