fix(app): improve wallet history display, fix order details modal layout and lint errors
This commit is contained in:
1 parent
56e8029fff
commit
2c377cab88
5 files changed
+289
-193
No files matched your search
@@ -55,6 +55,16 @@ export default function ProductImageZoomModal({
|
||||
};
|
||||
}, [isOpen, activeImage, resetZoom]);
|
||||
|
||||
const navigateImage = useCallback((direction: number) => {
|
||||
if (!images || images.length <= 1) return;
|
||||
const currentIndex = images.indexOf(activeImage);
|
||||
if (currentIndex === -1) return;
|
||||
let nextIndex = (currentIndex + direction) % images.length;
|
||||
if (nextIndex < 0) nextIndex = images.length - 1;
|
||||
onSelectImage(images[nextIndex]);
|
||||
resetZoom();
|
||||
}, [images, activeImage, onSelectImage, resetZoom]);
|
||||
|
||||
// Keyboard navigation & zoom shortcuts
|
||||
useEffect(() => {
|
||||
if (!isOpen) return;
|
||||
@@ -81,7 +91,7 @@ export default function ProductImageZoomModal({
|
||||
|
||||
window.addEventListener("keydown", handleKeyDown);
|
||||
return () => window.removeEventListener("keydown", handleKeyDown);
|
||||
}, [isOpen, onClose, images, activeImage, resetZoom]);
|
||||
}, [isOpen, onClose, navigateImage, resetZoom]);
|
||||
|
||||
const handleZoomIn = () => {
|
||||
setScale((prev) => Math.min(prev + 0.5, 4));
|
||||
@@ -158,15 +168,7 @@ export default function ProductImageZoomModal({
|
||||
}
|
||||
};
|
||||
|
||||
const navigateImage = (direction: number) => {
|
||||
if (!images || images.length <= 1) return;
|
||||
const currentIndex = images.indexOf(activeImage);
|
||||
if (currentIndex === -1) return;
|
||||
let nextIndex = (currentIndex + direction) % images.length;
|
||||
if (nextIndex < 0) nextIndex = images.length - 1;
|
||||
onSelectImage(images[nextIndex]);
|
||||
resetZoom();
|
||||
};
|
||||
|
||||
|
||||
if (!isOpen) return null;
|
||||
|
||||
|
||||
Reference in new issue
Block a user