Simplify Preferences page

This commit is contained in:
Alex Gleason committed 2025-09-19 19:54:23 -05:00
1 parent f67d6dbfc5
commit bd5373f57b
3 files changed
+25 -43

No files matched your search

+3 -9
View File
@@ -19,9 +19,7 @@ const resources = {
// Preferences Page
preferencesDescription: 'Manage your general application preferences and appearance settings.',
// Appearance Section
appearance: 'Appearance',
appearanceDescription: 'Customize how the application looks and feels.',
// Theme Section
theme: 'Theme',
themeDescription: 'Choose between light, dark, or system theme preference.',
@@ -314,9 +312,7 @@ const resources = {
// Preferences Page
preferencesDescription: 'Gerencie suas preferências gerais da aplicação e configurações de aparência.',
// Appearance Section
appearance: 'Aparência',
appearanceDescription: 'Personalize como a aplicação se parece e funciona.',
// Theme Section
theme: 'Tema',
themeDescription: 'Escolha entre preferência de tema claro, escuro ou do sistema.',
@@ -609,9 +605,7 @@ const resources = {
// Preferences Page
preferencesDescription: '管理您的应用程序偏好设置和外观设置。',
// Appearance Section
appearance: '外观',
appearanceDescription: '自定义应用程序的外观和感觉。',
// Theme Section
theme: '主题',
themeDescription: '选择浅色、深色或系统主题偏好。',
+3 -7
View File
@@ -13,14 +13,11 @@ describe('Preferences', () => {
// Should show the preferences title
expect(screen.getByText('Preferences')).toBeInTheDocument();
// Should show appearance section
expect(screen.getByText('Appearance')).toBeInTheDocument();
// Should show theme and language labels
// Should show theme and language labels at top level
expect(screen.getByText('Theme')).toBeInTheDocument();
expect(screen.getByText('Language')).toBeInTheDocument();
// Should show language picker
expect(screen.getByRole('combobox')).toBeInTheDocument();
});
@@ -34,7 +31,6 @@ describe('Preferences', () => {
// Check for key translated strings
expect(screen.getByText('Manage your general application preferences and appearance settings.')).toBeInTheDocument();
expect(screen.getByText('Customize how the application looks and feels.')).toBeInTheDocument();
expect(screen.getByText('Select your preferred language for the interface.')).toBeInTheDocument();
});
});
+19 -27
View File
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
import { Button } from "@/components/ui/button";
import { ThemePicker } from "@/components/ThemePicker";
import { LanguagePicker } from "@/components/LanguagePicker";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Label } from "@/components/ui/label";
import { useIsMobile } from "@/hooks/useIsMobile";
import { useNavigate } from "react-router-dom";
@@ -50,35 +50,27 @@ export function Preferences() {
</div>
)}
<Card>
<CardHeader>
<CardTitle>{t('appearance')}</CardTitle>
<CardDescription>
{t('appearanceDescription')}
</CardDescription>
</CardHeader>
<CardContent className="space-y-6">
<div className="space-y-2">
<Label htmlFor="theme-picker">{t('theme')}</Label>
<div className="w-full max-w-xs">
<ThemePicker />
</div>
<p className="text-sm text-muted-foreground">
{t('themeDescription')}
</p>
<div className="space-y-6">
<div className="space-y-2">
<Label htmlFor="theme-picker">{t('theme')}</Label>
<div className="w-full max-w-xs">
<ThemePicker />
</div>
<p className="text-sm text-muted-foreground">
{t('themeDescription')}
</p>
</div>
<div className="space-y-2">
<Label htmlFor="language-picker">{t('language')}</Label>
<div className="w-full max-w-xs">
<LanguagePicker />
</div>
<p className="text-sm text-muted-foreground">
{t('languageDescription')}
</p>
<div className="space-y-2">
<Label htmlFor="language-picker">{t('language')}</Label>
<div className="w-full max-w-xs">
<LanguagePicker />
</div>
</CardContent>
</Card>
<p className="text-sm text-muted-foreground">
{t('languageDescription')}
</p>
</div>
</div>
</div>
);
}