added category carousel
This commit is contained in:
@@ -60,7 +60,7 @@ const ProductPage = ({
|
||||
const { data: favoriteProducts = [] } = useGetFavoritesQuery();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [localIsFavorite, setLocalIsFavorite] = useState(
|
||||
favoriteProducts.some((fav) => fav.product?.id === product?.id)
|
||||
favoriteProducts.some((fav) => fav.product?.id === product?.id),
|
||||
);
|
||||
|
||||
const { getCartItem } = useCart();
|
||||
@@ -77,7 +77,7 @@ const ProductPage = ({
|
||||
useEffect(() => {
|
||||
const qty = parseInt(
|
||||
cartItem?.quantity || cartItem?.product_quantity || 0,
|
||||
10
|
||||
10,
|
||||
);
|
||||
setLocalQuantity(qty);
|
||||
setPendingQuantity(qty);
|
||||
@@ -87,7 +87,7 @@ const ProductPage = ({
|
||||
useEffect(() => {
|
||||
if (Array.isArray(favoriteProducts)) {
|
||||
const isFav = favoriteProducts.some(
|
||||
(fav) => fav.product?.id === product?.id
|
||||
(fav) => fav.product?.id === product?.id,
|
||||
);
|
||||
setLocalIsFavorite(isFav);
|
||||
}
|
||||
@@ -184,7 +184,7 @@ const ProductPage = ({
|
||||
useEffect(() => {
|
||||
const serverQty = parseInt(
|
||||
cartItem?.quantity || cartItem?.product_quantity || 0,
|
||||
10
|
||||
10,
|
||||
);
|
||||
|
||||
if (pendingQuantity === serverQty || pendingQuantity <= 0) {
|
||||
@@ -308,7 +308,6 @@ const ProductPage = ({
|
||||
|
||||
{/* ── 3 kolon ana section ── */}
|
||||
<div className={styles.productSection}>
|
||||
|
||||
{/* KOLON 1: Resim */}
|
||||
<div className={styles.productImage}>
|
||||
<ImageCarousel
|
||||
@@ -321,11 +320,11 @@ const ProductPage = ({
|
||||
|
||||
{/* KOLON 2: İsim + Meta + Description */}
|
||||
<div className={styles.productInfo}>
|
||||
<h1 className={styles.productTitle}>{product.name}</h1>
|
||||
|
||||
{/* Meta tablo */}
|
||||
<div className={styles.productMeta}>
|
||||
<div className={styles.metaItem}>
|
||||
<h1 className={styles.productTitle}>{product.name}</h1>
|
||||
|
||||
{/* <div className={styles.metaItem}>
|
||||
<span className={styles.metaLabel}>
|
||||
{t("product.productCode")}
|
||||
</span>
|
||||
@@ -337,7 +336,7 @@ const ProductPage = ({
|
||||
<span className={styles.metaLabel}>{t("product.barCode")}</span>
|
||||
<span className={styles.metaValue}>{product.barcode}</span>
|
||||
</div>
|
||||
)}
|
||||
)} */}
|
||||
|
||||
{product.brand?.name && (
|
||||
<div className={styles.metaItem}>
|
||||
@@ -389,9 +388,7 @@ const ProductPage = ({
|
||||
<div className={styles.priceRow}>
|
||||
<span className={styles.priceLabel}>{t("product.price")}:</span>
|
||||
<div className={styles.priceRight}>
|
||||
<span className={styles.price}>
|
||||
{product.price_amount} m.
|
||||
</span>
|
||||
<span className={styles.price}>{product.price_amount} m.</span>
|
||||
{product.old_price_amount && (
|
||||
<span className={styles.oldPrice}>
|
||||
{product.old_price_amount} m.
|
||||
@@ -475,4 +472,4 @@ const ProductPage = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default ProductPage;
|
||||
export default ProductPage;
|
||||
|
||||
Reference in New Issue
Block a user