mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Rename Theme -> LensTheme for better intelisense
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
d7019d1426
commit
f06c4d1c12
@ -3,9 +3,9 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Theme } from "./store";
|
import type { LensTheme } from "./store";
|
||||||
|
|
||||||
const lensDarkTheme: Theme = {
|
const lensDarkTheme: LensTheme = {
|
||||||
"name": "Dark",
|
"name": "Dark",
|
||||||
"type": "dark",
|
"type": "dark",
|
||||||
"description": "Original Lens dark theme",
|
"description": "Original Lens dark theme",
|
||||||
|
|||||||
@ -2,9 +2,9 @@
|
|||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import type { Theme } from "./store";
|
import type { LensTheme } from "./store";
|
||||||
|
|
||||||
const lensLightTheme: Theme = {
|
const lensLightTheme: LensTheme = {
|
||||||
"name": "Light",
|
"name": "Light",
|
||||||
"type": "light",
|
"type": "light",
|
||||||
"description": "Original Lens light theme",
|
"description": "Original Lens light theme",
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import assert from "assert";
|
|||||||
|
|
||||||
export type ThemeId = string;
|
export type ThemeId = string;
|
||||||
|
|
||||||
export interface Theme {
|
export interface LensTheme {
|
||||||
name: string;
|
name: string;
|
||||||
type: "dark" | "light";
|
type: "dark" | "light";
|
||||||
colors: Record<string, string>;
|
colors: Record<string, string>;
|
||||||
@ -39,7 +39,7 @@ interface Dependencies {
|
|||||||
export class ThemeStore {
|
export class ThemeStore {
|
||||||
private terminalColorPrefix = "terminal";
|
private terminalColorPrefix = "terminal";
|
||||||
|
|
||||||
#themes = observable.map<ThemeId, Theme>({
|
#themes = observable.map<ThemeId, LensTheme>({
|
||||||
"lens-dark": lensDarkTheme,
|
"lens-dark": lensDarkTheme,
|
||||||
"lens-light": lensLightTheme,
|
"lens-light": lensLightTheme,
|
||||||
});
|
});
|
||||||
@ -66,9 +66,9 @@ export class ThemeStore {
|
|||||||
return this.dependencies.userStore.terminalTheme;
|
return this.dependencies.userStore.terminalTheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly defaultTheme: Theme;
|
private readonly defaultTheme: LensTheme;
|
||||||
|
|
||||||
@computed get activeTheme(): Theme {
|
@computed get activeTheme(): LensTheme {
|
||||||
return this.themes.get(this.activeThemeId) ?? this.defaultTheme;
|
return this.themes.get(this.activeThemeId) ?? this.defaultTheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ export class ThemeStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get themes() {
|
get themes() {
|
||||||
return this.#themes as ReadonlyDeep<Map<string, Theme>>;
|
return this.#themes as ReadonlyDeep<Map<string, LensTheme>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(protected readonly dependencies: Dependencies) {
|
constructor(protected readonly dependencies: Dependencies) {
|
||||||
@ -130,7 +130,7 @@ export class ThemeStore {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getThemeById(themeId: ThemeId): Theme | undefined {
|
getThemeById(themeId: ThemeId): LensTheme | undefined {
|
||||||
return this.themes.get(themeId);
|
return this.themes.get(themeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user