diff --git a/frontend/src/components/admin/ThemeCustomizer.tsx b/frontend/src/components/admin/ThemeCustomizer.tsx index 952024d..1579d60 100644 --- a/frontend/src/components/admin/ThemeCustomizer.tsx +++ b/frontend/src/components/admin/ThemeCustomizer.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect, useRef } from 'react'; import { Palette, RotateCcw, Check, Upload } from 'lucide-react'; import { Button, Card, Input } from '../common'; -import { PRESET_THEMES, type ThemeConfig } from '../../contexts/ThemeContext'; +import { GALLERY_THEME_PRESETS, type ThemeConfig } from '../../contexts/ThemeContext'; import { settingsService } from '../../services/settings.service'; import { toast } from 'react-toastify'; @@ -43,7 +43,7 @@ export const ThemeCustomizer: React.FC = ({ }; const handlePresetSelect = (presetKey: string) => { - const preset = PRESET_THEMES[presetKey]; + const preset = GALLERY_THEME_PRESETS[presetKey]; console.log('Selecting preset:', presetKey, preset); // Debug log if (preset) { setSelectedPreset(presetKey); @@ -63,7 +63,7 @@ export const ThemeCustomizer: React.FC = ({ }; const handleReset = () => { - const defaultPreset = PRESET_THEMES['default']; + const defaultPreset = GALLERY_THEME_PRESETS['default']; if (defaultPreset) { setSelectedPreset('default'); setLocalTheme(defaultPreset.config); @@ -97,7 +97,7 @@ export const ThemeCustomizer: React.FC = ({

Preset Themes

- {Object.entries(PRESET_THEMES).map(([key, theme]) => ( + {Object.entries(GALLERY_THEME_PRESETS).map(([key, theme]) => ( + ))} +
+
+ + {/* Gallery Layout */} + {showGalleryLayouts && ( + +

+ + Gallery Layout +

+
+ {(Object.keys(layoutIcons) as GalleryLayoutType[]).map((layout) => ( + + ))} +
+ + {/* Layout-specific settings */} + {localTheme.galleryLayout && ( +
+

Layout Settings

+ + {/* Common settings */} +
+
+ + +
+ +
+ + +
+
+ + {/* Grid specific */} + {localTheme.galleryLayout === 'grid' && ( +
+ +
+
+ + updateGallerySettings('gridColumns', { + ...localTheme.gallerySettings?.gridColumns, + mobile: parseInt(e.target.value) + })} + /> +
+
+ + updateGallerySettings('gridColumns', { + ...localTheme.gallerySettings?.gridColumns, + tablet: parseInt(e.target.value) + })} + /> +
+
+ + updateGallerySettings('gridColumns', { + ...localTheme.gallerySettings?.gridColumns, + desktop: parseInt(e.target.value) + })} + /> +
+
+
+ )} + + {/* Carousel specific */} + {localTheme.galleryLayout === 'carousel' && ( + <> +
+ +
+ {localTheme.gallerySettings?.carouselAutoplay && ( +
+ + updateGallerySettings('carouselInterval', parseInt(e.target.value) * 1000)} + /> +
+ )} + + )} + + {/* Timeline specific */} + {localTheme.galleryLayout === 'timeline' && ( +
+ + +
+ )} +
+ )} +
+ )} + + {/* Color Customization */} + +

+ + Colors +

+
+
+ +
+ handleChange('primaryColor', e.target.value)} + className="h-10 w-20 rounded border border-neutral-300 cursor-pointer" + /> + handleChange('primaryColor', e.target.value)} + placeholder="#5C8762" + className="flex-1" + /> +
+
+ +
+ +
+ handleChange('accentColor', e.target.value)} + className="h-10 w-20 rounded border border-neutral-300 cursor-pointer" + /> + handleChange('accentColor', e.target.value)} + placeholder="#22c55e" + className="flex-1" + /> +
+
+ +
+ +
+ handleChange('backgroundColor', e.target.value)} + className="h-10 w-20 rounded border border-neutral-300 cursor-pointer" + /> + handleChange('backgroundColor', e.target.value)} + placeholder="#fafafa" + className="flex-1" + /> +
+
+ +
+ +
+ handleChange('textColor', e.target.value)} + className="h-10 w-20 rounded border border-neutral-300 cursor-pointer" + /> + handleChange('textColor', e.target.value)} + placeholder="#171717" + className="flex-1" + /> +
+
+
+
+ + {/* Typography & Style */} + +

+ + Typography & Style +

+
+
+
+ + +
+ +
+ + +
+
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+
+ + {/* Custom CSS */} + +

Custom CSS

+