From a76cd7684a8eccb103066b8ba491f1d8b28a81dd Mon Sep 17 00:00:00 2001 From: Fayaz Ahmed Date: Thu, 12 Sep 2024 00:29:41 +0530 Subject: [PATCH] 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 Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> --- app/javascript/shared/components/ChatCard.vue | 20 ++++-- app/javascript/shared/components/ChatForm.vue | 15 ++-- .../components/CustomerSatisfaction.vue | 18 +++-- .../shared/components/DateSeparator.vue | 9 ++- .../components/specs/DateSeparator.spec.js | 2 - app/javascript/widget/App.vue | 8 ++- .../widget/components/AgentMessage.vue | 16 +++-- .../widget/components/AgentMessageBubble.vue | 7 +- .../widget/components/AgentTypingBubble.vue | 9 ++- .../widget/components/ChatHeader.vue | 16 +++-- .../widget/components/ChatHeaderExpanded.vue | 11 +-- .../widget/components/ChatInputWrap.vue | 24 ++++--- .../widget/components/ConversationWrap.vue | 7 +- .../widget/components/FileBubble.vue | 9 ++- .../widget/components/Form/Input.vue | 30 +++++--- .../widget/components/Form/PhoneInput.vue | 61 +++++++++------- .../widget/components/Form/TextArea.vue | 30 +++++--- .../widget/components/HeaderActions.vue | 14 ++-- .../widget/components/PreChat/Form.vue | 28 ++++---- .../widget/components/UnreadMessage.vue | 14 ++-- .../widget/components/template/Article.vue | 21 +++--- .../widget/components/template/EmailInput.vue | 12 ++-- .../composables/specs/useDarkMode.spec.js | 71 +++++++++++++++++++ .../widget/composables/useDarkMode.js | 39 ++++++++++ app/javascript/widget/mixins/darkModeMixin.js | 24 ------- .../widget/mixins/specs/darkModeMixin.spec.js | 41 ----------- app/javascript/widget/views/Home.vue | 8 ++- 27 files changed, 357 insertions(+), 207 deletions(-) create mode 100644 app/javascript/widget/composables/specs/useDarkMode.spec.js create mode 100644 app/javascript/widget/composables/useDarkMode.js delete mode 100644 app/javascript/widget/mixins/darkModeMixin.js delete mode 100644 app/javascript/widget/mixins/specs/darkModeMixin.spec.js diff --git a/app/javascript/shared/components/ChatCard.vue b/app/javascript/shared/components/ChatCard.vue index 14683784f..7e3339101 100644 --- a/app/javascript/shared/components/ChatCard.vue +++ b/app/javascript/shared/components/ChatCard.vue @@ -1,12 +1,11 @@