Streamline theme management and improve AppearanceSettings component

This commit is contained in:
2025-10-11 17:46:12 +02:00
parent 8bd9eb2236
commit bcc5d2588a
7 changed files with 65 additions and 42 deletions

View File

@@ -1,21 +1,14 @@
import React from 'react';
import { Text, Switch, Group, Box } from '@mantine/core';
import { useTheme } from '../../../contexts/ThemeContext';
import { Theme } from '@/types/models';
import { useTheme } from '../../../contexts/ThemeContext';
interface AppearanceSettingsProps {
onThemeChange: (newTheme: Theme) => void;
}
const AppearanceSettings: React.FC<AppearanceSettingsProps> = ({
onThemeChange,
}) => {
const AppearanceSettings: React.FC = () => {
const { colorScheme, updateColorScheme } = useTheme();
const handleThemeChange = (): void => {
const newTheme = colorScheme === 'dark' ? Theme.Light : Theme.Dark;
updateColorScheme(newTheme);
onThemeChange(newTheme);
};
return (