2019-08-14 09:48:44 +00:00
|
|
|
<template>
|
2021-03-02 17:14:04 +00:00
|
|
|
<div class="conversation-details-wrap">
|
|
|
|
<conversation-header
|
2019-11-17 07:39:10 +00:00
|
|
|
v-if="currentChat.id"
|
2021-03-02 17:14:04 +00:00
|
|
|
:chat="currentChat"
|
2019-11-17 07:39:10 +00:00
|
|
|
:is-contact-panel-open="isContactPanelOpen"
|
2020-08-17 05:55:13 +00:00
|
|
|
@contact-panel-toggle="onToggleContactPanel"
|
2019-12-16 12:53:14 +00:00
|
|
|
/>
|
2021-03-02 17:14:04 +00:00
|
|
|
<div class="messages-and-sidebar">
|
|
|
|
<messages-view
|
|
|
|
v-if="currentChat.id"
|
|
|
|
:inbox-id="inboxId"
|
|
|
|
:is-contact-panel-open="isContactPanelOpen"
|
|
|
|
@contact-panel-toggle="onToggleContactPanel"
|
|
|
|
/>
|
|
|
|
<empty-state v-else />
|
|
|
|
|
|
|
|
<div v-show="showContactPanel" class="conversation-sidebar-wrap">
|
|
|
|
<contact-panel
|
|
|
|
v-if="showContactPanel"
|
|
|
|
:conversation-id="currentChat.id"
|
|
|
|
:on-toggle="onToggleContactPanel"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-08-14 09:48:44 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import { mapGetters } from 'vuex';
|
2021-03-02 17:14:04 +00:00
|
|
|
import ContactPanel from 'dashboard/routes/dashboard/conversation/ContactPanel';
|
|
|
|
import ConversationHeader from './ConversationHeader';
|
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,
|
2021-03-02 17:14:04 +00:00
|
|
|
ContactPanel,
|
|
|
|
ConversationHeader,
|
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',
|
|
|
|
}),
|
2021-03-02 17:14:04 +00:00
|
|
|
showContactPanel() {
|
|
|
|
return this.isContactPanelOpen && this.currentChat.id;
|
2019-11-14 08:16:43 +00:00
|
|
|
},
|
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() {
|
2020-08-17 05:55:13 +00:00
|
|
|
this.$emit('contact-panel-toggle');
|
2019-11-14 08:16:43 +00:00
|
|
|
},
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
2021-03-02 17:14:04 +00:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import '~dashboard/assets/scss/app.scss';
|
|
|
|
|
|
|
|
.conversation-details-wrap {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
width: 100%;
|
|
|
|
border-left: 1px solid var(--color-border);
|
|
|
|
}
|
|
|
|
|
|
|
|
.messages-and-sidebar {
|
|
|
|
display: flex;
|
|
|
|
background: var(--color-background-light);
|
|
|
|
margin: 0;
|
2021-03-09 09:56:03 +00:00
|
|
|
height: calc(100vh - var(--space-jumbo));
|
2021-03-02 17:14:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.conversation-sidebar-wrap {
|
|
|
|
height: auto;
|
2021-03-08 08:00:33 +00:00
|
|
|
flex: 0 0;
|
2021-03-02 17:14:04 +00:00
|
|
|
overflow: hidden;
|
|
|
|
overflow: auto;
|
|
|
|
background: white;
|
|
|
|
flex-basis: 28rem;
|
|
|
|
|
|
|
|
@include breakpoint(large up) {
|
2021-03-08 08:00:33 +00:00
|
|
|
flex-basis: 30em;
|
2021-03-02 17:14:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@include breakpoint(xlarge up) {
|
2021-03-08 08:00:33 +00:00
|
|
|
flex-basis: 31em;
|
2021-03-02 17:14:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@include breakpoint(xxlarge up) {
|
2021-03-08 08:00:33 +00:00
|
|
|
flex-basis: 33rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
@include breakpoint(xxxlarge up) {
|
|
|
|
flex-basis: 40rem;
|
2021-03-02 17:14:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&::v-deep .contact--panel {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
max-width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|