summaryrefslogtreecommitdiff
path: root/src-migrate/components/ui
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2024-01-19 06:46:19 +0000
committerIT Fixcomart <it@fixcomart.co.id>2024-01-19 06:46:19 +0000
commit9332d591f78b4cf5dc1cac0e7f0f962ffa503a18 (patch)
tree2c0d28d0582cf07830390d046bf8863b42c3ed76 /src-migrate/components/ui
parent8bcadf6d43a44169c422305522784424c30c7b02 (diff)
parente7054b1ff60aae39f255210ff0cfa2217e8d844c (diff)
Merged in Feature/perf/product-detail (pull request #128)
Add unique timestamp on image component
Diffstat (limited to 'src-migrate/components/ui')
-rw-r--r--src-migrate/components/ui/image.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src-migrate/components/ui/image.tsx b/src-migrate/components/ui/image.tsx
index c1dde170..a65d4ec7 100644
--- a/src-migrate/components/ui/image.tsx
+++ b/src-migrate/components/ui/image.tsx
@@ -11,6 +11,8 @@ const Image = (props: ImageProps) => {
const { alt, src, className, rounded, ...rest } = props;
const [isLoading, setLoading] = useState(true);
+ const uniqueTimestamp = new Date().getTime();
+
return (
<NextImage
className={clsxm(
@@ -21,7 +23,7 @@ const Image = (props: ImageProps) => {
rounded,
className
)}
- src={src}
+ src={`${src}?v=${uniqueTimestamp}`}
alt={alt}
loading='lazy'
quality={100}