refactor(cc-dark-theme): migrate to the new DI architecture
Bug: twpowertools:226
Change-Id: I735013393d1d99cadee48399bba53a22fe59e27c
diff --git a/src/entryPoints/communityConsole/contentScripts/main.ts b/src/entryPoints/communityConsole/contentScripts/main.ts
index ff70c11..fb6fa17 100644
--- a/src/entryPoints/communityConsole/contentScripts/main.ts
+++ b/src/entryPoints/communityConsole/contentScripts/main.ts
@@ -1,5 +1,6 @@
import DependenciesProviderSingleton, {
AutoRefreshDependency,
+ OptionsProviderDependency,
} from '../../../common/architecture/dependenciesProvider/DependenciesProvider';
import { Context } from '../../../common/architecture/entrypoint/Context';
import {
@@ -21,6 +22,10 @@
// Run legacy Javascript entry point
import '../../../contentScripts/communityConsole/main';
+import CCDarkThemeEcAppHandler from '../../../features/ccDarkTheme/nodeWatcherHandlers/ecApp.handler';
+import CCDarkThemeReportDialogHandler from '../../../features/ccDarkTheme/nodeWatcherHandlers/reportDialog.handler';
+import CCDarkThemeUnifiedProfilesIframeHandler from '../../../features/ccDarkTheme/nodeWatcherHandlers/unifiedProfilesIframe.handler';
+import ReportDialogColorThemeFix from '../../../features/ccDarkTheme/core/logic/reportDialog';
const scriptRunner = createScriptRunner();
scriptRunner.run();
@@ -28,6 +33,9 @@
function createScriptRunner() {
const dependenciesProvider = DependenciesProviderSingleton.getInstance();
const autoRefresh = dependenciesProvider.getDependency(AutoRefreshDependency);
+ const optionsProvider = dependenciesProvider.getDependency(
+ OptionsProviderDependency,
+ );
const context: Context = {
page: ScriptPage.CommunityConsole,
@@ -50,6 +58,18 @@
'autoRefreshThreadListHide',
new AutoRefreshThreadListHideHandler(autoRefresh),
],
+ ['ccDarkThemeEcApp', new CCDarkThemeEcAppHandler(optionsProvider)],
+ [
+ 'ccDarkThemeReportDialog',
+ new CCDarkThemeReportDialogHandler(
+ optionsProvider,
+ new ReportDialogColorThemeFix(),
+ ),
+ ],
+ [
+ 'ccDarkThemeUnifiedProfilesIframe',
+ new CCDarkThemeUnifiedProfilesIframeHandler(optionsProvider),
+ ],
]),
),