Skip to content

Commit

Permalink
Card
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadpy8 committed Aug 28, 2023
1 parent de32f5d commit bb047b1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/cart/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CartContext } from '../../context/CartContextProvider'
import swal from 'sweetalert'
import { useNavigate } from 'react-router-dom'

const Card = ({ id, title, image, price, rating: { rate } }: Produts) => {
const Card: React.FC<Produts> = ({ id, title, image, price, rating: { rate } }) => {

const CartContextProduct = useContext(CartContext);

Expand All @@ -19,15 +19,15 @@ const Card = ({ id, title, image, price, rating: { rate } }: Produts) => {
swal({
title: "محصول به سبد خرید اضافه شد.",
icon: "success",
buttons: ["اوکی","رفتن به سبد خرید"]
buttons: ["اوکی", "رفتن به سبد خرید"]
})
.then(result => {
console.log(result);
console.log(result);
if (result) {
navigate("/cart");
}
})
}
}
})
};

return (
<div className="card">
Expand Down

0 comments on commit bb047b1

Please sign in to comment.