mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-23 23:28:12 +02:00
Merge pull request #164 from R0m1k3/antigravity
feat: Implement Catalogues page for displaying, filtering, searching,…
This commit is contained in:
1 file changed
+7
-6
@@ -367,28 +367,29 @@ export default function Catalogues() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Main Image Viewer */}
|
{/* Main Image Viewer */}
|
||||||
<div className="flex-1 flex items-center justify-center p-8 relative">
|
<div className="flex-1 flex items-center justify-center relative overflow-hidden">
|
||||||
{cataloguePages.length === 0 ? (
|
{cataloguePages.length === 0 ? (
|
||||||
<Loader2 className="h-12 w-12 animate-spin text-white" />
|
<Loader2 className="h-12 w-12 animate-spin text-white" />
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{/* Current Page Image */}
|
{/* Current Page Image */}
|
||||||
<div className="max-w-4xl max-h-full flex items-center justify-center">
|
<div className="w-full h-full flex items-center justify-center p-8">
|
||||||
<img
|
<img
|
||||||
src={cataloguePages[currentPageIndex]?.image_url}
|
src={cataloguePages[currentPageIndex]?.image_url}
|
||||||
alt={`Page ${currentPageIndex + 1}`}
|
alt={`Page ${currentPageIndex + 1}`}
|
||||||
className="max-w-full max-h-full object-contain rounded-lg shadow-2xl"
|
className="w-auto h-auto max-w-full max-h-full object-contain rounded-lg shadow-2xl"
|
||||||
|
style={{ maxHeight: 'calc(100vh - 200px)' }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Navigation Buttons */}
|
{/* Navigation Buttons - Fixed Position */}
|
||||||
{cataloguePages.length > 1 && (
|
{cataloguePages.length > 1 && (
|
||||||
<>
|
<>
|
||||||
{/* Previous Button */}
|
{/* Previous Button */}
|
||||||
<button
|
<button
|
||||||
onClick={() => setCurrentPageIndex(prev => Math.max(0, prev - 1))}
|
onClick={() => setCurrentPageIndex(prev => Math.max(0, prev - 1))}
|
||||||
disabled={currentPageIndex === 0}
|
disabled={currentPageIndex === 0}
|
||||||
className="absolute left-4 top-1/2 -translate-y-1/2 p-4 bg-black/50 hover:bg-black/70 text-white rounded-full disabled:opacity-30 disabled:cursor-not-allowed transition-all"
|
className="fixed left-8 top-1/2 -translate-y-1/2 p-4 bg-black/70 hover:bg-black/90 text-white rounded-full disabled:opacity-30 disabled:cursor-not-allowed transition-all z-10"
|
||||||
title="Page précédente (←)"
|
title="Page précédente (←)"
|
||||||
>
|
>
|
||||||
<ChevronLeft className="h-8 w-8" />
|
<ChevronLeft className="h-8 w-8" />
|
||||||
@@ -398,7 +399,7 @@ export default function Catalogues() {
|
|||||||
<button
|
<button
|
||||||
onClick={() => setCurrentPageIndex(prev => Math.min(cataloguePages.length - 1, prev + 1))}
|
onClick={() => setCurrentPageIndex(prev => Math.min(cataloguePages.length - 1, prev + 1))}
|
||||||
disabled={currentPageIndex === cataloguePages.length - 1}
|
disabled={currentPageIndex === cataloguePages.length - 1}
|
||||||
className="absolute right-4 top-1/2 -translate-y-1/2 p-4 bg-black/50 hover:bg-black/70 text-white rounded-full disabled:opacity-30 disabled:cursor-not-allowed transition-all"
|
className="fixed right-8 top-1/2 -translate-y-1/2 p-4 bg-black/70 hover:bg-black/90 text-white rounded-full disabled:opacity-30 disabled:cursor-not-allowed transition-all z-10"
|
||||||
title="Page suivante (→)"
|
title="Page suivante (→)"
|
||||||
>
|
>
|
||||||
<ChevronRight className="h-8 w-8" />
|
<ChevronRight className="h-8 w-8" />
|
||||||
|
|||||||
Reference in new issue
Block a user