Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
chore: fix last issues
Browse files Browse the repository at this point in the history
  • Loading branch information
koen1711 committed Apr 24, 2024
1 parent f6c2199 commit 8fa7d34
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { Component } from "@angular/core";
import { CodeEditorState } from "../../../../state/code-editor.state";
import {editor} from "monaco-editor";
import IStandaloneEditorConstructionOptions = editor.IStandaloneEditorConstructionOptions;

@Component({
selector: "app-code-view",
templateUrl: "./code-view.component.html",
styleUrls: ["./code-view.component.scss"],
})
export class CodeViewComponent {
editorOptions: any = {
editorOptions: IStandaloneEditorConstructionOptions = {
language: "cpp",
readOnly: true,
automaticLayout: true,
Expand Down
4 changes: 2 additions & 2 deletions src/app/modules/code-editor-cpp/code-editor-cpp.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { WorkspaceService } from "../../services/workspace.service";
import { MonacoEditorModule } from "ngx-monaco-editor-v2";
import { AppState } from "../../state/app.state";
import {editor} from "monaco-editor";
import EditorOption = editor.EditorOption;
import IStandaloneEditorConstructionOptions = editor.IStandaloneEditorConstructionOptions;

@Component({
standalone: true,
Expand All @@ -17,7 +17,7 @@ import EditorOption = editor.EditorOption;
imports: [CommonModule, SharedModule, CoreModule, MonacoEditorModule],
})
export class CodeEditorCppPage implements AfterViewInit {
editorOptions = {
editorOptions: IStandaloneEditorConstructionOptions = {
language: "cpp",
automaticLayout: true,
theme: "vs"
Expand Down
18 changes: 5 additions & 13 deletions src/app/modules/code-editor-python/code-editor-python.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ import { AppState } from "../../state/app.state";
imports: [CommonModule, SharedModule, CoreModule, MonacoEditorModule],
})
export class CodeEditorPythonPage implements AfterViewInit {
editorOptions: any = {
editorOptions = {
language: "python",
automaticLayout: true,
theme: "vs"
};

constructor(
Expand All @@ -28,23 +29,14 @@ export class CodeEditorPythonPage implements AfterViewInit {
// check if we are currently in dark mode
const isDarkMode = appState.selectedTheme === "dark";
if (isDarkMode) {
this.editorOptions = {
...this.editorOptions,
theme: "vs-dark",
};
this.editorOptions.theme = "vs-dark"
}

appState.selectedTheme$.subscribe((theme) => {
if (theme === "dark") {
this.editorOptions = {
...this.editorOptions,
theme: "vs-dark",
};
this.editorOptions.theme = "vs-dark"
} else {
this.editorOptions = {
...this.editorOptions,
theme: "vs",
};
this.editorOptions.theme= "vs"
}
});
}
Expand Down

0 comments on commit 8fa7d34

Please sign in to comment.