2019-10-29 07:20:54 +00:00
|
|
|
<template>
|
2019-11-25 18:40:27 +00:00
|
|
|
<div
|
2022-04-21 05:57:28 +00:00
|
|
|
v-dompurify-html="formatMessage(message, false)"
|
2019-11-25 18:40:27 +00:00
|
|
|
class="chat-bubble user"
|
2022-11-02 00:22:00 +00:00
|
|
|
:style="{ background: widgetColor, color: textColor }"
|
2020-06-15 08:05:52 +00:00
|
|
|
/>
|
2019-10-29 07:20:54 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-11-23 18:59:55 +00:00
|
|
|
import messageFormatterMixin from 'shared/mixins/messageFormatterMixin';
|
2022-11-02 00:22:00 +00:00
|
|
|
import { getContrastingTextColor } from '@chatwoot/utils';
|
2019-11-23 18:59:55 +00:00
|
|
|
|
2019-10-29 07:20:54 +00:00
|
|
|
export default {
|
|
|
|
name: 'UserMessageBubble',
|
2019-11-23 18:59:55 +00:00
|
|
|
mixins: [messageFormatterMixin],
|
2019-10-29 07:20:54 +00:00
|
|
|
props: {
|
2020-06-15 08:05:52 +00:00
|
|
|
message: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
2019-11-29 12:12:35 +00:00
|
|
|
status: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
2020-06-15 08:05:52 +00:00
|
|
|
widgetColor: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
2020-03-30 06:45:06 +00:00
|
|
|
},
|
|
|
|
},
|
2022-11-02 00:22:00 +00:00
|
|
|
computed: {
|
|
|
|
textColor() {
|
|
|
|
return getContrastingTextColor(this.widgetColor);
|
|
|
|
},
|
|
|
|
},
|
2019-10-29 07:20:54 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2021-01-15 09:10:50 +00:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import '~widget/assets/scss/variables.scss';
|
|
|
|
|
|
|
|
.chat-bubble.user::v-deep pre {
|
|
|
|
background: $color-primary-light;
|
|
|
|
color: $color-body;
|
2022-09-05 07:16:27 +00:00
|
|
|
overflow: auto;
|
2021-01-15 09:10:50 +00:00
|
|
|
padding: $space-smaller;
|
|
|
|
}
|
|
|
|
</style>
|