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>
|
2020-02-05 05:57:22 +00:00
|
|
|
<AvailableAgents v-if="showAvailableAgents" :agents="availableAgents" />
|
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">
|
2020-03-30 06:45:06 +00:00
|
|
|
<ChatFooter />
|
2020-01-13 06:40:40 +00:00
|
|
|
</div>
|
|
|
|
<branding></branding>
|
2019-10-29 07:20:54 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-03-30 06:45:06 +00:00
|
|
|
import { mapGetters } from 'vuex';
|
2019-10-29 07:20:54 +00:00
|
|
|
|
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';
|
2020-02-05 05:57:22 +00:00
|
|
|
import AvailableAgents from 'widget/components/AvailableAgents.vue';
|
2019-10-29 07:20:54 +00:00
|
|
|
|
|
|
|
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,
|
2020-02-05 05:57:22 +00:00
|
|
|
AvailableAgents,
|
2019-10-29 07:20:54 +00:00
|
|
|
},
|
|
|
|
computed: {
|
2019-12-14 18:36:01 +00:00
|
|
|
...mapGetters({
|
|
|
|
groupedMessages: 'conversation/getGroupedConversation',
|
|
|
|
conversationSize: 'conversation/getConversationSize',
|
2020-02-05 05:57:22 +00:00
|
|
|
availableAgents: 'agent/availableAgents',
|
|
|
|
hasFetched: 'agent/uiFlags/hasFetched',
|
2019-12-14 18:36:01 +00:00
|
|
|
}),
|
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;
|
|
|
|
},
|
2020-02-05 05:57:22 +00:00
|
|
|
showAvailableAgents() {
|
2020-02-23 09:46:09 +00:00
|
|
|
return this.availableAgents.length > 0 && this.conversationSize < 1;
|
2020-02-05 05:57:22 +00:00
|
|
|
},
|
|
|
|
},
|
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;
|
2020-02-05 05:57:22 +00:00
|
|
|
border-radius: $space-normal;
|
|
|
|
background: white;
|
2020-03-07 18:09:41 +00:00
|
|
|
z-index: 99;
|
2020-02-05 05:57:22 +00:00
|
|
|
@include shadow-large;
|
|
|
|
|
2020-03-07 18:09:41 +00:00
|
|
|
@media only screen and (min-device-width: 320px) and (max-device-width: 667px) {
|
2020-02-05 05:57:22 +00:00
|
|
|
border-radius: 0;
|
|
|
|
}
|
2019-10-29 07:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.footer-wrap {
|
|
|
|
flex-shrink: 0;
|
2020-01-13 06:40:40 +00:00
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-01-17 08:06:05 +00:00
|
|
|
position: relative;
|
|
|
|
|
|
|
|
&:before {
|
|
|
|
content: '';
|
|
|
|
position: absolute;
|
|
|
|
top: -$space-normal;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: $space-normal;
|
2020-01-19 08:47:15 +00:00
|
|
|
opacity: 0.1;
|
2020-01-17 08:06:05 +00:00
|
|
|
background: linear-gradient(
|
|
|
|
to top,
|
|
|
|
$color-background,
|
|
|
|
rgba($color-background, 0)
|
|
|
|
);
|
|
|
|
}
|
2020-01-13 06:40:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.input-wrap {
|
2020-02-05 05:57:22 +00:00
|
|
|
padding: 0 $space-normal;
|
2019-10-29 07:20:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|