diff --git a/src/pages/Products.tsx b/src/pages/Products.tsx index 42596f3..c7f0711 100644 --- a/src/pages/Products.tsx +++ b/src/pages/Products.tsx @@ -6,12 +6,14 @@ import { products } from '@/data/products'; import { Button } from '@/components/ui/button'; import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/sheet'; import { Filter } from 'lucide-react'; +import { useIsMobile } from '@/hooks/use-mobile'; import Fuse from 'fuse.js'; const Products = () => { const [selectedCategory, setSelectedCategory] = useState(null); const [searchQuery, setSearchQuery] = useState(''); const [filterOpen, setFilterOpen] = useState(false); + const isMobile = useIsMobile(); const fuse = useMemo(() => new Fuse(products, { keys: [ @@ -49,40 +51,42 @@ const Products = () => { return (
{/* Mobile Header with Search and Filter */} -
+
-

+

All Products

- {/* Mobile: Search + Filter Button Row */} -
-
- + {/* Mobile/Tablet Portrait: Search + Filter Button Row */} + {isMobile && ( +
+
+ +
+ + + + + + + Filter by Category + +
+ +
+
+
- - - - - - - Filter by Category - -
- -
-
-
-
+ )} {/* Active filter badge on mobile */} - {selectedCategory && ( -
+ {selectedCategory && isMobile && ( +
{/* Main Content */} -
+
{/* Category Sidebar - Desktop Only */} -
- -
+ {!isMobile && ( +
+ +
+ )} {/* Products Section */}
{/* Desktop Search Bar */} -
- -
+ {!isMobile && ( +
+ +
+ )} {/* Results Info */} -
-

+

+

{displayProducts.length} products found {searchQuery.length >= 2 && ` for "${searchQuery}"`}

- {/* Products Grid - Full screen on mobile */} -
-
+ {/* Products Grid */} +
+
{displayProducts.map((product) => ( ))}