feat: allow toggle bg

This commit is contained in:
Shivam Mishra
2024-12-25 19:42:40 +05:30
parent c19d70a6a0
commit 9d48f5c737
5 changed files with 48 additions and 4 deletions
@@ -44,7 +44,7 @@ export default {
default: false,
},
},
emits: ['open', 'close', 'replyTo'],
emits: ['open', 'close', 'replyTo', 'toggleBg'],
setup() {
const { getPlainText } = useMessageFormatter();
return {
@@ -116,6 +116,9 @@ export default {
handleClose(e) {
this.$emit('close', e);
},
toggleBackground(e) {
this.$emit('toggleBg', e);
},
handleTranslate() {
const { locale } = this.getAccount(this.currentAccountId);
this.$store.dispatch('translateMessage', {
@@ -232,6 +235,15 @@ export default {
variant="icon"
@click.stop="handleTranslate"
/>
<MenuItem
v-if="enabledOptions['toggleBg']"
:option="{
icon: 'arrow-rotate-clockwise',
label: $t('CONVERSATION.CONTEXT_MENU.TOGGLE_BG'),
}"
variant="icon"
@click.stop="toggleBackground"
/>
<hr />
<MenuItem
:option="{