2019-11-26 17:05:26 +00:00
|
|
|
<template>
|
2020-01-17 08:06:05 +00:00
|
|
|
<header class="header-collapsed">
|
|
|
|
<h2 class="title">
|
|
|
|
{{ title }}
|
|
|
|
</h2>
|
|
|
|
<span class="close" @click="closeWindow"></span>
|
2019-11-26 17:05:26 +00:00
|
|
|
</header>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mapGetters } from 'vuex';
|
2020-01-17 08:06:05 +00:00
|
|
|
import { IFrameHelper } from 'widget/helpers/utils';
|
2019-11-26 17:05:26 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'ChatHeader',
|
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
|
|
|
widgetColor: 'appConfig/getWidgetColor',
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
},
|
2020-01-17 08:06:05 +00:00
|
|
|
methods: {
|
|
|
|
closeWindow() {
|
|
|
|
if (IFrameHelper.isIFrame()) {
|
|
|
|
IFrameHelper.sendMessage({
|
|
|
|
event: 'toggleBubble',
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2019-11-26 17:05:26 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
@import '~widget/assets/scss/variables.scss';
|
2020-01-17 08:06:05 +00:00
|
|
|
@import '~widget/assets/scss/mixins.scss';
|
2019-11-26 17:05:26 +00:00
|
|
|
|
|
|
|
.header-collapsed {
|
2020-01-17 08:06:05 +00:00
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
2019-11-26 17:05:26 +00:00
|
|
|
padding: $space-two $space-medium;
|
|
|
|
width: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
color: $color-white;
|
|
|
|
|
|
|
|
.title {
|
2020-01-17 08:06:05 +00:00
|
|
|
font-size: $font-size-large;
|
2019-11-28 05:33:01 +00:00
|
|
|
font-weight: $font-weight-medium;
|
2020-01-17 08:06:05 +00:00
|
|
|
color: $color-heading;
|
|
|
|
}
|
|
|
|
|
|
|
|
.close {
|
|
|
|
position: relative;
|
|
|
|
margin-right: $space-small;
|
|
|
|
|
|
|
|
&:before,
|
|
|
|
&:after {
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
top: $space-smaller;
|
|
|
|
content: ' ';
|
|
|
|
height: $space-normal;
|
|
|
|
width: 2px;
|
|
|
|
background-color: $color-heading;
|
|
|
|
}
|
|
|
|
&:before {
|
|
|
|
transform: rotate(45deg);
|
|
|
|
}
|
|
|
|
&:after {
|
|
|
|
transform: rotate(-45deg);
|
|
|
|
}
|
2019-11-26 17:05:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|