Skip to content

Commit

Permalink
docs: update info about creating new themes
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamNowotny committed Aug 30, 2024
1 parent 690fc21 commit cbb01f2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions docs/new-dashboard.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ In a simple case you can just modify the CSS styles and still use `Pipelines` co

Use React context to get:

- [viewConfig](../src/common/types.ts#L88) - view configuration as shown on _View_ tab in settings
- [serviceState](../src/common/types.ts#L80) array - current state of monitored services and pipelines
- [viewConfig](../src/common/types.ts#L10) - view configuration as shown on _View_ tab in settings
- [serviceState](../src/common/types.ts#L96) array - current state of monitored services and pipelines

Example code:

```js
import { ServiceStateContext, ViewConfigContext, ThemeProps } from 'dashboard/types';
import { ServiceStateContext, ViewConfigContext, ThemeProps } from 'common/components/react-types';

export default ({ popup }: ThemeProps) => {
const viewConfig = useContext(ViewConfigContext);
Expand All @@ -30,8 +30,6 @@ export default ({ popup }: ThemeProps) => {

## Registration

After implementing the React component you need to register the theme in [dashboard/components/themeProvider](../src/dashboard/components/theme/themeProvider.tsx#L8).
After implementing the React component you need to register the theme in [dashboard/components/dashboardTheme](../src/dashboard/components/dashboardTheme.tsx#L6).

To be able to select the new theme, the next step is to add it to [theme selection options](../src/settings/view/view.html#L4-L22)

**Note**: The settings page still uses Angular 1 framework and is not compiled with Vite. Run `npm run dist` and load extension to see changes.
To be able to select the new theme, the next step is to add it to [theme selection options](../src/options/pages/viewPage.tsx#L26)

0 comments on commit cbb01f2

Please sign in to comment.