From 6438374258b8d48d252596afcb5cdd69c29e9cfb Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 9 Jul 2025 11:26:27 +0200 Subject: [PATCH] Fix mobile responsiveness and implement enhanced theme system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed mobile gallery login box sizing and layout - Fixed header button layout for mobile screens - Fixed duplicate logo issue on logout - Fixed '0' rendering when upload button is hidden - Fixed horizontal scrolling on small screens - Implemented comprehensive theme system with gallery layouts - Added 6 different gallery layouts: Grid, Masonry, Carousel, Timeline, Hero, Mosaic - Created enhanced theme customizer with layout selection - Added theme presets for different event types - Updated event creation with theme preview and customization - Fixed all TypeScript compilation errors - Added missing translation keys for create event page - Added translations for theme customization features 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../src/components/admin/ThemeCustomizer.tsx | 8 +- .../admin/ThemeCustomizerEnhanced.tsx | 587 ++++++++++++++++++ .../src/components/gallery/GalleryLayout.tsx | 110 ++-- .../src/components/gallery/GalleryView.tsx | 40 +- .../gallery/PhotoGridWithLayouts.tsx | 238 +++++++ .../gallery/layouts/BaseGalleryLayout.tsx | 16 + .../gallery/layouts/CarouselGalleryLayout.tsx | 187 ++++++ .../gallery/layouts/GridGalleryLayout.tsx | 146 +++++ .../gallery/layouts/HeroGalleryLayout.tsx | 150 +++++ .../gallery/layouts/MasonryGalleryLayout.tsx | 167 +++++ .../gallery/layouts/MosaicGalleryLayout.tsx | 222 +++++++ .../gallery/layouts/TimelineGalleryLayout.tsx | 156 +++++ .../src/components/gallery/layouts/index.ts | 7 + frontend/src/contexts/ThemeContext.tsx | 123 ++-- frontend/src/contexts/index.ts | 3 +- frontend/src/i18n/locales/de.json | 15 +- frontend/src/i18n/locales/en.json | 5 +- frontend/src/index.css | 31 +- frontend/src/pages/GalleryPage.tsx | 22 +- frontend/src/pages/admin/BrandingPage.tsx | 6 +- .../pages/admin/CreateEventPageEnhanced.tsx | 503 +++++++++++++++ frontend/src/pages/admin/index.ts | 2 +- frontend/src/types/theme.types.ts | 222 +++++++ 23 files changed, 2798 insertions(+), 168 deletions(-) create mode 100644 frontend/src/components/admin/ThemeCustomizerEnhanced.tsx create mode 100644 frontend/src/components/gallery/PhotoGridWithLayouts.tsx create mode 100644 frontend/src/components/gallery/layouts/BaseGalleryLayout.tsx create mode 100644 frontend/src/components/gallery/layouts/CarouselGalleryLayout.tsx create mode 100644 frontend/src/components/gallery/layouts/GridGalleryLayout.tsx create mode 100644 frontend/src/components/gallery/layouts/HeroGalleryLayout.tsx create mode 100644 frontend/src/components/gallery/layouts/MasonryGalleryLayout.tsx create mode 100644 frontend/src/components/gallery/layouts/MosaicGalleryLayout.tsx create mode 100644 frontend/src/components/gallery/layouts/TimelineGalleryLayout.tsx create mode 100644 frontend/src/components/gallery/layouts/index.ts create mode 100644 frontend/src/pages/admin/CreateEventPageEnhanced.tsx create mode 100644 frontend/src/types/theme.types.ts 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

+