Skip to content

Commit

Permalink
refactor: rename themeProvider to dashboardTheme
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamNowotny committed Aug 19, 2024
1 parent 7a4454a commit a0a7724
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const themes: Record<string, Theme> = {
light: lightTheme,
};

const ThemeProvider = ({ popup }) => {
const DashboardTheme = ({ popup }) => {
const [viewConfig, setViewConfig] = useState<ViewConfig>({});
const [serviceStates, setServiceStates] = useState<ServiceStateItem[]>([]);

Expand All @@ -37,4 +37,4 @@ const ThemeProvider = ({ popup }) => {
);
};

export default ThemeProvider;
export default DashboardTheme;
4 changes: 2 additions & 2 deletions src/dashboard/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import core from 'common/core';
import logger from 'common/logger';
import * as React from 'react';
import { createRoot } from 'react-dom/client';
import ThemeProvider from './components/theme/themeProvider';
import DashboardTheme from './components/dashboardTheme/dashboardTheme';
import './dashboard.css';

core.init({ test: false });
logger.init({ prefix: 'dashboard', debug: false });

const container = document.getElementById('app');
if (!container) throw new Error("Could not find 'app' element");
createRoot(container).render(<ThemeProvider popup={false} />);
createRoot(container).render(<DashboardTheme popup={false} />);
4 changes: 2 additions & 2 deletions src/dashboard/popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import core from 'common/core';
import logger from 'common/logger';
import * as React from 'react';
import { createRoot } from 'react-dom/client';
import ThemeProvider from './components/theme/themeProvider';
import DashboardTheme from './components/dashboardTheme/dashboardTheme';
import './popup.css';

core.init({ test: false });
logger.init({ prefix: 'popup', debug: true });

const container = document.getElementById('app');
if (!container) throw new Error("Could not find 'app' element");
createRoot(container).render(<ThemeProvider popup={true} />);
createRoot(container).render(<DashboardTheme popup={true} />);
4 changes: 2 additions & 2 deletions src/settings/view/controller.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import angular from 'angular';
import app from 'settings/app';
import core from 'common/core';
import ThemeProvider from 'dashboard/components/theme/themeProvider';
import DashboardTheme from 'dashboard/components/dashboardTheme/dashboardTheme';
import { createRoot } from 'react-dom/client';
import React from 'react';

export default app.controller('ViewSettingsCtrl', function ($scope) {
const settingsDashboard = document.getElementById('settings-dashboard');
if (settingsDashboard) {
createRoot(settingsDashboard).render(<ThemeProvider popup={false} />);
createRoot(settingsDashboard).render(<DashboardTheme popup={false} />);
}

core.views.subscribe(function (config) {
Expand Down

0 comments on commit a0a7724

Please sign in to comment.