Skip to content

Commit

Permalink
Adding a uiSetting on the fly that can be used by code editors
Browse files Browse the repository at this point in the history
  • Loading branch information
kc13greiner committed Jun 1, 2023
1 parent b2355a9 commit ab8912e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ export class RenderingService {
darkMode = getSettingValue('theme:darkMode', settings, Boolean);
}

settings.user['theme:codeEditors'] = {
userValue: darkMode,
};

const themeVersion: ThemeVersion = 'v8';

const stylesheetPaths = getStylesheetPaths({
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/kibana_react/public/code_editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export type CodeEditorProps = Props;
* @see CodeEditorField to render a code editor in the same style as other EUI form fields.
*/
export const CodeEditor: React.FunctionComponent<Props> = (props) => {
const darkMode = useUiSetting<boolean>('theme:darkMode');
const darkMode = useUiSetting<boolean>('theme:codeEditors');
return (
<EuiErrorBoundary>
<React.Suspense fallback={<Fallback height={props.height} />}>
Expand All @@ -54,7 +54,7 @@ export const CodeEditor: React.FunctionComponent<Props> = (props) => {
* Renders a Monaco code editor in the same style as other EUI form fields.
*/
export const CodeEditorField: React.FunctionComponent<Props> = (props) => {
const darkMode = useUiSetting<boolean>('theme:darkMode');
const darkMode = useUiSetting<boolean>('theme:codeEditors');
return (
<EuiErrorBoundary>
<React.Suspense fallback={<Fallback height={props.height} />}>
Expand Down

0 comments on commit ab8912e

Please sign in to comment.