Добавлен компонент CartIcon и обновлены уведомления о добавлении товара в корзину во всех соответствующих компонентах. Изменены стили текста и иконки в уведомлениях для улучшения визуального восприятия.

This commit is contained in:
Bivekich
2025-07-05 18:38:12 +03:00
parent 78e17a94ab
commit a8c8ae60bb
11 changed files with 166 additions and 43 deletions

View File

@ -1,6 +1,7 @@
import React, { useState } from "react";
import { useCart } from "@/contexts/CartContext";
import { toast } from "react-hot-toast";
import CartIcon from "../CartIcon";
interface ProductBuyBlockProps {
offer?: any;
@ -56,12 +57,12 @@ const ProductBuyBlock = ({ offer }: ProductBuyBlockProps) => {
// Показываем успешный тоастер
toast.success(
<div>
<div className="font-semibold">Товар добавлен в корзину!</div>
<div className="text-sm text-gray-600">{offer.name || `${offer.brand} ${offer.articleNumber}`}</div>
<div className="font-semibold" style={{ color: '#fff' }}>Товар добавлен в корзину!</div>
<div className="text-sm" style={{ color: '#fff', opacity: 0.9 }}>{offer.name || `${offer.brand} ${offer.articleNumber}`}</div>
</div>,
{
duration: 3000,
icon: '🛒',
icon: <CartIcon size={20} color="#fff" />,
}
);
} catch (error) {