From bc7dae785b8565eb6e15efb042764c676594b968 Mon Sep 17 00:00:00 2001
From: Embbnux Ji <embbnux.ji@ringcentral.com>
Date: Mon, 23 Dec 2024 13:34:47 +0800
Subject: [PATCH] misc: support dark theme for smart note plugin

---
 src/components/SideDrawerView/SmartNoteApp.tsx | 6 +++++-
 src/components/SideDrawerView/index.tsx        | 2 ++
 src/modules/SideDrawerUI/index.ts              | 4 +++-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/components/SideDrawerView/SmartNoteApp.tsx b/src/components/SideDrawerView/SmartNoteApp.tsx
index e9ae3bd9c..aea1741c5 100644
--- a/src/components/SideDrawerView/SmartNoteApp.tsx
+++ b/src/components/SideDrawerView/SmartNoteApp.tsx
@@ -1,6 +1,6 @@
 import React from 'react';
 import { dynamicLoad, useApp } from '@ringcentral/mfe-react';
-import { styled } from '@ringcentral/juno/foundation';
+import { styled, useTheme } from '@ringcentral/juno/foundation';
 
 const Container = styled.div`
   width: 100%;
@@ -22,7 +22,9 @@ export function SmartNoteApp({
   onClose,
   onAlert,
   smartNoteRemoteEntry,
+  themeType,
 }) {
+  const theme = useTheme();
   const SmartNotePlugin = useApp({
     name: 'SmartNotes',
     loader: () => {
@@ -43,6 +45,8 @@ export function SmartNoteApp({
         client={client}
         onClose={onClose}
         onAlert={onAlert}
+        theme={theme}
+        themeType={themeType}
       />
     </Container>
   );
diff --git a/src/components/SideDrawerView/index.tsx b/src/components/SideDrawerView/index.tsx
index bd71f3901..793cd8a50 100644
--- a/src/components/SideDrawerView/index.tsx
+++ b/src/components/SideDrawerView/index.tsx
@@ -17,6 +17,7 @@ export function SideDrawerView({
   show,
   onClose,
   onAlert,
+  themeType,
 }) {
   if (!show) {
     return null;
@@ -34,6 +35,7 @@ export function SideDrawerView({
         onClose={onClose}
         onAlert={onAlert}
         smartNoteRemoteEntry={smartNoteRemoteEntry}
+        themeType={themeType}
       />
     </StyledDrawer>
   );
diff --git a/src/modules/SideDrawerUI/index.ts b/src/modules/SideDrawerUI/index.ts
index 5b77dcd22..e58fa8edc 100644
--- a/src/modules/SideDrawerUI/index.ts
+++ b/src/modules/SideDrawerUI/index.ts
@@ -7,6 +7,7 @@ import { RcUIModuleV2, action, state, watch } from '@ringcentral-integration/cor
     'Locale',
     'SmartNotes',
     'Alert',
+    'Theme',
   ],
 })
 export class SideDrawerUI extends RcUIModuleV2 {
@@ -33,13 +34,14 @@ export class SideDrawerUI extends RcUIModuleV2 {
   }
 
   getUIProps() {
-    const { locale, smartNotes } = this._deps;
+    const { locale, smartNotes, theme } = this._deps;
     return {
       currentLocale: locale.currentLocale,
       smartNoteSession: smartNotes.session,
       show: this.show,
       smartNoteClient: smartNotes.smartNoteClient,
       smartNoteRemoteEntry: smartNotes.smartNoteMFERemoteEntry,
+      themeType: theme.themeType,
     };
   }