chore: Improvements to dark mode usage in widget (#7873)
This commit is contained in:
committed by
GitHub
parent
f05535c5ad
commit
8d43101892
@@ -41,7 +41,7 @@ import {
|
|||||||
ON_CAMPAIGN_MESSAGE_CLICK,
|
ON_CAMPAIGN_MESSAGE_CLICK,
|
||||||
ON_UNREAD_MESSAGE_CLICK,
|
ON_UNREAD_MESSAGE_CLICK,
|
||||||
} from './constants/widgetBusEvents';
|
} from './constants/widgetBusEvents';
|
||||||
|
import darkModeMixin from 'widget/mixins/darkModeMixin';
|
||||||
import { SDK_SET_BUBBLE_VISIBILITY } from '../shared/constants/sharedFrameEvents';
|
import { SDK_SET_BUBBLE_VISIBILITY } from '../shared/constants/sharedFrameEvents';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -49,7 +49,7 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
Spinner,
|
Spinner,
|
||||||
},
|
},
|
||||||
mixins: [availabilityMixin, configMixin, routerMixin],
|
mixins: [availabilityMixin, configMixin, routerMixin, darkModeMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isMobile: false,
|
isMobile: false,
|
||||||
@@ -67,7 +67,6 @@ export default {
|
|||||||
isFetchingList: 'conversation/getIsFetchingList',
|
isFetchingList: 'conversation/getIsFetchingList',
|
||||||
isRightAligned: 'appConfig/isRightAligned',
|
isRightAligned: 'appConfig/isRightAligned',
|
||||||
isWidgetOpen: 'appConfig/getIsWidgetOpen',
|
isWidgetOpen: 'appConfig/getIsWidgetOpen',
|
||||||
darkMode: 'appConfig/darkMode',
|
|
||||||
messageCount: 'conversation/getMessageCount',
|
messageCount: 'conversation/getMessageCount',
|
||||||
unreadMessageCount: 'conversation/getUnreadMessageCount',
|
unreadMessageCount: 'conversation/getUnreadMessageCount',
|
||||||
isWidgetStyleFlat: 'appConfig/isWidgetStyleFlat',
|
isWidgetStyleFlat: 'appConfig/isWidgetStyleFlat',
|
||||||
@@ -78,12 +77,6 @@ export default {
|
|||||||
isRNWebView() {
|
isRNWebView() {
|
||||||
return RNHelper.isRNWebView();
|
return RNHelper.isRNWebView();
|
||||||
},
|
},
|
||||||
prefersDarkMode() {
|
|
||||||
const isOSOnDarkMode =
|
|
||||||
this.darkMode === 'auto' &&
|
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
||||||
return isOSOnDarkMode || this.darkMode === 'dark';
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
activeCampaign() {
|
activeCampaign() {
|
||||||
|
|||||||
@@ -9,8 +9,7 @@
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-dompurify-html="formatMessage(message, false)"
|
v-dompurify-html="formatMessage(message, false)"
|
||||||
class="message-content"
|
class="message-content text-slate-900 dark:text-slate-50"
|
||||||
:class="$dm('text-black-900', 'dark:text-slate-50')"
|
|
||||||
/>
|
/>
|
||||||
<email-input
|
<email-input
|
||||||
v-if="isTemplateEmail"
|
v-if="isTemplateEmail"
|
||||||
|
|||||||
@@ -46,7 +46,10 @@
|
|||||||
>
|
>
|
||||||
<router-view />
|
<router-view />
|
||||||
</transition>
|
</transition>
|
||||||
<branding :disable-branding="disableBranding" />
|
<branding
|
||||||
|
class="bg-slate-25 dark:bg-slate-800"
|
||||||
|
:disable-branding="disableBranding"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
Reference in New Issue
Block a user