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 -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>
);
}