2019-10-29 07:20:54 +00:00
|
|
|
<template>
|
|
|
|
<div class="home">
|
|
|
|
<div class="header-wrap">
|
2019-11-26 17:05:26 +00:00
|
|
|
<ChatHeaderExpanded v-if="isHeaderExpanded" />
|
|
|
|
<ChatHeader v-else :title="getHeaderName" />
|
2019-10-29 07:20:54 +00:00
|
|
|
</div>
|
2019-12-14 18:36:01 +00:00
|
|
|
<ConversationWrap :grouped-messages="groupedMessages" />
|
2019-10-29 07:20:54 +00:00
|
|
|
<div class="footer-wrap">
|
2020-01-13 06:40:40 +00:00
|
|
|
<div class="input-wrap">
|
|
|
|
<ChatFooter :on-send-message="handleSendMessage" />
|
|
|
|
</div>
|
|
|
|
<branding></branding>
|
2019-10-29 07:20:54 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mapActions, mapGetters } from 'vuex';
|
|
|
|
|
2020-01-13 06:40:40 +00:00
|
|
|
import Branding from 'widget/components/Branding.vue';
|
2019-10-29 07:20:54 +00:00
|
|
|
import ChatFooter from 'widget/components/ChatFooter.vue';
|
|
|
|
import ChatHeaderExpanded from 'widget/components/ChatHeaderExpanded.vue';
|
2019-11-26 17:05:26 +00:00
|
|
|
import ChatHeader from 'widget/components/ChatHeader.vue';
|
2019-10-29 07:20:54 +00:00
|
|
|
import ConversationWrap from 'widget/components/ConversationWrap.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Home',
|
|
|
|
components: {
|
|
|
|
ChatFooter,
|
|
|
|
ChatHeaderExpanded,
|
|
|
|
ConversationWrap,
|
2019-11-26 17:05:26 +00:00
|
|
|
ChatHeader,
|
2020-01-13 06:40:40 +00:00
|
|
|
Branding,
|
2019-10-29 07:20:54 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions('conversation', ['sendMessage']),
|
|
|
|
handleSendMessage(content) {
|
|
|
|
this.sendMessage({
|
|
|
|
content,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
2019-12-14 18:36:01 +00:00
|
|
|
...mapGetters({
|
|
|
|
groupedMessages: 'conversation/getGroupedConversation',
|
|
|
|
conversationSize: 'conversation/getConversationSize',
|
|
|
|
}),
|
2019-11-26 17:05:26 +00:00
|
|
|
isHeaderExpanded() {
|
2019-12-14 18:36:01 +00:00
|
|
|
return this.conversationSize === 0;
|
2019-11-26 17:05:26 +00:00
|
|
|
},
|
|
|
|
getHeaderName() {
|
|
|
|
return window.chatwootWebChannel.website_name;
|
|
|
|
},
|
2019-10-29 07:20:54 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
@import '~widget/assets/scss/woot.scss';
|
|
|
|
|
|
|
|
.home {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
background: $color-background;
|
|
|
|
|
|
|
|
.header-wrap {
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.footer-wrap {
|
|
|
|
flex-shrink: 0;
|
2020-01-13 06:40:40 +00:00
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.input-wrap {
|
|
|
|
padding: 0 $space-medium;
|
2019-10-29 07:20:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|