2021-02-08 11:08:35 +00:00
|
|
|
<template>
|
2021-12-01 07:15:39 +00:00
|
|
|
<div class="notifications-link">
|
|
|
|
<primary-nav-item
|
|
|
|
name="NOTIFICATIONS"
|
|
|
|
icon="alert"
|
|
|
|
:to="`/app/accounts/${accountId}/notifications`"
|
|
|
|
:count="unreadCount"
|
|
|
|
/>
|
|
|
|
</div>
|
2021-02-08 11:08:35 +00:00
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import { mapGetters } from 'vuex';
|
2021-12-02 05:32:43 +00:00
|
|
|
import PrimaryNavItem from './PrimaryNavItem';
|
2021-12-01 05:03:18 +00:00
|
|
|
|
2021-02-08 11:08:35 +00:00
|
|
|
export default {
|
2021-12-01 07:15:39 +00:00
|
|
|
components: { PrimaryNavItem },
|
2021-02-08 11:08:35 +00:00
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
|
|
|
accountId: 'getCurrentAccountId',
|
|
|
|
notificationMetadata: 'notifications/getMeta',
|
|
|
|
}),
|
|
|
|
unreadCount() {
|
|
|
|
if (!this.notificationMetadata.unreadCount) {
|
2021-12-02 05:32:43 +00:00
|
|
|
return '';
|
2021-02-08 11:08:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return this.notificationMetadata.unreadCount < 100
|
2021-12-01 07:15:39 +00:00
|
|
|
? `${this.notificationMetadata.unreadCount}`
|
2021-02-08 11:08:35 +00:00
|
|
|
: '99+';
|
|
|
|
},
|
|
|
|
},
|
2021-12-01 07:15:39 +00:00
|
|
|
methods: {},
|
2021-02-08 11:08:35 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2021-12-01 07:15:39 +00:00
|
|
|
.notifications-link {
|
|
|
|
margin-bottom: var(--space-small);
|
2021-02-08 11:08:35 +00:00
|
|
|
}
|
|
|
|
</style>
|