mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Simplify Preferences page
This commit is contained in:
3 files changed
+25
-43
No files matched your search
+3
-9
@@ -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: '选择浅色、深色或系统主题偏好。',
|
||||
|
||||
|
||||
@@ -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
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user