diff --git a/cbfc03a4970c5843bf12eb79f438ba1208d03450 b/cbfc03a4970c5843bf12eb79f438ba1208d03450 new file mode 160000 index 00000000..cbfc03a4 --- /dev/null +++ b/cbfc03a4970c5843bf12eb79f438ba1208d03450 @@ -0,0 +1 @@ +Subproject commit cbfc03a4970c5843bf12eb79f438ba1208d03450 diff --git a/client/package.json b/client/package.json index 6c41a1e4..abcfeca1 100644 --- a/client/package.json +++ b/client/package.json @@ -47,5 +47,9 @@ "last 1 firefox version", "last 1 safari version" ] - } + }, + "proxy": + "http://localhost:5000" + + } diff --git a/client/src/components/Card/ItemCard/.cph/.ItemCard.js_7b4e6e623e1f6a5e14c8f79257359ca6.prob b/client/src/components/Card/ItemCard/.cph/.ItemCard.js_7b4e6e623e1f6a5e14c8f79257359ca6.prob new file mode 100644 index 00000000..2f5ebebc --- /dev/null +++ b/client/src/components/Card/ItemCard/.cph/.ItemCard.js_7b4e6e623e1f6a5e14c8f79257359ca6.prob @@ -0,0 +1 @@ +{"name":"Local: ItemCard","url":"d:\\trendhora\\client\\src\\components\\Card\\ItemCard\\ItemCard.js","tests":[{"id":1754153493385,"input":"","output":""}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"d:\\trendhora\\client\\src\\components\\Card\\ItemCard\\ItemCard.js","group":"local","local":true} \ No newline at end of file diff --git a/client/src/components/Card/ItemCard/ItemCard.css b/client/src/components/Card/ItemCard/ItemCard.css index 064c13c3..59824e37 100644 --- a/client/src/components/Card/ItemCard/ItemCard.css +++ b/client/src/components/Card/ItemCard/ItemCard.css @@ -1,91 +1,77 @@ - - -.product__card__card { - height: 450px; - width: 270px; - margin: 14px; - border-width: 1px; - box-shadow: 0px 2px 6px -3px; - border-radius: 5px; +.product-card { + width: 100%; + max-width: 300px; + border: 1px solid #e0e0e0; + border-radius: 12px; + overflow: hidden; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + transition: transform 0.3s ease; + background-color: #fff; + margin: 10px auto; } -.product__card { - height: 100%; - width: 100%; +.product-card:hover { + transform: translateY(-5px); } -.product__image { - height: 80%; - width: auto; - display: flex; - justify-content: first baseline; - transition: 1s; +.product-card-image { + position: relative; + width: 100%; + height: 250px; + overflow: hidden; display: flex; - justify-content: center; align-items: center; + justify-content: center; } -.product__image > img{ +.product-img { max-width: 100%; - height: 100%; - transition: 1s; - margin: 0px auto; - border-top-left-radius: 5px; - border-top-right-radius: 5px; + max-height: 100%; + object-fit: cover; } -.product__card__detail { - height: 20%; - position: relative; +.product-card-actions { + position: absolute; + top: 8px; + right: 8px; display: flex; - justify-content: center; - align-items: center; flex-direction: column; - background-color: #ffffff ; + gap: 5px; + z-index: 10; } -.product__name { - height: 30%; - width: 100%; - display: flex; - justify-content: center; - align-items: center; - font-size: 1rem; - font-weight: bold; +.product-action-btn { + background-color: white; + border-radius: 50%; + padding: 6px; + box-shadow: 0 2px 5px rgba(0,0,0,0.2); + transition: background-color 0.2s ease; } -.product__name a{ - color: black !important; - text-decoration: none; +.product-action-btn:hover { + background-color: #f0f0f0; } -.product__description { - height: 20%; - width: 100%; - display: flex; - justify-content: center; - align-items: center; +.product-card-details { + padding: 12px; + text-align: left; +} + +.product-card-name { font-size: 1rem; - text-align: center; + font-weight: 600; + color: #333; + text-decoration: none; } -.product__price { - height: 50%; - width: 100%; - display: flex; - justify-content: center; - align-items: center; - font-size: 1.1rem; - font-weight: bold; +.product-card-description { + font-size: 0.85rem; + color: #777; + margin: 5px 0; } -.product__card__action { - width: 100%; - height: 45px; - position: absolute; - bottom: 0%; - display: flex; - justify-content: space-between; - flex-direction: row; - padding: 0px 5px; -} \ No newline at end of file +.product-card-price { + font-size: 1rem; + font-weight: bold; + color: #111; +} diff --git a/client/src/components/Card/ItemCard/ItemCard.js b/client/src/components/Card/ItemCard/ItemCard.js index 00b55f97..3271ef13 100644 --- a/client/src/components/Card/ItemCard/ItemCard.js +++ b/client/src/components/Card/ItemCard/ItemCard.js @@ -1,221 +1,61 @@ -// import './ItemCard.css'; -// import { useContext, useState } from "react"; -// import { Link } from "react-router-dom"; -// import { CartItemsContext } from "../../../Context/CartItemsContext"; -// import { IconButton } from '@mui/material'; -// import AddShoppingCartIcon from '@mui/icons-material/AddShoppingCart'; -// import FavoriteBorderIcon from '@mui/icons-material/FavoriteBorder'; -// import { WishItemsContext } from '../../../Context/WishItemsContext'; -// import Toaster from '../../Toaster/toaster'; // Import the Toaster component - -// const ItemCard = (props) => { -// const [isHovered, setIsHovered] = useState(false); -// const [showToaster, setShowToaster] = useState(false); -// const [toasterMessage, setToasterMessage] = useState(''); - -// const cartItemsContext = useContext(CartItemsContext); -// const wishItemsContext = useContext(WishItemsContext); - -// const handleAddToWishList = () => { -// wishItemsContext.addItem(props.item); -// setToasterMessage("Your item has been added to wishlist."); -// setShowToaster(true); -// }; - -// // const handleAddToCart = () => { -// // cartItemsContext.addItem(props.item, 1); -// // setToasterMessage("Your item has been added to cart."); -// // setShowToaster(true); -// // }; -// const handleAddToCart = () => { -// const existingItem = cartItemsContext.items.find(item => item._id === props.item._id); - -// const currentQty = existingItem?.quantity ?? 0; -// const newQuantity = currentQty + 1; - -// cartItemsContext.addItem(props.item, 1); - -// setToasterMessage(`"${props.item.name}" added to cart\nQuantity ${newQuantity} added to cart`); -// setShowToaster(true); -// }; - - -// const handleCloseToaster = () => { -// setShowToaster(false); -// }; - -// if (!props.item || !props.item.category || !props.item.image || props.item.image.length === 0) { -// return null; // Avoid rendering if item is not defined or missing required properties -// } - -// const getImageUrl = (image) => { -// const url = `https://trendhora-api.onrender.com/public/${props.item.category}/${image.filename}`; -// return url; -// }; - -// return ( -// <> -//
Try searching for something else
+Try searching for something else
+{results.length} item{results.length !== 1 ? 's' : ''} found
+Enter a search term to find products
+