feat: add Food Gallery category to image gallery
- Add 'food' category filter in ImageGallery component
- Add '🍽️ Food Gallery' section in sectionCategories
- Update filteredImages logic to handle food category
- Clean up duplicate logo/favicon images in database
This commit is contained in:
@@ -272,6 +272,7 @@ function ImageGallery({ images, onDelete }: { images: Image[]; onDelete: (id: nu
|
||||
|
||||
const sectionCategories = [
|
||||
{ key: 'slides', label: '🎞️ Slideshow Gallery', filter: (i: Image) => i.category === 'slides' || i.location_target === 'slides' },
|
||||
{ key: 'food', label: '🍽️ Food Gallery', filter: (i: Image) => i.category === 'food' || i.location_target === 'food' },
|
||||
{ key: 'calendar', label: '📅 Calendar Events Gallery', filter: (i: Image) => i.category === 'calendar' || i.location_target === 'calendar' },
|
||||
{ key: 'social', label: '🎪 Social Events Gallery', filter: (i: Image) => i.category === 'social' || i.location_target === 'social' },
|
||||
];
|
||||
@@ -290,6 +291,7 @@ function ImageGallery({ images, onDelete }: { images: Image[]; onDelete: (id: nu
|
||||
const filteredImages = images.filter((img) => {
|
||||
if (selectedCategory === 'all') return true;
|
||||
if (selectedCategory === 'rooms') return img.category === 'rooms' || img.location_target?.startsWith('room-');
|
||||
if (selectedCategory === 'food') return img.category === 'food' || img.location_target === 'food';
|
||||
return img.category === selectedCategory || img.location_target === selectedCategory;
|
||||
});
|
||||
|
||||
@@ -387,7 +389,7 @@ function ImageGallery({ images, onDelete }: { images: Image[]; onDelete: (id: nu
|
||||
border: `1px solid ${C.border}`, background: '#fff',
|
||||
boxShadow: C.shadow,
|
||||
}}>
|
||||
{['all', 'slides', 'calendar', 'social', 'rooms', 'other'].map((cat) => (
|
||||
{['all', 'slides', 'food', 'calendar', 'social', 'rooms', 'other'].map((cat) => (
|
||||
<Btn
|
||||
key={cat}
|
||||
onClick={() => setSelectedCategory(cat)}
|
||||
|
||||
Reference in New Issue
Block a user