restriction text implementation for the frontend

This commit is contained in:
Čarodej
2022-06-14 10:31:55 +02:00
parent ebf1b16aa5
commit aaea435eb0
7 changed files with 18 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div v-if="$store.getters.isLimitedUser" class="bg-red-500 py-1 text-center">
<div v-if="$store.getters.userLimitationReason" class="bg-gradient-to-r from-red-600 to-red-500 py-2.5 px-1 text-center leading-none">
<router-link :to="{ name: 'Billing' }" class="text-xs font-bold text-white">
{{ $t('restricted_account_warning') }}
{{ $t('restricted_account_warning') + ' ' + $store.getters.userLimitationReason }}
</router-link>
</div>
</template>

View File

@@ -201,10 +201,7 @@ const mutations = {
}
const getters = {
isLimitedUser: (state) =>
state.user &&
state.user.data.relationships.failedPayments &&
state.user.data.relationships.failedPayments.data.length === 3,
userLimitationReason: (state) => state.user && state.user.data.meta.restrictions.reason,
permission: (state) => state.permission,
user: (state) => state.user,
}

View File

@@ -110,7 +110,7 @@ export default {
DragUI,
},
computed: {
...mapGetters(['isVisibleSidebar', 'isLimitedUser', 'config', 'currentFolder']),
...mapGetters(['isVisibleSidebar', 'config', 'currentFolder']),
},
data() {
return {