add new menu point for GDT

This commit is contained in:
ogerly 2022-08-07 11:55:43 +02:00
parent f95831d6a0
commit 18ad0107de
3 changed files with 37 additions and 1 deletions

View File

@ -16,6 +16,10 @@
<b-icon icon="layout-text-sidebar-reverse" aria-hidden="true"></b-icon>
{{ $t('navigation.transactions') }}
</b-nav-item>
<b-nav-item to="/gdt" class="mb-3">
<b-icon icon="layout-text-sidebar-reverse" aria-hidden="true"></b-icon>
{{ $t('gdt.gdt') }}
</b-nav-item>
<b-nav-item to="/community" class="mb-3">
<b-icon icon="people" aria-hidden="true"></b-icon>
{{ $t('navigation.community') }}

View File

@ -1,7 +1,11 @@
<template>
<div class="pb-4">
<b-tabs v-model="tabIndex" content-class="" justified>
<b-tab :title="`Gradido (${$n(balance, 'decimal')} GDD)`" class="px-4">
<b-tab
:title="`Gradido (${$n(balance, 'decimal')} GDD)`"
class="px-4"
@click="$router.replace('/transactions')"
>
<p class="tab-tex">{{ $t('transaction.gdd-text') }}</p>
<gdd-transaction-list
@ -42,6 +46,7 @@ export default {
GdtTransactionList,
},
props: {
gdt: { type: Boolean, default: false },
balance: { type: Number, default: 0 },
GdtBalance: { type: Number, default: 0 },
transactions: {
@ -77,6 +82,8 @@ export default {
this.transactionsGdt = listGDTEntries.gdtEntries
this.transactionGdtCount = listGDTEntries.count
window.scrollTo(0, 0)
// eslint-disable-next-line no-unused-expressions
this.$route.path === '/transactions' ? this.$router.replace('/gdt') : ''
})
.catch((error) => {
this.transactionGdtCount = -1
@ -94,10 +101,26 @@ export default {
return this.$t('gdt.gdt')
},
},
created() {
if (this.gdt) {
this.tabIndex = 1
this.updateGdt()
} else {
this.tabIndex = 0
}
},
watch: {
currentPage() {
this.updateGdt()
},
gdt() {
if (this.gdt) {
this.tabIndex = 1
this.updateGdt()
} else {
this.tabIndex = 0
}
},
},
}
</script>

View File

@ -34,6 +34,15 @@ const routes = [
{
path: '/transactions',
component: () => import('@/pages/Transactions.vue'),
props: { gdt: false },
meta: {
requiresAuth: true,
},
},
{
path: '/gdt',
component: () => import('@/pages/Transactions.vue'),
props: { gdt: true },
meta: {
requiresAuth: true,
},