summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2022-10-31 17:21:10 +0700
committerIT Fixcomart <it@fixcomart.co.id>2022-10-31 17:21:10 +0700
commit83354e3e9af77447a399b1f47fa22c7fccbbbe72 (patch)
tree0415100b5d0b31a4ac9bd1f5c47a361d6b7c731b
parentd6d2d9ceef2e95b604ac4ebdc054cad44a8440b1 (diff)
Create noimage
-rw-r--r--next.config.js2
-rw-r--r--public/images/noimage.jpegbin0 -> 20759 bytes
-rw-r--r--src/components/productCard.js6
3 files changed, 3 insertions, 5 deletions
diff --git a/next.config.js b/next.config.js
index 8a019dcc..37bb288a 100644
--- a/next.config.js
+++ b/next.config.js
@@ -14,8 +14,6 @@ const nextConfig = {
env: {
DB_HOST: 'https://erp.indoteknik.com',
DB_NAME: 'erp_indoteknik',
- // DB_HOST: 'http://192.168.27.253:8069',
- // DB_NAME: 'indoteknik_odoo',
DB_USER: 'it@fixcomart.co.id',
DB_PASS: 'Fixcomart378',
},
diff --git a/public/images/noimage.jpeg b/public/images/noimage.jpeg
new file mode 100644
index 00000000..41a39d8f
--- /dev/null
+++ b/public/images/noimage.jpeg
Binary files differ
diff --git a/src/components/productCard.js b/src/components/productCard.js
index dc292316..6e703670 100644
--- a/src/components/productCard.js
+++ b/src/components/productCard.js
@@ -7,7 +7,7 @@ export default function productCard({ data }) {
return (
<div className="product-card">
<Link href={'/shop/product/' + createSlug(product.name, product.id)} className="block">
- <img src={product.image} alt={product.name} className="product-card__image" loading="lazy" />
+ <img src={product.image ? product.image : '/images/noimage.jpeg'} alt={product.name} className="product-card__image" loading="lazy" />
</Link>
<div className="product-card__description">
<div>
@@ -16,9 +16,9 @@ export default function productCard({ data }) {
) : (
<span className="product-card__brand">-</span>
)}
- <a href={'/shop/product/' + createSlug(product.name, product.id)} className="product-card__title wrap-line-ellipsis-3">
+ <Link href={'/shop/product/' + createSlug(product.name, product.id)} className="product-card__title wrap-line-ellipsis-3">
{product.name}
- </a>
+ </Link>
</div>
<div>
{product.lowest_price.discount_percentage > 0 ? (