Add previous button to stork list

This commit is contained in:
Sam Carlton 2022-06-03 19:08:55 -05:00
parent f2dc9488d8
commit a9f9fa216a

View file

@ -211,8 +211,26 @@
<nav <nav
v-if="showingInitialList" v-if="showingInitialList"
class="pagination w-full flex justify-center" class="pagination w-full flex gap-6 justify-center"
> >
<LinkButton
v-if="previousPageUrl"
:href="previousPageUrl"
class="border-2 border-gray-700 bg-dark hover:bg-darkest hover:border-white hover:border-opacity-50"
>
<svg
class="-scale-x-100 h-5 w-5"
viewBox="0 0 20 20"
fill="currentColor"
>
<use href="#chevron-right" />
</svg>
<span>Previous</span>
</LinkButton>
<LinkButton <LinkButton
v-if="nextPageUrl" v-if="nextPageUrl"
:href="nextPageUrl" :href="nextPageUrl"
@ -222,13 +240,14 @@
<span>Next</span> <span>Next</span>
<svg <svg
class="h-5 w-5 -mr-2" class="h-5 w-5"
viewBox="0 0 20 20" viewBox="0 0 20 20"
fill="currentColor" fill="currentColor"
> >
<use href="#chevron-right" /> <use href="#chevron-right" />
</svg> </svg>
</LinkButton> </LinkButton>
</nav> </nav>
</div> </div>
</template> </template>
@ -350,15 +369,15 @@ export default {
return null return null
}, },
nextPageUrl () {
if ( this.kindPage.nextPage.length === 0 ) return null
return this.kindPage.nextPage
},
previousPageUrl () { previousPageUrl () {
if ( this.kindPage.previousPage.length === 0 ) return null if ( this.kindPage.previousPage.length === 0 ) return null
return this.kindPage.previousPage return this.kindPage.previousPage
},
nextPageUrl () {
if ( this.kindPage.nextPage.length === 0 ) return null
return this.kindPage.nextPage
} }
}, },
mounted () { mounted () {