2019-08-14 09:48:44 +00:00
|
|
|
<template>
|
2019-11-14 08:16:43 +00:00
|
|
|
<div :class="conversationClass">
|
2019-11-17 07:39:10 +00:00
|
|
|
<messages-view
|
|
|
|
v-if="currentChat.id"
|
|
|
|
:inbox-id="inboxId"
|
|
|
|
:is-contact-panel-open="isContactPanelOpen"
|
|
|
|
@contactPanelToggle="onToggleContactPanel"
|
|
|
|
>
|
|
|
|
</messages-view>
|
|
|
|
<empty-state v-else></empty-state>
|
2019-08-14 09:48:44 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import { mapGetters } from 'vuex';
|
2019-11-17 07:39:10 +00:00
|
|
|
import EmptyState from './EmptyState';
|
|
|
|
import MessagesView from './MessagesView';
|
2019-08-14 09:48:44 +00:00
|
|
|
|
|
|
|
export default {
|
2019-08-25 05:34:33 +00:00
|
|
|
components: {
|
2019-11-17 07:39:10 +00:00
|
|
|
EmptyState,
|
|
|
|
MessagesView,
|
2019-08-25 05:34:33 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
inboxId: {
|
2019-09-02 14:56:28 +00:00
|
|
|
type: [Number, String],
|
2019-11-17 07:39:10 +00:00
|
|
|
default: '',
|
|
|
|
required: false,
|
2019-08-25 05:34:33 +00:00
|
|
|
},
|
2019-11-14 08:16:43 +00:00
|
|
|
isContactPanelOpen: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2019-08-25 05:34:33 +00:00
|
|
|
},
|
2019-08-14 09:48:44 +00:00
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
|
|
|
currentChat: 'getSelectedChat',
|
|
|
|
}),
|
2019-11-14 08:16:43 +00:00
|
|
|
conversationClass() {
|
|
|
|
return `medium-${
|
|
|
|
this.isContactPanelOpen ? '5' : '8'
|
|
|
|
} columns conversation-wrap`;
|
|
|
|
},
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
2019-08-25 05:34:33 +00:00
|
|
|
methods: {
|
2019-11-14 08:16:43 +00:00
|
|
|
onToggleContactPanel() {
|
|
|
|
this.$emit('contactPanelToggle');
|
|
|
|
},
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|