feat: refactor theme handling and update TODO.md
- Replaced references from theme-config to ui-config for better organization and clarity in theme management. - Updated Solarized icon in ui-config to a pill emoji for improved visual representation. - Marked the Solarized icon correction task as complete in TODO.md. - Deleted the now redundant theme-config file to streamline the codebase.
This commit is contained in:
2
TODO.md
2
TODO.md
@@ -20,11 +20,11 @@
|
||||
- [x] **Légende calendrier et padding** - Corriger l'espacement et la légende du calendrier dans daily
|
||||
- [x] **EditModal task couleur calendrier** - Problème de couleur en ajout de taches dans tous les icones calendriers; colmler au thème
|
||||
- [x] **Weekly deux boutons actualiser** - Corriger la duplication des boutons d'actualisation
|
||||
- [x] **Solarized ne doit pas être un soleil** - Corriger l'icône du thème Solarized
|
||||
- [ ] **Settings : tag icônes actions** - Icônes trop petites dans les actions des tags
|
||||
- [ ] **Settings intégration : icônes** - Problème avec les icônes "Arrêté" et "Actif" : doivent etre les memes
|
||||
- [ ] **Settings backup UI** - Revoir l'UI pour coller au style des intégrations
|
||||
- [ ] **Emoji interdit dans UI** - Vérifier et supprimer toutes les emojis dans l'interface, remplacer par lib d'icone
|
||||
- [ ] **Solarized ne doit pas être un soleil** - Corriger l'icône du thème Solarized
|
||||
- [ ] **AlertBanner : hover et bug** - Corriger les problèmes de hover et bugs
|
||||
- [ ] **Deux modales** - Problème de duplication de modales
|
||||
- [ ] **Control panel et select** - Problème avec les contrôles et sélecteurs
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { userPreferencesService } from '@/services/core/user-preferences';
|
||||
import { KanbanFilters, ViewPreferences, ColumnVisibility, TaskStatus } from '@/lib/types';
|
||||
import { Theme } from '@/lib/theme-config';
|
||||
import { Theme } from '@/lib/ui-config';
|
||||
import { revalidatePath } from 'next/cache';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { authOptions } from '@/lib/auth';
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Button } from '@/components/ui/Button'
|
||||
import { Input } from '@/components/ui/Input'
|
||||
import { TowerLogo } from '@/components/TowerLogo'
|
||||
import { TowerBackground } from '@/components/TowerBackground'
|
||||
import { THEME_CONFIG } from '@/lib/theme-config'
|
||||
import { THEME_CONFIG } from '@/lib/ui-config'
|
||||
import { useTheme } from '@/contexts/ThemeContext'
|
||||
import { PRESET_BACKGROUNDS } from '@/lib/ui-config'
|
||||
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
// Types de thèmes
|
||||
export type Theme = 'light' | 'dark' | 'dracula' | 'monokai' | 'nord' | 'gruvbox' | 'tokyo_night' | 'catppuccin' | 'rose_pine' | 'one_dark' | 'material' | 'solarized';
|
||||
|
||||
// Configuration des thèmes
|
||||
export const THEME_CONFIG = {
|
||||
// Thème par défaut
|
||||
default: 'dark' as Theme,
|
||||
|
||||
// Thème light
|
||||
light: 'light' as Theme,
|
||||
|
||||
// Liste de tous les thèmes dark disponibles
|
||||
darkThemes: [
|
||||
'dark',
|
||||
'dracula',
|
||||
'monokai',
|
||||
'nord',
|
||||
'gruvbox',
|
||||
'tokyo_night',
|
||||
'catppuccin',
|
||||
'rose_pine',
|
||||
'one_dark',
|
||||
'material',
|
||||
'solarized'
|
||||
] as Theme[],
|
||||
|
||||
// Tous les thèmes disponibles
|
||||
allThemes: [
|
||||
'light',
|
||||
'dark',
|
||||
'dracula',
|
||||
'monokai',
|
||||
'nord',
|
||||
'gruvbox',
|
||||
'tokyo_night',
|
||||
'catppuccin',
|
||||
'rose_pine',
|
||||
'one_dark',
|
||||
'material',
|
||||
'solarized'
|
||||
] as Theme[],
|
||||
|
||||
// Métadonnées des thèmes (déplacées vers ui-config.ts)
|
||||
metadata: {
|
||||
light: { name: 'Light', description: 'Thème clair par défaut', icon: '☀️' },
|
||||
dark: { name: 'Dark', description: 'Thème sombre classique', icon: '🌙' },
|
||||
dracula: { name: 'Dracula', description: 'Inspiré du thème Dracula', icon: '🧛' },
|
||||
monokai: { name: 'Monokai', description: 'Inspiré du thème Monokai', icon: '🎨' },
|
||||
nord: { name: 'Nord', description: 'Palette Nord arctique', icon: '❄️' },
|
||||
gruvbox: { name: 'Gruvbox', description: 'Palette Gruvbox retro', icon: '🎭' },
|
||||
tokyo_night: { name: 'Tokyo Night', description: 'Nuit tokyoïte', icon: '🌃' },
|
||||
catppuccin: { name: 'Catppuccin', description: 'Palette pastel douce', icon: '🐱' },
|
||||
rose_pine: { name: 'Rose Pine', description: 'Palette rose et pin', icon: '🌹' },
|
||||
one_dark: { name: 'One Dark', description: 'Inspiré d\'Atom One Dark', icon: '🌑' },
|
||||
material: { name: 'Material', description: 'Inspiré de Material Design', icon: '📱' },
|
||||
solarized: { name: 'Solarized', description: 'Palette Solarized', icon: '☀️' }
|
||||
}
|
||||
} as const;
|
||||
|
||||
// Fonctions utilitaires
|
||||
export const getNextDarkTheme = (currentTheme: Theme): Theme => {
|
||||
const currentIndex = THEME_CONFIG.darkThemes.indexOf(currentTheme);
|
||||
if (currentIndex === -1) {
|
||||
return THEME_CONFIG.darkThemes[0];
|
||||
}
|
||||
const nextIndex = (currentIndex + 1) % THEME_CONFIG.darkThemes.length;
|
||||
return THEME_CONFIG.darkThemes[nextIndex];
|
||||
};
|
||||
|
||||
export const isDarkTheme = (theme: Theme): boolean => {
|
||||
return THEME_CONFIG.darkThemes.includes(theme);
|
||||
};
|
||||
|
||||
export const getThemeMetadata = (theme: Theme) => {
|
||||
return THEME_CONFIG.metadata[theme] || { name: theme, description: 'Thème personnalisé', icon: '🎨' };
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
import { TfsConfig } from '@/services/integrations/tfs/tfs';
|
||||
import { Theme } from './theme-config';
|
||||
import { Theme } from './ui-config';
|
||||
|
||||
// Réexporter Theme pour les autres modules
|
||||
export type { Theme };
|
||||
|
||||
@@ -56,7 +56,7 @@ export const THEME_METADATA: Record<Theme, { name: string; description: string;
|
||||
rose_pine: { name: 'Rose Pine', description: 'Palette rose et pin', icon: '🌹' },
|
||||
one_dark: { name: 'One Dark', description: 'Inspiré d\'Atom One Dark', icon: '🌑' },
|
||||
material: { name: 'Material', description: 'Inspiré de Material Design', icon: '📱' },
|
||||
solarized: { name: 'Solarized', description: 'Palette Solarized', icon: '☀️' }
|
||||
solarized: { name: 'Solarized', description: 'Palette Solarized', icon: '💊' }
|
||||
};
|
||||
|
||||
// Fonctions utilitaires pour les thèmes
|
||||
|
||||
Reference in New Issue
Block a user