Skip to content

Commit

Permalink
images updated in cart and products page
Browse files Browse the repository at this point in the history
  • Loading branch information
vijay-varadarajan committed Jul 3, 2024
1 parent d99134e commit 0ad2bff
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 3 deletions.
Binary file added public/images/products/product1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/products/product1.jpg
Binary file not shown.
Binary file added public/images/products/product2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/products/product3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/products/product4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/products/product5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/products/product6.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/products/product7.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/products/product8.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/Components/Cart/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const CartComponent = ({ items, onRemoveFromCart, onUpdateQuantity }) => {
<CartItem
key={item.cartId}
productName={item.productName}
itemImage={item.image_url}
price={parseFloat(item.price)}
quantity={item.quantity}
onRemove={() => onRemoveFromCart(item.cartId)}
Expand Down
4 changes: 2 additions & 2 deletions src/Components/CartItem/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import './style.css';
import { FaRegTrashAlt } from "react-icons/fa";

const CartItem = ({ productName, price, quantity: initialQuantity, onRemove, onUpdateQuantity }) => {
const CartItem = ({ productName, itemImage, price, quantity: initialQuantity, onRemove, onUpdateQuantity }) => {
const [quantity, setQuantity] = useState(initialQuantity);

useEffect(() => {
Expand Down Expand Up @@ -34,7 +34,7 @@ const CartItem = ({ productName, price, quantity: initialQuantity, onRemove, onU
<>
<div className="cartItem row align-items-center">
<div className="col-3 mb-2">
<img className="w-100" src="https://codingyaar.com/wp-content/uploads/bag-scaled.jpg" alt="product image" />
<img className="w-100" src={`/images/${itemImage}`} alt="product image" />
</div>
<div className="col-9 d-flex justify-content-between align-items-center">
<h6 className="m-0">{productName}</h6>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/ItemCard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ItemCard = ({ itemName, itemImage, itemPrice, isAddedToCart, quantity: ini
<>
<div className="m-4">
<div className="card border-0 rounded-0 shadow card-width">
<img src={`/images/${itemImage}`} className="card-img-top rounded-0" alt="..." />
<img src={`/images/${itemImage}`} className="card-img-top rounded-0" style={{ height: '200px', width: 'auto', objectFit: 'cover' }} alt="..." />
<div className="card-body mt-3 mb-3">
<div className="d-flex justify-content-between align-items-center">
<h4 className="card-title m-0 p-0">{itemName}</h4>
Expand Down
1 change: 1 addition & 0 deletions src/Pages/CartPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const CartPage = () => {
const items = await db.select({
cartId: mySchemaCart.product_id,
productName: mySchemaProducts.product_name,
image_url: mySchemaProducts.image_url,
price: mySchemaProducts.price,
quantity: mySchemaCart.quantity,
amount: mySchemaCart.amount
Expand Down

0 comments on commit 0ad2bff

Please sign in to comment.