perf(images): migrate standard img elements to optimized next/image with AVIF/WebP support
Deploy Canina / deploy (push) Successful in 1m47s
Deploy Canina / deploy (push) Successful in 1m47s
This commit is contained in:
1 parent
d1e3daf992
commit
b91885557e
209 files changed
+254562
-117353
No files matched your search
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @next/next/no-img-element */
|
||||
"use client";
|
||||
import React, { useState } from "react";
|
||||
import Link from "next/link";
|
||||
@@ -26,6 +25,7 @@ import { toPersian } from "../lib/utils";
|
||||
import api from "../lib/services/api";
|
||||
import { toast } from "sonner";
|
||||
import { useSettingsStore } from "../lib/store/settingsStore";
|
||||
import SafeImage from "./SafeImage";
|
||||
|
||||
interface OrderDetailsModalProps {
|
||||
isOpen: boolean;
|
||||
@@ -418,14 +418,14 @@ export default function OrderDetailsModal({
|
||||
<div className="flex items-center gap-4">
|
||||
<div
|
||||
onClick={() => setZoomedImage(pImg)}
|
||||
className="w-14 h-14 bg-medical-gray-50 rounded-xl p-1.5 flex items-center justify-center shrink-0 border border-medical-gray-200 cursor-zoom-in hover:scale-105 transition-transform"
|
||||
className="w-14 h-14 bg-medical-gray-50 rounded-xl p-1 flex items-center justify-center shrink-0 border border-medical-gray-200 cursor-zoom-in hover:scale-105 transition-transform overflow-hidden"
|
||||
title="مشاهده تصویر بزرگ"
|
||||
>
|
||||
<img
|
||||
<SafeImage
|
||||
src={pImg}
|
||||
alt={pName}
|
||||
className="max-w-full max-h-full object-contain"
|
||||
onError={(e: any) => { e.currentTarget.src = '/assets/images/canina-product-placeholder.png'; }}
|
||||
className="w-full h-full"
|
||||
imgClassName="w-full h-full object-contain"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
@@ -711,10 +711,11 @@ export default function OrderDetailsModal({
|
||||
>
|
||||
<X className="w-5 h-5" />
|
||||
</button>
|
||||
<img
|
||||
<SafeImage
|
||||
src={zoomedImage}
|
||||
alt="نمایش کامل تصویر محصول"
|
||||
className="max-h-[70vh] w-auto object-contain rounded-2xl"
|
||||
className="max-h-[70vh] w-full"
|
||||
imgClassName="max-h-[70vh] w-auto object-contain rounded-2xl mx-auto"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user