2020-07-07 18:34:44 +00:00
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
id="app"
|
|
|
|
class="woot-widget-wrap"
|
2020-11-23 05:19:28 +00:00
|
|
|
:class="{
|
|
|
|
'is-mobile': isMobile,
|
|
|
|
'is-widget-right': !isLeftAligned,
|
|
|
|
'is-bubble-hidden': hideMessageBubble,
|
|
|
|
}"
|
2020-07-07 18:34:44 +00:00
|
|
|
>
|
|
|
|
<home
|
2021-06-15 14:39:42 +00:00
|
|
|
v-if="showHomePage"
|
2020-07-07 18:34:44 +00:00
|
|
|
:has-fetched="hasFetched"
|
|
|
|
:unread-message-count="unreadMessageCount"
|
2020-08-28 12:09:46 +00:00
|
|
|
:show-popout-button="showPopoutButton"
|
2020-07-07 18:34:44 +00:00
|
|
|
/>
|
|
|
|
<unread
|
2021-06-15 18:35:31 +00:00
|
|
|
v-else
|
2021-06-15 14:39:42 +00:00
|
|
|
:show-unread-view="showUnreadView"
|
2020-07-07 18:34:44 +00:00
|
|
|
:has-fetched="hasFetched"
|
|
|
|
:unread-message-count="unreadMessageCount"
|
|
|
|
:hide-message-bubble="hideMessageBubble"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Home from './Home';
|
|
|
|
import Unread from './Unread';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Router',
|
|
|
|
components: {
|
|
|
|
Home,
|
|
|
|
Unread,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
hasFetched: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
isMobile: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
isLeftAligned: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
showUnreadView: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-06-15 14:39:42 +00:00
|
|
|
showCampaignView: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2020-07-07 18:34:44 +00:00
|
|
|
hideMessageBubble: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
unreadMessageCount: {
|
|
|
|
type: Number,
|
|
|
|
default: 0,
|
|
|
|
},
|
2020-08-28 12:09:46 +00:00
|
|
|
showPopoutButton: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2020-07-07 18:34:44 +00:00
|
|
|
},
|
2021-06-15 14:39:42 +00:00
|
|
|
computed: {
|
|
|
|
showHomePage() {
|
|
|
|
return !this.showUnreadView && !this.showCampaignView;
|
|
|
|
},
|
|
|
|
},
|
2020-07-07 18:34:44 +00:00
|
|
|
};
|
|
|
|
</script>
|