mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-15 04:43:36 +00:00
fix(docker): use resolveTermixThemeColors for Docker console terminal background (#883)
This commit is contained in:
@@ -20,6 +20,7 @@ import type { SSHHost } from "@/types";
|
|||||||
import { isElectron } from "@/main-axios.ts";
|
import { isElectron } from "@/main-axios.ts";
|
||||||
import { SimpleLoader } from "@/lib/SimpleLoader.tsx";
|
import { SimpleLoader } from "@/lib/SimpleLoader.tsx";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { resolveTermixThemeColors } from "@/features/terminal/terminal-theme";
|
||||||
import {
|
import {
|
||||||
TERMINAL_THEMES,
|
TERMINAL_THEMES,
|
||||||
DEFAULT_TERMINAL_CONFIG,
|
DEFAULT_TERMINAL_CONFIG,
|
||||||
@@ -49,26 +50,10 @@ export function ConsoleTerminal({
|
|||||||
[hostConfig.terminalConfig],
|
[hostConfig.terminalConfig],
|
||||||
);
|
);
|
||||||
|
|
||||||
const isDarkMode =
|
|
||||||
appTheme === "dark" ||
|
|
||||||
appTheme === "dracula" ||
|
|
||||||
appTheme === "gentlemansChoice" ||
|
|
||||||
appTheme === "midnightEspresso" ||
|
|
||||||
appTheme === "catppuccinMocha" ||
|
|
||||||
(appTheme === "system" &&
|
|
||||||
window.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
||||||
|
|
||||||
const themeColors = React.useMemo(() => {
|
const themeColors = React.useMemo(() => {
|
||||||
const activeTheme = terminalConfig.theme;
|
const activeTheme = terminalConfig.theme;
|
||||||
if (activeTheme === "termix") {
|
return resolveTermixThemeColors(activeTheme, appTheme);
|
||||||
return isDarkMode
|
}, [terminalConfig.theme, appTheme]);
|
||||||
? TERMINAL_THEMES.termixDark.colors
|
|
||||||
: TERMINAL_THEMES.termixLight.colors;
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
TERMINAL_THEMES[activeTheme]?.colors ?? TERMINAL_THEMES.termixDark.colors
|
|
||||||
);
|
|
||||||
}, [terminalConfig.theme, isDarkMode]);
|
|
||||||
|
|
||||||
const [isConnected, setIsConnected] = React.useState(false);
|
const [isConnected, setIsConnected] = React.useState(false);
|
||||||
const [isConnecting, setIsConnecting] = React.useState(false);
|
const [isConnecting, setIsConnecting] = React.useState(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user