chore: refactor project structure and clean up unused components
- Updated `TODO.md` to reflect new testing tasks and final structure expectations. - Simplified TypeScript path mappings in `tsconfig.json` for better clarity. - Revised business logic separation rules in `.cursor/rules` to align with new directory structure. - Deleted unused client components and services to streamline the codebase. - Adjusted import paths in scripts to match the new structure.
This commit is contained in:
42
src/components/ui/FontSizeToggle.tsx
Normal file
42
src/components/ui/FontSizeToggle.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
'use client';
|
||||
|
||||
import { useUserPreferences } from '@/contexts/UserPreferencesContext';
|
||||
|
||||
export function FontSizeToggle() {
|
||||
const { preferences, toggleFontSize } = useUserPreferences();
|
||||
|
||||
// Icône pour la taille de police
|
||||
const getFontSizeIcon = () => {
|
||||
switch (preferences.viewPreferences.fontSize) {
|
||||
case 'small':
|
||||
return 'A';
|
||||
case 'large':
|
||||
return 'A';
|
||||
default:
|
||||
return 'A';
|
||||
}
|
||||
};
|
||||
|
||||
const getFontSizeScale = () => {
|
||||
switch (preferences.viewPreferences.fontSize) {
|
||||
case 'small':
|
||||
return 'text-xs';
|
||||
case 'large':
|
||||
return 'text-lg';
|
||||
default:
|
||||
return 'text-sm';
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<button
|
||||
onClick={toggleFontSize}
|
||||
className="flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-mono transition-all bg-[var(--card)] text-[var(--muted-foreground)] border border-[var(--border)] hover:border-[var(--primary)]/50 hover:text-[var(--primary)]"
|
||||
title={`Font size: ${preferences.viewPreferences.fontSize} (click to cycle)`}
|
||||
>
|
||||
<span className={`font-mono font-bold ${getFontSizeScale()}`}>
|
||||
{getFontSizeIcon()}
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user