2018-07-06 14:15:15 -04:00
|
|
|
<template>
|
2019-11-26 15:50:40 -05:00
|
|
|
<ChannelWrapper ref="wrapper" v-bind="$props">
|
2018-10-05 05:14:30 -04:00
|
|
|
<span class="name">{{ channel.name }}</span>
|
2022-02-10 20:56:17 -05:00
|
|
|
<span
|
|
|
|
v-if="channel.unread"
|
|
|
|
:class="{highlight: channel.highlight && !channel.muted}"
|
|
|
|
class="badge"
|
|
|
|
>{{ unreadCount }}</span
|
|
|
|
>
|
2018-07-12 15:24:35 -04:00
|
|
|
<template v-if="channel.type === 'channel'">
|
2019-02-25 00:21:40 -05:00
|
|
|
<span
|
2019-02-26 01:26:45 -05:00
|
|
|
v-if="channel.state === 0"
|
2019-02-25 00:21:40 -05:00
|
|
|
class="parted-channel-tooltip tooltipped tooltipped-w"
|
2019-02-27 02:28:52 -05:00
|
|
|
aria-label="Not currently joined"
|
|
|
|
>
|
2019-02-25 00:21:40 -05:00
|
|
|
<span class="parted-channel-icon" />
|
|
|
|
</span>
|
2019-08-03 15:03:45 -04:00
|
|
|
<span class="close-tooltip tooltipped tooltipped-w" aria-label="Leave">
|
2019-11-11 08:31:24 -05:00
|
|
|
<button class="close" aria-label="Leave" @click.stop="close" />
|
2018-07-06 14:15:15 -04:00
|
|
|
</span>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
2019-08-03 15:03:45 -04:00
|
|
|
<span class="close-tooltip tooltipped tooltipped-w" aria-label="Close">
|
2019-11-11 08:31:24 -05:00
|
|
|
<button class="close" aria-label="Close" @click.stop="close" />
|
2018-07-12 15:24:35 -04:00
|
|
|
</span>
|
2018-07-06 14:15:15 -04:00
|
|
|
</template>
|
2018-07-12 15:24:35 -04:00
|
|
|
</ChannelWrapper>
|
2018-07-06 14:15:15 -04:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-11-16 12:24:03 -05:00
|
|
|
import roundBadgeNumber from "../js/helpers/roundBadgeNumber";
|
2018-07-12 15:24:35 -04:00
|
|
|
import ChannelWrapper from "./ChannelWrapper.vue";
|
2018-07-08 16:08:08 -04:00
|
|
|
|
2018-07-06 14:15:15 -04:00
|
|
|
export default {
|
|
|
|
name: "Channel",
|
2018-07-12 15:24:35 -04:00
|
|
|
components: {
|
|
|
|
ChannelWrapper,
|
|
|
|
},
|
2018-07-06 14:15:15 -04:00
|
|
|
props: {
|
|
|
|
network: Object,
|
|
|
|
channel: Object,
|
2019-11-26 15:50:40 -05:00
|
|
|
active: Boolean,
|
|
|
|
isFiltering: Boolean,
|
2018-07-08 16:08:08 -04:00
|
|
|
},
|
2019-11-05 05:36:44 -05:00
|
|
|
computed: {
|
|
|
|
unreadCount() {
|
|
|
|
return roundBadgeNumber(this.channel.unread);
|
|
|
|
},
|
|
|
|
},
|
2019-03-03 14:43:57 -05:00
|
|
|
methods: {
|
|
|
|
close() {
|
2019-11-23 11:44:23 -05:00
|
|
|
this.$root.closeChannel(this.channel);
|
2019-03-03 14:43:57 -05:00
|
|
|
},
|
|
|
|
},
|
2018-07-06 14:15:15 -04:00
|
|
|
};
|
|
|
|
</script>
|