mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 11:37:58 +00:00
chore: Replace darkmode mixin with useDarkMode composable [CW-3474] (#9949)
# Pull Request Template ## Description Replaces darkModeMixin with the new useDarkMode composable and replaces wll usages of mixin the the composable in components and pages Fixes https://linear.app/chatwoot/issue/CW-3474/rewrite-darkmodemixin-mixin-to-a-composable ## Type of change Please delete options that are not relevant. - [x] New feature (non-breaking change which adds functionality) --------- Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
<script>
|
||||
import CardButton from 'shared/components/CardButton.vue';
|
||||
import darkModeMixin from 'widget/mixins/darkModeMixin.js';
|
||||
import { useDarkMode } from 'widget/composables/useDarkMode';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CardButton,
|
||||
},
|
||||
mixins: [darkModeMixin],
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
@@ -25,21 +24,30 @@ export default {
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
computed: {},
|
||||
setup() {
|
||||
const { getThemeClass } = useDarkMode();
|
||||
return { getThemeClass };
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="card-message chat-bubble agent"
|
||||
:class="$dm('bg-white', 'dark:bg-slate-700')"
|
||||
:class="getThemeClass('bg-white', 'dark:bg-slate-700')"
|
||||
>
|
||||
<img class="media" :src="mediaUrl" />
|
||||
<div class="card-body">
|
||||
<h4 class="title" :class="$dm('text-black-900', 'dark:text-slate-50')">
|
||||
<h4
|
||||
class="title"
|
||||
:class="getThemeClass('text-black-900', 'dark:text-slate-50')"
|
||||
>
|
||||
{{ title }}
|
||||
</h4>
|
||||
<p class="body" :class="$dm('text-black-700', 'dark:text-slate-100')">
|
||||
<p
|
||||
class="body"
|
||||
:class="getThemeClass('text-black-700', 'dark:text-slate-100')"
|
||||
>
|
||||
{{ description }}
|
||||
</p>
|
||||
<CardButton v-for="action in actions" :key="action.id" :action="action" />
|
||||
|
||||
Reference in New Issue
Block a user