diff --git a/src/app/components/nav/Header.tsx b/src/app/components/nav/Header.tsx index fd98cd8..48a407d 100644 --- a/src/app/components/nav/Header.tsx +++ b/src/app/components/nav/Header.tsx @@ -17,8 +17,6 @@ import { } from '@headlessui/react' import { Bars3Icon, - ShoppingBagIcon, - UsersIcon, UserCircleIcon, XMarkIcon, ArrowRightOnRectangleIcon, @@ -29,12 +27,6 @@ import { ChevronDownIcon } from '@heroicons/react/20/solid' import useAuthStore from '../../store/authStore'; import { Avatar } from '../avatar'; -// Replace current shopItems definition with detailed version (adds icon & description) -const shopItems = [ - { name: 'VIP', href: '/shop/vip', description: 'Exclusive VIP shop', icon: ShoppingBagIcon }, - { name: 'Public', href: '/shop/public', description: 'Open catalog for everyone', icon: UsersIcon }, -]; - const informationItems = [ { name: 'Affiliate-Links', href: '/affiliate-links', description: 'Browse our partner links' }, { name: 'Memberships', href: '/memberships', description: 'Explore membership options' }, @@ -42,12 +34,10 @@ const informationItems = [ ]; const navLinks = [ + { name: 'Shop', href: '/shop' }, { name: 'News', href: '/news' }, ]; -// Toggle visibility of Shop navigation across header (desktop + mobile) -const showShop = false; - export default function Header() { const [mobileMenuOpen, setMobileMenuOpen] = useState(false) const [isDark, setIsDark] = useState(false) @@ -250,47 +240,6 @@ export default function Header() { - {/* Shop dropdown stays first (hidden via flag) */} - {showShop && ( - - - Shop - - -
-
- {shopItems.map(item => ( -
-
-
- -

{item.description}

-
- ))} -
-
-
-
- )} {/* Navigation Links */} {navLinks.map((link) => ( @@ -675,28 +624,8 @@ export default function Header() { - {/* Navigation / Shop after that */} + {/* Navigation after that */}
- {showShop && ( - - - Shop - - - {shopItems.map(item => ( - { router.push(item.href); setMobileMenuOpen(false); }} - className="block rounded-lg py-2 pl-6 pr-3 text-sm/7 font-semibold text-gray-900 dark:text-white hover:bg-white/5 w-full text-left" - > - {item.name} - - ))} - - - )} {/* Information disclosure */} @@ -753,26 +682,6 @@ export default function Header() { ) : (
- {showShop && ( - - - Shop - - - {shopItems.map(item => ( - { router.push(item.href); setMobileMenuOpen(false); }} - className="block rounded-lg py-2 pl-6 pr-3 text-sm/7 font-semibold text-gray-900 dark:text-white hover:bg-white/5 w-full text-left" - > - {item.name} - - ))} - - - )} {/* Information disclosure */} diff --git a/src/app/shop/page.tsx b/src/app/shop/page.tsx new file mode 100644 index 0000000..6b34ea4 --- /dev/null +++ b/src/app/shop/page.tsx @@ -0,0 +1,718 @@ +'use client' + +import { useState } from 'react' +import { notFound } from 'next/navigation' +import { MagnifyingGlassIcon, FunnelIcon, Squares2X2Icon, ListBulletIcon, HeartIcon, StarIcon, ShoppingCartIcon } from '@heroicons/react/20/solid' +import { HeartIcon as HeartOutlineIcon } from '@heroicons/react/24/outline' +import PageLayout from '../components/PageLayout' + +const categories = [ + 'Alle Kategorien', + 'Technik', + 'Beauty', + 'Kleidung', + 'Getränke', + 'Lifestyle', + 'Büro' +] + +const sortOptions = [ + { name: 'Beliebteste', href: '#', current: true }, + { name: 'Neueste', href: '#', current: false }, + { name: 'Preis: Niedrig zu Hoch', href: '#', current: false }, + { name: 'Preis: Hoch zu Niedrig', href: '#', current: false }, +] + +// Sample Products Data - Profit Planet Theme +const sampleProducts = [ + { + id: 1, + name: 'EcoDesk Pro', + category: 'Büro', + price: 299.99, + originalPrice: 399.99, + rating: 4.8, + reviews: 124, + image: 'https://images.unsplash.com/photo-1586953208448-b95a79798f07?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', + badge: 'Bestseller', + inStock: true, + brand: 'EcoTech', + description: 'Nachhaltiger Steh-Sitz-Schreibtisch aus recyceltem Bambus' + }, + { + id: 2, + name: 'Smart Success Journal', + category: 'Lifestyle', + price: 49.99, + rating: 3, + reviews: 89, + image: 'https://images.unsplash.com/photo-1544716278-ca5e3f4abd8c?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', + badge: 'Neu', + inStock: true, + brand: 'GreenLife', + description: 'Digital verknüpftes Erfolgs-Tagebuch mit App-Integration' + }, + { + id: 3, + name: 'Wireless Charging Pad Pro', + category: 'Technik', + price: 79.99, + originalPrice: 99.99, + rating: 4.6, + reviews: 203, + image: 'https://images.unsplash.com/photo-1544716278-ca5e3f4abd8c?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', + badge: 'Sale', + inStock: true, + brand: 'EcoTech', + description: 'Schnelles kabelloses Laden mit Solarenergie-Option' + }, + { + id: 4, + name: 'Organic Green Tea Set', + category: 'Getränke', + price: 34.99, + rating: 3.1, + reviews: 67, + image: 'https://images.unsplash.com/photo-1556679343-c7306c1976bc?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', + inStock: true, + brand: 'GreenLife', + description: 'Premium Bio-Tee-Sammlung für mehr Fokus und Energie' + }, + { + id: 5, + name: 'Sustainable Business Shirt', + category: 'Kleidung', + price: 89.99, + rating: 4.5, + reviews: 156, + image: 'https://images.unsplash.com/photo-1596755094514-f87e34085b2c?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', + inStock: false, + brand: 'SustainableStyle', + description: 'Elegantes Businesshemd aus nachhaltiger Bio-Baumwolle' + }, + { + id: 6, + name: 'Anti-Blue Light Glasses', + category: 'Lifestyle', + price: 59.99, + rating: 4.4, + reviews: 91, + image: 'https://images.unsplash.com/photo-1574258495973-f010dfbb5371?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', + inStock: true, + brand: 'EcoTech', + description: 'Stilvolle Blaulichtfilter-Brille für digitale Professionals' + }, + { + id: 7, + name: 'Glow Serum Vitamin C', + category: 'Beauty', + price: 24.99, + rating: 2.8, + reviews: 234, + image: 'https://images.unsplash.com/photo-1620916566398-39f1143ab7be?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', + badge: 'Bestseller', + inStock: true, + brand: 'GreenLife', + description: 'Natürliches Vitamin C Serum für strahlende Haut' + }, + { + id: 8, + name: 'Productivity Planner 2025', + category: 'Büro', + price: 39.99, + rating: 4.3, + reviews: 445, + image: 'https://images.unsplash.com/photo-1517842645767-c639042777db?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80', + badge: 'Bestseller', + inStock: true, + brand: 'SustainableStyle', + description: 'Der ultimative Planer für maximale Produktivität' + } +] + +export default function StorePage() { + const SHOW_SHOP = 'true' + if (!SHOW_SHOP) notFound() + const [selectedCategory, setSelectedCategory] = useState('Alle Kategorien') + const [searchQuery, setSearchQuery] = useState('') + const [viewMode, setViewMode] = useState<'grid' | 'list'>('grid') + const [showFilters, setShowFilters] = useState(false) + const [favorites, setFavorites] = useState([]) + + // Filter states + const [priceRange, setPriceRange] = useState({ min: '', max: '' }) + const [selectedRatings, setSelectedRatings] = useState([]) + const [selectedAvailability, setSelectedAvailability] = useState([]) + const [selectedBrand, setSelectedBrand] = useState('Alle Marken') + const [sortBy, setSortBy] = useState('Beliebteste') + + // Filter products based on all criteria + const filteredProducts = sampleProducts.filter(product => { + // Search filter + const matchesSearch = product.name.toLowerCase().includes(searchQuery.toLowerCase()) || + product.description.toLowerCase().includes(searchQuery.toLowerCase()) + + // Category filter + const matchesCategory = selectedCategory === 'Alle Kategorien' || product.category === selectedCategory + + // Price filter + const minPrice = priceRange.min ? parseFloat(priceRange.min) : 0 + const maxPrice = priceRange.max ? parseFloat(priceRange.max) : Infinity + const matchesPrice = product.price >= minPrice && product.price <= maxPrice + + // Rating filter + const matchesRating = selectedRatings.length === 0 || selectedRatings.some(rating => { + if (rating === 5) return product.rating >= 4.8 + if (rating === 4) return product.rating >= 4.0 + if (rating === 3) return product.rating >= 3.0 + return false + }) + + // Availability filter + const matchesAvailability = selectedAvailability.length === 0 || selectedAvailability.some(availability => { + if (availability === 'inStock') return product.inStock + if (availability === 'preOrder') return !product.inStock + return false + }) + + // Brand filter + const matchesBrand = selectedBrand === 'Alle Marken' || product.brand === selectedBrand + + return matchesSearch && matchesCategory && matchesPrice && matchesRating && matchesAvailability && matchesBrand + }) + + // Sort products + const sortedProducts = [...filteredProducts].sort((a, b) => { + switch (sortBy) { + case 'Neueste': + return b.id - a.id // Assuming higher ID means newer + case 'Preis: Niedrig zu Hoch': + return a.price - b.price + case 'Preis: Hoch zu Niedrig': + return b.price - a.price + case 'Beliebteste': + default: + return b.rating - a.rating // Higher rating first + } + }) + + // Reset all filters + const resetFilters = () => { + setSelectedCategory('Alle Kategorien') + setSearchQuery('') + setPriceRange({ min: '', max: '' }) + setSelectedRatings([]) + setSelectedAvailability([]) + setSelectedBrand('Alle Marken') + setSortBy('Beliebteste') + } + + // Toggle favorite status + const toggleFavorite = (productId: number) => { + setFavorites(prev => + prev.includes(productId) + ? prev.filter(id => id !== productId) + : [...prev, productId] + ) + } + + return ( + +
+ {/* Modern Compact Header with Background Image */} +
+ {/* Background Image with Overlay */} +
+
+
+ + {/* Header Content */} +
+
+ {/* Store Title */} +
+

+ Profit Planet Store +

+

+ Nachhaltige Produkte für deinen Erfolg +

+
+ + {/* Search & Navigation Section */} +
+ {/* Search Bar - Tailwind UI Plus Style */} +
+
+
+
+ setSearchQuery(e.target.value)} + /> +
+
+ + {/* Category Navigation - Horizontal Tabs Style */} +
+
+ +
+
+
+
+
+
+ + {/* Filters & View Options Bar */} +
+
+
+ {/* Left: Results Count & Filters */} +
+

+ {sortedProducts.length} Produkte gefunden +

+ + +
+ + {/* Right: Sort & View Options */} +
+ {/* Sort Dropdown */} +
+ +
+ + {/* View Mode Toggle */} +
+ + +
+
+
+
+
+ + {/* Expandable Filters Section */} + {showFilters && ( +
+
+
+ {/* Price Range */} +
+

Preis

+
+
+ setPriceRange({...priceRange, min: e.target.value})} + className="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-[#8D6B1D] sm:text-sm sm:leading-6" + /> + setPriceRange({...priceRange, max: e.target.value})} + className="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-[#8D6B1D] sm:text-sm sm:leading-6" + /> +
+
+
+ + {/* Rating Filter */} +
+

Bewertung

+
+ {[ + { label: '5 Sterne', value: 5 }, + { label: '4+ Sterne', value: 4 }, + { label: '3+ Sterne', value: 3 } + ].map((rating) => ( + + ))} +
+
+ + {/* Availability */} +
+

Verfügbarkeit

+
+ + +
+
+ + {/* Brand Filter */} +
+

Marke

+
+ +
+
+
+ + {/* Filter Actions */} +
+ +
+
+
+ )} + + {/* Products Grid/List */} +
+ {sortedProducts.length === 0 ? ( +
+

Keine Produkte gefunden

+

+ Versuche andere Suchbegriffe oder Filter +

+
+ ) : ( + <> + {/* Grid View */} + {viewMode === 'grid' && ( +
+ {sortedProducts.map((product) => ( +
+ {/* Product Image - Clickable area for product page */} +
+ + {product.name} + + + {/* Badge */} + {product.badge && ( +
+ + {product.badge} + +
+ )} + + {/* Favorite Button */} + + + {/* Stock Status */} + {!product.inStock && ( +
+ + Ausverkauft + +
+ )} +
+ + {/* Product Info - Non-clickable */} +
+
+

+ + {product.name} + +

+

{product.brand}

+ + {/* Rating */} +
+
+ {[0, 1, 2, 3, 4].map((rating) => ( + rating ? 'text-yellow-400' : 'text-gray-300'} + h-3 w-3 flex-shrink-0 + `} + /> + ))} +
+

({product.reviews})

+
+
+ + {/* Price and Cart Button - Non-clickable for product page */} +
+
+

€{product.price}

+ {product.originalPrice && ( +

€{product.originalPrice}

+ )} +
+ +
+
+
+ ))} +
+ )} + + {/* List View */} + {viewMode === 'list' && ( +
+ {sortedProducts.map((product) => ( +
+ {/* Product Image */} +
+ {product.name} + {product.badge && ( +
+ + {product.badge} + +
+ )} +
+ + {/* Product Details */} +
+
+
+

{product.name}

+

{product.brand}

+

{product.description}

+ + {/* Rating */} +
+
+ {[0, 1, 2, 3, 4].map((rating) => ( + rating ? 'text-yellow-400' : 'text-gray-300'} + h-4 w-4 flex-shrink-0 + `} + /> + ))} +
+

({product.reviews} Bewertungen)

+ {!product.inStock && ( + + Ausverkauft + + )} +
+
+ + {/* Price and Actions */} +
+
+

€{product.price}

+ {product.originalPrice && ( +

€{product.originalPrice}

+ )} +
+ +
+ + + +
+
+
+
+
+ ))} +
+ )} + + )} +
+
+ + ) +} \ No newline at end of file