feat(settings): add appearance settings with dark mode toggle and translations

- Introduced new appearance settings page with a dark mode toggle feature.
- Added localization support for English, Spanish, and Portuguese in appearance settings.
- Removed the ThemeSelector component and updated PreferenceSelector accordingly.
This commit is contained in:
chamiakJ
2025-05-15 07:56:15 +05:30
parent 33c15ac138
commit 536c1c37b1
11 changed files with 77 additions and 35 deletions

View File

@@ -1,28 +0,0 @@
// ThemeSelector.tsx
import { Button } from 'antd';
import React from 'react';
import { useAppDispatch } from '@/hooks/useAppDispatch';
import { useAppSelector } from '@/hooks/useAppSelector';
import { toggleTheme } from './themeSlice';
import { MoonOutlined, SunOutlined } from '@ant-design/icons';
const ThemeSelector = () => {
const themeMode = useAppSelector(state => state.themeReducer.mode);
const dispatch = useAppDispatch();
const handleDarkModeToggle = () => {
dispatch(toggleTheme());
};
return (
<Button
type={themeMode === 'dark' ? 'primary' : 'default'}
icon={themeMode === 'dark' ? <SunOutlined /> : <MoonOutlined />}
shape="circle"
onClick={handleDarkModeToggle}
className="transition-all duration-300" // Optional: add smooth transition
/>
);
};
export default ThemeSelector;