2019-10-29 07:20:54 +00:00
|
|
|
<template>
|
2019-11-25 18:40:27 +00:00
|
|
|
<div
|
|
|
|
class="chat-bubble user"
|
2019-11-29 12:12:35 +00:00
|
|
|
:style="{ background: backgroundColor }"
|
2019-11-25 18:40:27 +00:00
|
|
|
v-html="formatMessage(message)"
|
|
|
|
></div>
|
2019-10-29 07:20:54 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-11-23 18:59:55 +00:00
|
|
|
import messageFormatterMixin from 'shared/mixins/messageFormatterMixin';
|
2019-11-25 18:40:27 +00:00
|
|
|
import { mapGetters } from 'vuex';
|
2019-11-23 18:59:55 +00:00
|
|
|
|
2019-10-29 07:20:54 +00:00
|
|
|
export default {
|
|
|
|
name: 'UserMessageBubble',
|
2019-11-25 18:40:27 +00:00
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
|
|
|
widgetColor: 'appConfig/getWidgetColor',
|
|
|
|
}),
|
2019-11-29 12:12:35 +00:00
|
|
|
backgroundColor() {
|
|
|
|
return this.status !== 'in_progress' ? this.widgetColor : '#c0ccda';
|
|
|
|
},
|
2019-11-25 18:40:27 +00:00
|
|
|
},
|
2019-11-23 18:59:55 +00:00
|
|
|
mixins: [messageFormatterMixin],
|
2019-10-29 07:20:54 +00:00
|
|
|
props: {
|
|
|
|
message: String,
|
2019-11-29 12:12:35 +00:00
|
|
|
status: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
2019-10-29 07:20:54 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '~widget/assets/scss/variables.scss';
|
|
|
|
@import '~widget/assets/scss/mixins.scss';
|
|
|
|
|
|
|
|
.chat-bubble {
|
|
|
|
@include light-shadow;
|
|
|
|
background: $color-woot;
|
|
|
|
border-radius: $space-two;
|
|
|
|
color: $color-white;
|
|
|
|
display: inline-block;
|
|
|
|
font-size: $font-size-default;
|
|
|
|
line-height: 1.5;
|
|
|
|
max-width: 80%;
|
2020-01-17 08:06:05 +00:00
|
|
|
padding: $space-small $space-normal;
|
2019-11-23 18:59:55 +00:00
|
|
|
text-align: left;
|
|
|
|
|
|
|
|
a {
|
2020-02-20 05:29:43 +00:00
|
|
|
color: $color-primary;
|
2019-11-23 18:59:55 +00:00
|
|
|
}
|
2019-10-29 07:20:54 +00:00
|
|
|
|
|
|
|
&.user {
|
|
|
|
border-bottom-right-radius: $space-smaller;
|
2020-02-20 05:29:43 +00:00
|
|
|
|
|
|
|
a {
|
|
|
|
color: $color-white;
|
|
|
|
}
|
2019-10-29 07:20:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|