summaryrefslogtreecommitdiff
path: root/src/client/app/desktop/views/components/ui.header.messaging.vue
blob: c5d1da3a3d5fce4e763ac8c0e614793382c35c14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<template>
<div class="toltmoik">
	<button @click="open()" :title="$t('@.messaging')">
		<i class="bell"><fa :icon="faComments"/></i>
		<i class="circle" v-if="hasUnreadMessagingMessage"><fa icon="circle"/></i>
	</button>
</div>
</template>

<script lang="ts">
import Vue from 'vue';
import i18n from '../../../i18n';
import MkMessagingWindow from './messaging-window.vue';
import { faComments } from '@fortawesome/free-regular-svg-icons';

export default Vue.extend({
	i18n: i18n(),

	data() {
		return {
			faComments
		};
	},

	computed: {
		hasUnreadMessagingMessage(): boolean {
			return this.$store.getters.isSignedIn && this.$store.state.i.hasUnreadMessagingMessage;
		}
	},

	methods: {
		open() {
			this.$root.new(MkMessagingWindow);
		},
	}
});
</script>

<style lang="stylus" scoped>
.toltmoik
	> button
		display block
		margin 0
		padding 0
		width 32px
		color var(--desktopHeaderFg)
		border none
		background transparent
		cursor pointer

		*
			pointer-events none

		&:hover
		&[data-active='true']
			color var(--desktopHeaderHoverFg)

		> i.bell
			font-size 1.2em
			line-height 48px

		> i.circle
			margin-left -5px
			vertical-align super
			font-size 10px
			color var(--notificationIndicator)
			animation blink 1s infinite

</style>