added new ui for mobile phones

This commit is contained in:
@jcarymuhammedow
2026-02-26 12:49:38 +05:00
parent 4e58062899
commit 013c7c09c7
8 changed files with 670 additions and 20 deletions

View File

@@ -56,7 +56,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();
@@ -73,7 +73,7 @@ const ProductPage = ({
useEffect(() => {
const qty = parseInt(
cartItem?.quantity || cartItem?.product_quantity || 0,
10,
10
);
setLocalQuantity(qty);
setPendingQuantity(qty);
@@ -83,7 +83,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);
}
@@ -180,7 +180,7 @@ const ProductPage = ({
useEffect(() => {
const serverQty = parseInt(
cartItem?.quantity || cartItem?.product_quantity || 0,
10,
10
);
// Sadece miktar değiştiyse ve 0'dan büyükse güncelle (0 ise Remove triggerlanır)
@@ -278,6 +278,15 @@ const ProductPage = ({
<span className={styles.metaValue}>{product.brand.name}</span>
</div>
)}
{product.channel?.[0]?.name && (
<div className={styles.metaItem}>
<span className={styles.metaLabel}>{t("order.channel")}</span>
<span className={styles.metaValue}>
{product.channel[0].name}
</span>
</div>
)}
</div>
<div className={styles.productActions}>
<div className={styles.priceContainer}>