fixed logo

This commit is contained in:
Jelaletdin12
2026-02-08 18:07:15 +05:00
parent 312b7c2ac3
commit 8d4f855486
12 changed files with 48 additions and 34 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -67,7 +67,7 @@ export default function Header({ locale = "ru" }: HeaderProps) {
src={Logo}
alt="Logo"
fill
className="object-contain"
className="object-contain mt-2"
priority
/>
</div>

View File

@@ -289,7 +289,6 @@ export default function CartItemCard({ item, onUpdate }: CartItemCardProps) {
className="object-contain p-2"
/>
</div>
</div>
<div className="flex items-start gap-2 pt-2">
<h3 className="font-bold text-base text-gray-900 line-clamp-2">
@@ -396,15 +395,15 @@ export default function CartItemCard({ item, onUpdate }: CartItemCardProps) {
variant="outline"
size="icon"
onClick={handleQuantityIncrease}
disabled={isSyncing || localQuantity >= availableStock}
disabled={isSyncing}
className={`rounded-[10px] h-10 w-10 cursor-pointer border-2 transition-all duration-200 ${
localQuantity >= availableStock
? "opacity-30 cursor-not-allowed border-gray-200"
? "opacity-60 border-gray-200"
: "border-gray-900 bg-gray-900 hover:bg-gray-800"
} ${isSyncing ? "opacity-50" : ""}`}
>
<Plus
className={`h-4 w-4 ${localQuantity >= availableStock ? "text-gray-400" : "text-white"}`}
className={`h-4 w-4 ${localQuantity >= availableStock ? "text-gray-900" : "text-white"}`}
/>
</Button>
</div>

View File

@@ -33,6 +33,7 @@ import { useToggleFavorite, useIsFavorite } from "@/lib/hooks";
import {
useAddToCart,
useUpdateCartItemQuantity,
useRemoveFromCart,
useCart,
} from "@/features/cart/hooks/useCart";
import { useTranslations } from "next-intl";
@@ -73,6 +74,7 @@ export default function ProductCard({
useToggleFavorite();
const addToCartMutation = useAddToCart();
const updateCartMutation = useUpdateCartItemQuantity();
const removeFromCartMutation = useRemoveFromCart();
const { data: cartData, refetch: refetchCart } = useCart();
const [api, setApi] = useState<CarouselApi>();
@@ -91,7 +93,7 @@ export default function ProductCard({
const cartItem = cartData?.data?.find((item: any) => item.product?.id === id);
const isInCart = !!cartItem;
const isOutOfStock = stock === 0;
const availableStock = stock || 999;
const availableStock = stock || 0;
useEffect(() => {
if (!api) return;
@@ -118,7 +120,11 @@ export default function ProductCard({
setIsSyncing(true);
try {
if (quantity === 0) {
await removeFromCartMutation.mutateAsync(id);
} else {
await updateCartMutation.mutateAsync({ productId: id, quantity });
}
await refetchCart();
if (pendingQuantityRef.current !== null) {
@@ -213,7 +219,7 @@ export default function ProductCard({
const newQuantity = localQuantity + delta;
if (newQuantity < 1) return;
if (newQuantity < 0) return;
if (newQuantity > availableStock) {
setShowStockModal(true);
@@ -222,7 +228,7 @@ export default function ProductCard({
setLocalQuantity(newQuantity);
},
[localQuantity, availableStock],
[localQuantity, availableStock, setShowStockModal],
);
const handleCardClick = useCallback(
@@ -425,7 +431,7 @@ export default function ProductCard({
variant="outline"
size="icon"
onClick={(e) => handleQuantityChange(e, -1)}
disabled={isSyncing || localQuantity <= 1}
disabled={isSyncing}
className="rounded-[10px] cursor-pointer h-7 md:h-9 w-7 md:w-9 border-2 border-gray-200 hover:border-gray-900 hover:bg-gray-50 transition-all duration-200 disabled:opacity-30"
>
<Minus className="h-5 w-5 text-gray-700" />
@@ -447,9 +453,15 @@ export default function ProductCard({
size="icon"
onClick={(e) => handleQuantityChange(e, 1)}
disabled={isSyncing}
className="rounded-[10px] cursor-pointer h-7 md:h-9 w-7 md:w-9 border-2 border-gray-900 bg-gray-900 hover:bg-gray-800 transition-all duration-200 disabled:opacity-30"
className={`rounded-[10px] cursor-pointer h-7 md:h-9 w-7 md:w-9 border-2 transition-all duration-200 disabled:opacity-30 ${
localQuantity >= availableStock
? "opacity-60 border-gray-200"
: "border-gray-900 bg-gray-900 hover:bg-gray-800"
}`}
>
<Plus className="h-5 w-5 text-white" />
<Plus
className={`h-5 w-5 ${localQuantity >= availableStock ? "text-gray-900" : "text-white"}`}
/>
</Button>
</div>
)}

View File

@@ -72,7 +72,7 @@ export default function CollectionSection({ collection, locale }: Props) {
m.images_800x800 ||
m.images_720x720 ||
m.images_400x400 ||
m.thumbnail
m.thumbnail,
)
.filter(Boolean) || ["/placeholder-product.jpg"];
@@ -95,6 +95,7 @@ export default function CollectionSection({ collection, locale }: Props) {
// height={450}
// width={350}
button={true}
stock={product.stock}
/>
);
})}

View File

@@ -111,10 +111,12 @@ export function ProductPurchaseCard({
variant="outline"
size="icon"
onClick={onQuantityIncrease}
disabled={isSyncing || localQuantity >= availableStock}
className={`rounded-[10px] h-12 w-12 border-2 border-gray-900 bg-gray-900 hover:bg-gray-800 transition-all duration-200 disabled:opacity-30 disabled:cursor-not-allowed ${
isSyncing ? "opacity-50" : ""
}`}
disabled={isSyncing}
className={`rounded-[10px] h-12 w-12 border-2 border-gray-900 bg-gray-900 hover:bg-gray-800 transition-all duration-200 ${
localQuantity >= availableStock
? "opacity-60 border-gray-200"
: ""
} ${isSyncing ? "opacity-50" : ""}`}
>
<Plus className="h-5 w-5 text-white" />
</Button>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 MiB