2020-01-29 12:37:25 -07:00
|
|
|
<template>
|
2021-12-02 04:09:12 -07:00
|
|
|
<MkSpacer :content-max="700">
|
|
|
|
<div v-if="tab === 'featured'" class="rknalgpo">
|
|
|
|
<MkPagination v-slot="{items}" :pagination="featuredPagesPagination">
|
|
|
|
<MkPagePreview v-for="page in items" :key="page.id" class="ckltabjg" :page="page"/>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-11-16 22:59:15 -07:00
|
|
|
|
2021-12-02 04:09:12 -07:00
|
|
|
<div v-else-if="tab === 'my'" class="rknalgpo my">
|
|
|
|
<MkButton class="new" @click="create()"><i class="fas fa-plus"></i></MkButton>
|
|
|
|
<MkPagination v-slot="{items}" :pagination="myPagesPagination">
|
|
|
|
<MkPagePreview v-for="page in items" :key="page.id" class="ckltabjg" :page="page"/>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-07-27 19:08:08 -06:00
|
|
|
|
2021-12-02 04:09:12 -07:00
|
|
|
<div v-else-if="tab === 'liked'" class="rknalgpo">
|
|
|
|
<MkPagination v-slot="{items}" :pagination="likedPagesPagination">
|
|
|
|
<MkPagePreview v-for="like in items" :key="like.page.id" class="ckltabjg" :page="like.page"/>
|
|
|
|
</MkPagination>
|
2021-10-23 13:03:07 -06:00
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
2020-01-29 12:37:25 -07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-12-02 04:09:12 -07:00
|
|
|
import { computed, defineComponent } from 'vue';
|
2021-11-11 10:02:25 -07:00
|
|
|
import MkPagePreview from '@/components/page-preview.vue';
|
|
|
|
import MkPagination from '@/components/ui/pagination.vue';
|
|
|
|
import MkButton from '@/components/ui/button.vue';
|
|
|
|
import * as symbols from '@/symbols';
|
2020-01-29 12:37:25 -07:00
|
|
|
|
2020-10-17 05:12:00 -06:00
|
|
|
export default defineComponent({
|
2020-01-29 12:37:25 -07:00
|
|
|
components: {
|
2021-12-02 04:09:12 -07:00
|
|
|
MkPagePreview, MkPagination, MkButton
|
2020-01-29 12:37:25 -07:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-12-02 04:09:12 -07:00
|
|
|
[symbols.PAGE_INFO]: computed(() => ({
|
2020-12-25 18:47:36 -07:00
|
|
|
title: this.$ts.pages,
|
2021-04-20 08:22:59 -06:00
|
|
|
icon: 'fas fa-sticky-note',
|
2021-10-08 21:33:08 -06:00
|
|
|
bg: 'var(--bg)',
|
2021-04-10 09:03:31 -06:00
|
|
|
actions: [{
|
2021-04-20 08:22:59 -06:00
|
|
|
icon: 'fas fa-plus',
|
2021-04-10 09:03:31 -06:00
|
|
|
text: this.$ts.create,
|
2021-10-08 21:33:08 -06:00
|
|
|
handler: this.create,
|
|
|
|
}],
|
2021-12-02 04:09:12 -07:00
|
|
|
tabs: [{
|
|
|
|
active: this.tab === 'featured',
|
|
|
|
title: this.$ts._pages.featured,
|
|
|
|
icon: 'fas fa-fire-alt',
|
|
|
|
onClick: () => { this.tab = 'featured'; },
|
|
|
|
}, {
|
|
|
|
active: this.tab === 'my',
|
|
|
|
title: this.$ts._pages.my,
|
|
|
|
icon: 'fas fa-edit',
|
|
|
|
onClick: () => { this.tab = 'my'; },
|
|
|
|
}, {
|
|
|
|
active: this.tab === 'liked',
|
|
|
|
title: this.$ts._pages.liked,
|
|
|
|
icon: 'fas fa-heart',
|
|
|
|
onClick: () => { this.tab = 'liked'; },
|
|
|
|
},]
|
|
|
|
})),
|
2020-11-16 22:59:15 -07:00
|
|
|
tab: 'featured',
|
|
|
|
featuredPagesPagination: {
|
|
|
|
endpoint: 'pages/featured',
|
|
|
|
noPaging: true,
|
|
|
|
},
|
2020-01-29 12:37:25 -07:00
|
|
|
myPagesPagination: {
|
|
|
|
endpoint: 'i/pages',
|
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
likedPagesPagination: {
|
|
|
|
endpoint: 'i/page-likes',
|
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
create() {
|
2020-11-16 22:59:15 -07:00
|
|
|
this.$router.push(`/pages/new`);
|
2020-01-29 12:37:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.rknalgpo {
|
|
|
|
&.my .ckltabjg:first-child {
|
|
|
|
margin-top: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ckltabjg:not(:last-child) {
|
|
|
|
margin-bottom: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (min-width: 500px) {
|
|
|
|
.ckltabjg:not(:last-child) {
|
|
|
|
margin-bottom: 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|